Compare commits

...

18 Commits

Author SHA1 Message Date
Zed Bot
5321b10aa4 Bump to 0.149.5 for @SomeoneToIgnore 2024-08-22 11:44:57 -07:00
gcp-cherry-pick-bot[bot]
a97e2f8759 Pass through Anthropic cache configuration when using Zed provider (cherry-pick #16685) (#16689)
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:58 -04:00
Zed Bot
ed808fe9e7 Bump to 0.149.4 for @SomeoneToIgnore 2024-08-22 09:11:38 -07:00
Kirill Bulatov
132143f84e 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:40:47 +03:00
gcp-cherry-pick-bot[bot]
389b04c70c Fix a panic when diagnostics contain multiple links (cherry-pick #16601) (#16603)
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:41 -06:00
Bennet Bo Fenner
7155d2c45f 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:00:55 -04:00
Joseph T Lyons
9fe662457c v0.149.x stable 2024-08-19 18:40:07 -04:00
Joseph T Lyons
8a08297c9d zed 0.149.3 2024-08-19 17:51:46 -04:00
Joseph T Lyons
147584d63c Merge branch 'main' into v0.149.x 2024-08-19 17:50:02 -04:00
Peter Tripp
f06b85994a zed 0.149.2 2024-08-19 11:51:48 -04:00
Peter Tripp
ec6909ca93 Merge tag 'nightly' into v0.149.x 2024-08-19 11:50:43 -04:00
Peter Tripp
54d92a9e2d zed 0.149.1 2024-08-16 14:01:47 -04:00
Peter Tripp
a89f768e12 Manually rewind preview version to previous preview. 2024-08-16 13:56:45 -04:00
Peter Tripp
7a68f142d4 Merge tag 'nightly' into v0.149.1_cherry 2024-08-16 13:53:22 -04:00
Kirill Bulatov
3f3ae477c5 Disable forceful sorting of the slash command argument completions (#16240)
Also bubble up the current active tab's path in the \tab argument
completions.

Release Notes:

- N/A
2024-08-14 12:45:35 -07:00
Mikayla Maki
660fe8aa94 Fix a bug where directories were not matching in the fuzzy matcher, when query contains the worktree root name (#16242)
Release Notes:

- Fixed a bug where directories were often omitted from the completions for the /file slash command

Co-authored-by: Max <max@zed.dev>
2024-08-14 12:45:02 -07:00
Bennet Bo Fenner
69fb9b9bfa assistant: Adjust terms of service notice (#16235)
Co-Authored-by: Max <max@zed.dev>
Co-Authored-by: Marshall <marshall@zed.dev>
Co-Authored-by: Peter <peter@zed.dev>

<img width="396" alt="image"
src="https://github.com/user-attachments/assets/62282506-c74a-455e-ae4d-0438d47fed96">

Release Notes:

- N/A

Co-authored-by: Max <max@zed.dev>
Co-authored-by: Marshall <marshall@zed.dev>
Co-authored-by: Peter <peter@zed.dev>
2024-08-14 13:21:55 -04:00
Joseph T Lyons
7f82db5740 v0.149.x preview 2024-08-14 12:45:44 -04:00
9 changed files with 84 additions and 10 deletions

2
Cargo.lock generated
View File

@@ -13839,7 +13839,7 @@ dependencies = [
[[package]]
name = "zed"
version = "0.150.0"
version = "0.149.5"
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.149.5"
publish = false
license = "GPL-3.0-or-later"
authors = ["Zed Team <hi@zed.dev>"]

View File

@@ -1 +1 @@
dev
stable