Compare commits

...

8 Commits

Author SHA1 Message Date
Zed Bot
1d1ad3f4e1 Bump to 0.150.2 for @SomeoneToIgnore 2024-08-22 11:45:09 -07:00
gcp-cherry-pick-bot[bot]
06d3837c54 Pass through Anthropic cache configuration when using Zed provider (cherry-pick #16685) (#16688)
Cherry-picked Pass through Anthropic cache configuration when using Zed
provider (#16685)

This PR makes it so the model's cache configuration gets passed through
from the base model when using the Zed provider.

Release Notes:

- Fixed caching for Anthropic models when using the Zed provider.

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-08-22 14:37:53 -04:00
Zed Bot
70d825868a Bump to 0.150.1 for @SomeoneToIgnore 2024-08-22 09:11:51 -07:00
Kirill Bulatov
c3de6d858a Force Vue and Svelte language servers to be the first in the list for their languages (#16654)
Follow-up of https://github.com/zed-industries/zed/pull/15624

Fixes https://github.com/zed-industries/zed/issues/13769
Fixes https://github.com/zed-industries/zed/issues/16469

This way, those are considered "primary" and serve all LSP requests like
go to definition. Before, Tailwind language server was first and
returned nothing for all LSP requests.

- Fixed Vue and Svelte languages integrations not handling LSP requests
properly ([#13769](https://github.com/zed-industries/zed/issues/13769))
([#16469](https://github.com/zed-industries/zed/issues/16469))
2024-08-22 15:41:00 +03:00
gcp-cherry-pick-bot[bot]
94b0cdfca4 Fix a panic when diagnostics contain multiple links (cherry-pick #16601) (#16604)
Cherry-picked Fix a panic when diagnostics contain multiple links
(#16601)

Follow up from #14518

Release Notes:

- Fixed a panic when diagnostics contain multiple links

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-08-21 11:33:46 -06:00
Stanislav Alekseev
46825f2068 elixir: Make two more files required by lexical executable (#16382)
I still haven't fixed building dev extensions with rust managed by nix,
so I'd appreciate testing this for me

Release Notes:

- N/A
2024-08-19 19:01:28 -04:00
Bennet Bo Fenner
8b7f4316c7 assistant: Set default provider to zed.dev (#16454)
Do NOT merge until tomorrow

Release Notes:

- N/A

---------

Co-authored-by: Thorsten <thorsten@zed.dev>
2024-08-19 19:01:15 -04:00
Joseph T Lyons
ebc521cb07 v0.150.x preview 2024-08-19 18:40:07 -04:00
10 changed files with 86 additions and 10 deletions

2
Cargo.lock generated
View File

@@ -13839,7 +13839,7 @@ dependencies = [
[[package]]
name = "zed"
version = "0.150.0"
version = "0.150.2"
dependencies = [
"activity_indicator",
"anyhow",

View File

@@ -395,9 +395,9 @@
// The default model to use when creating new contexts.
"default_model": {
// The provider to use.
"provider": "openai",
"provider": "zed.dev",
// The model to use.
"model": "gpt-4o"
"model": "claude-3-5-sonnet"
}
},
// The settings for slash commands.
@@ -836,6 +836,7 @@
"language_servers": ["starpls", "!buck2-lsp", "..."]
},
"Svelte": {
"language_servers": ["svelte-language-server", "..."],
"prettier": {
"allowed": true,
"plugins": ["prettier-plugin-svelte"]
@@ -859,6 +860,7 @@
}
},
"Vue.js": {
"language_servers": ["vue-language-server", "..."],
"prettier": {
"allowed": true
}

View File

@@ -543,8 +543,8 @@ mod tests {
assert_eq!(
AssistantSettings::get_global(cx).default_model,
LanguageModelSelection {
provider: "openai".into(),
model: "gpt-4o".into(),
provider: "zed.dev".into(),
model: "claude-3-5-sonnet".into(),
}
);
});

View File

@@ -9090,6 +9090,43 @@ async fn go_to_prev_overlapping_diagnostic(
"});
}
#[gpui::test]
async fn test_diagnostics_with_links(cx: &mut TestAppContext) {
init_test(cx, |_| {});
let mut cx = EditorTestContext::new(cx).await;
cx.set_state(indoc! {"
fn func(abˇc def: i32) -> u32 {
}
"});
let project = cx.update_editor(|editor, _| editor.project.clone().unwrap());
cx.update(|cx| {
project.update(cx, |project, cx| {
project.update_diagnostics(
LanguageServerId(0),
lsp::PublishDiagnosticsParams {
uri: lsp::Url::from_file_path("/root/file").unwrap(),
version: None,
diagnostics: vec![lsp::Diagnostic {
range: lsp::Range::new(lsp::Position::new(0, 8), lsp::Position::new(0, 12)),
severity: Some(lsp::DiagnosticSeverity::ERROR),
message: "we've had problems with <https://link.one>, and <https://link.two> is broken".to_string(),
..Default::default()
}],
},
&[],
cx,
)
})
}).unwrap();
cx.run_until_parked();
cx.update_editor(|editor, cx| hover_popover::hover(editor, &Default::default(), cx));
cx.run_until_parked();
cx.update_editor(|editor, _| assert!(editor.hover_state.diagnostic_popover.is_some()))
}
#[gpui::test]
async fn go_to_hunk(executor: BackgroundExecutor, cx: &mut gpui::TestAppContext) {
init_test(cx, |_| {});

View File

@@ -159,6 +159,24 @@ pub struct CachedLspAdapter {
cached_binary: futures::lock::Mutex<Option<LanguageServerBinary>>,
}
impl Debug for CachedLspAdapter {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("CachedLspAdapter")
.field("name", &self.name)
.field(
"disk_based_diagnostic_sources",
&self.disk_based_diagnostic_sources,
)
.field(
"disk_based_diagnostics_progress_token",
&self.disk_based_diagnostics_progress_token,
)
.field("language_ids", &self.language_ids)
.field("reinstall_attempt_count", &self.reinstall_attempt_count)
.finish_non_exhaustive()
}
}
impl CachedLspAdapter {
pub fn new(adapter: Arc<dyn LspAdapter>) -> Arc<Self> {
let name = adapter.name();

View File

@@ -444,6 +444,21 @@ impl LanguageModel for CloudLanguageModel {
self.model.max_token_count()
}
fn cache_configuration(&self) -> Option<LanguageModelCacheConfiguration> {
match &self.model {
CloudModel::Anthropic(model) => {
model
.cache_configuration()
.map(|cache| LanguageModelCacheConfiguration {
max_cache_anchors: cache.max_cache_anchors,
should_speculate: cache.should_speculate,
min_total_token: cache.min_total_token,
})
}
CloudModel::OpenAi(_) | CloudModel::Google(_) | CloudModel::Zed(_) => None,
}
}
fn count_tokens(
&self,
request: LanguageModelRequest,

View File

@@ -96,8 +96,8 @@ pub fn parse_links_only(text: &str) -> Vec<(Range<usize>, MarkdownEvent)> {
start: 0,
end: text.len(),
};
for link in finder.links(&text[text_range.clone()]) {
let link_range = text_range.start + link.start()..text_range.start + link.end();
for link in finder.links(&text) {
let link_range = link.start()..link.end();
if link_range.start > text_range.start {
events.push((text_range.start..link_range.start, MarkdownEvent::Text));
@@ -118,7 +118,9 @@ pub fn parse_links_only(text: &str) -> Vec<(Range<usize>, MarkdownEvent)> {
text_range.start = link_range.end;
}
events.push((text_range, MarkdownEvent::Text));
if text_range.end > text_range.start {
events.push((text_range, MarkdownEvent::Text));
}
events
}

View File

@@ -2,7 +2,7 @@
description = "The fast, collaborative code editor."
edition = "2021"
name = "zed"
version = "0.150.0"
version = "0.150.2"
publish = false
license = "GPL-3.0-or-later"
authors = ["Zed Team <hi@zed.dev>"]

View File

@@ -1 +1 @@
dev
preview

View File

@@ -95,6 +95,8 @@ impl Lexical {
.map_err(|e| format!("failed to download file: {e}"))?;
zed::make_file_executable(&binary_path)?;
zed::make_file_executable(&format!("{version_dir}/lexical/bin/debug_shell.sh"))?;
zed::make_file_executable(&format!("{version_dir}/lexical/priv/port_wrapper.sh"))?;
let entries =
fs::read_dir(".").map_err(|e| format!("failed to list working directory {e}"))?;