Compare commits

...

23 Commits

Author SHA1 Message Date
Zed Bot
a5e5ccc61f Bump to 0.175.6 for @osiewicz 2025-02-27 17:13:42 +00:00
gcp-cherry-pick-bot[bot]
3c823d2371 lsp: Use available workspace folders in initialize params (cherry-pick #25753) (#25756)
Cherry-picked lsp: Use available workspace folders in initialize params
(#25753)

Closes https://github.com/zed-industries/zed/issues/25743
Closes https://github.com/biomejs/biome-zed/issues/73

Release Notes:

- Fixed issues with launching Svelte/Biome language servers

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
2025-02-27 17:23:19 +01:00
Joseph T. Lyons
6641f89eaf v0.175.x stable 2025-02-26 12:52:09 -05:00
gcp-cherry-pick-bot[bot]
87620a0b73 go: Do not fill out root_uri in initialization params to prevent stale notifications (cherry-pick #25644) (#25655)
Cherry-picked go: Do not fill out root_uri in initialization params to
prevent stale notifications (#25644)

Closes #25381

Release Notes:

- N/A

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
2025-02-26 16:41:39 +01:00
Max Brunsfeld
642795631d Fix crash in BlockMap::sync when there are inlay hints w/ newlines ri… (#25598)
Closes https://github.com/zed-industries/zed/issues/25377

Release Notes:

- Fixed a crash that could happen when typing in the assistant panel
with edit predictions enabled.

---------

Co-authored-by: Cole Miller <m@cole-miller.net>
2025-02-25 14:53:35 -08:00
Peter Tripp
8cf7206adf zed 0.175.5 2025-02-25 13:17:26 -05:00
zhaopeng
a7093b2651 copilot: Add Claude 3.7 Sonnet to Copilot Chat (#25529)
- Follow-up to: https://github.com/zed-industries/zed/issues/25488

Co-authored-by: Peter Tripp <peter@zed.dev>
2025-02-25 13:04:51 -05:00
Peter Tripp
869e25e103 Update Assistant context limits (#25087)
- Update GitHub Copilot Chat context limits
- Add decimal separators for consistency
2025-02-25 13:04:47 -05:00
Marshall Bowers
40cad0dd69 Give Zed AI users access to Claude 3.7 Sonnet (#25577)
This PR updates the client-side checks to give Zed AI users access to
Claude 3.7 Sonnet.

Requires https://github.com/zed-industries/zed/pull/25576 to be
deployed.

Release Notes:

- Added support for Claude 3.7 Sonnet to Zed AI.
2025-02-25 12:46:58 -05:00
gcp-cherry-pick-bot[bot]
7210f3259b lsp: Fix buffer snapshots sometimes going missing (cherry-pick #25548) (#25553)
Cherry-picked lsp: Fix buffer snapshots sometimes going missing (#25548)

A call to register_buffer_with_language_servers could nuke existing
snapshots, even when the buffer was already registered with a server.

Essentially, had we had the else branch in place, this would have been
detected.

Closes #ISSUE

Release Notes:

- Fixed Rust analyzer renames sometimes failing. (Preview only)

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
2025-02-25 11:46:19 +01:00
gcp-cherry-pick-bot[bot]
ee3980f427 Bring back our CI (cherry-pick #25545) (#25550)
Cherry-picked Bring back our CI (#25545)

Closes #ISSUE

Fix `The package requires the Cargo feature called edition2024, but that
feature is not stabilized in this version of Cargo (1.81.0`

Release Notes:

- N/A

Co-authored-by: 张小白 <364772080@qq.com>
2025-02-25 11:16:21 +01:00
Zed Bot
6ec8966c28 Bump to 0.175.4 for @maxbrunsfeld 2025-02-25 04:30:32 +00:00
Peter Tripp
e9d070b438 Add Anthropic Claude 3.7 support (#25497) 2025-02-24 20:28:17 -08:00
Conrad Irwin
77794fb3e8 Notarize with a team key (#25479)
Should make it less likely that notorization fails when nathan changes
his passwords.

(though probably no less likly to fail beacuse apple forces us to resign
new agreements on the regular)

Release Notes:

- N/A

---------

Co-authored-by: Peter Tripp <peter@zed.dev>
2025-02-24 20:28:11 -08:00
gcp-cherry-pick-bot[bot]
3bcb65f8fb lsp: Check for existing snapshots before sending off a didOpen notification (cherry-pick #25409) (#25411)
Cherry-picked lsp: Check for existing snapshots before sending off a
didOpen notification (#25409)

Closes #ISSUE

Release Notes:

- Fixed Zed sending out didOpen notification to a language server when
opening documents.

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
2025-02-23 13:58:12 +01:00
Zed Bot
aa767aa379 Bump to 0.175.3 for @osiewicz 2025-02-21 17:19:14 +00:00
gcp-cherry-pick-bot[bot]
1863f0b16d lsp: Send non-null workspaceFolders in initialize (cherry-pick #25337) (#25344)
Cherry-picked lsp: Send non-null workspaceFolders in initialize (#25337)

This is a ~workaround for next-ls not handling null workspace folders in
initialize request
Related to #25264
/cc @timfjord
Closes #ISSUE

Release Notes:

- Changed how workspace folders are shared with language servers, fixing
a startup issue with `next-ls` in the process.

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
2025-02-21 17:25:03 +01:00
Zed Bot
5e8474ec7a Bump to 0.175.2 for @osiewicz 2025-02-20 22:38:09 +00:00
gcp-cherry-pick-bot[bot]
52b9d0e874 lsp: Fill root_uri property on Initialize again (cherry-pick #25264) (#25290)
Cherry-picked lsp: Fill root_uri property on Initialize again (#25264)

Closes #ISSUE

Release Notes:

- Fix some language servers (elixir-ls, tailwindcss, phpactor) failing
to start up due to an unfilled root_uri property in the InitializeParams

Co-authored-by: Anthony Eid <hello@anthonyeid.me>

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
Co-authored-by: Anthony Eid <hello@anthonyeid.me>
2025-02-20 23:35:49 +01:00
Cole Miller
314ca3c8d4 zed 0.175.1 2025-02-19 12:35:41 -05:00
gcp-cherry-pick-bot[bot]
6538a9ec98 Revert "Rework hunk controls (#24814)" (cherry-pick #25174) (#25176)
Cherry-picked Revert "Rework hunk controls (#24814)" (#25174)

This reverts commit a6a8d79d86.

Closes #ISSUE

Release Notes:

- Revert incomplete change to diff hunk controls

Co-authored-by: Cole Miller <cole@zed.dev>
2025-02-19 12:32:26 -05:00
Cole Miller
9b3a6b361c Cherry-pick file finder panic fix to v0.175.x (#25166)
Release Notes:

- Fixed a panic in the file finder
2025-02-19 10:55:40 -05:00
Joseph T. Lyons
cc6b664ff4 v0.175.x preview 2025-02-19 08:01:17 -05:00
64 changed files with 427 additions and 334 deletions

View File

@@ -109,8 +109,16 @@ jobs:
- name: cargo clippy
run: ./script/clippy
- name: Install cargo-machete
uses: clechasseur/rs-cargo@v2
with:
command: install
args: cargo-machete@0.7.0
- name: Check unused dependencies
uses: bnjbvr/cargo-machete@main
uses: clechasseur/rs-cargo@v2
with:
command: machete
- name: Check licenses
run: |
@@ -298,8 +306,9 @@ jobs:
env:
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
APPLE_NOTARIZATION_USERNAME: ${{ secrets.APPLE_NOTARIZATION_USERNAME }}
APPLE_NOTARIZATION_PASSWORD: ${{ secrets.APPLE_NOTARIZATION_PASSWORD }}
APPLE_NOTARIZATION_KEY: ${{ secrets.APPLE_NOTARIZATION_KEY }}
APPLE_NOTARIZATION_KEY_ID: ${{ secrets.APPLE_NOTARIZATION_KEY_ID }}
APPLE_NOTARIZATION_ISSUER_ID: ${{ secrets.APPLE_NOTARIZATION_ISSUER_ID }}
ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
ZED_CLOUD_PROVIDER_ADDITIONAL_MODELS_JSON: ${{ secrets.ZED_CLOUD_PROVIDER_ADDITIONAL_MODELS_JSON }}
DIGITALOCEAN_SPACES_ACCESS_KEY: ${{ secrets.DIGITALOCEAN_SPACES_ACCESS_KEY }}

View File

@@ -62,8 +62,9 @@ jobs:
env:
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
APPLE_NOTARIZATION_USERNAME: ${{ secrets.APPLE_NOTARIZATION_USERNAME }}
APPLE_NOTARIZATION_PASSWORD: ${{ secrets.APPLE_NOTARIZATION_PASSWORD }}
APPLE_NOTARIZATION_KEY: ${{ secrets.APPLE_NOTARIZATION_KEY }}
APPLE_NOTARIZATION_KEY_ID: ${{ secrets.APPLE_NOTARIZATION_KEY_ID }}
APPLE_NOTARIZATION_ISSUER_ID: ${{ secrets.APPLE_NOTARIZATION_ISSUER_ID }}
DIGITALOCEAN_SPACES_ACCESS_KEY: ${{ secrets.DIGITALOCEAN_SPACES_ACCESS_KEY }}
DIGITALOCEAN_SPACES_SECRET_KEY: ${{ secrets.DIGITALOCEAN_SPACES_SECRET_KEY }}
ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}

2
Cargo.lock generated
View File

@@ -16664,7 +16664,7 @@ dependencies = [
[[package]]
name = "zed"
version = "0.175.0"
version = "0.175.6"
dependencies = [
"activity_indicator",
"anyhow",

View File

@@ -701,7 +701,6 @@ codegen-units = 16
[workspace.lints.clippy]
dbg_macro = "deny"
todo = "deny"
too_many_arguments = "allow"
# Motivation: We use `vec![a..b]` a lot when dealing with ranges in text, so
# warning on this rule produces a lot of noise.

View File

@@ -30,6 +30,8 @@ pub enum Model {
#[default]
#[serde(rename = "claude-3-5-sonnet", alias = "claude-3-5-sonnet-latest")]
Claude3_5Sonnet,
#[serde(rename = "claude-3-7-sonnet", alias = "claude-3-7-sonnet-latest")]
Claude3_7Sonnet,
#[serde(rename = "claude-3-5-haiku", alias = "claude-3-5-haiku-latest")]
Claude3_5Haiku,
#[serde(rename = "claude-3-opus", alias = "claude-3-opus-latest")]
@@ -59,6 +61,8 @@ impl Model {
pub fn from_id(id: &str) -> Result<Self> {
if id.starts_with("claude-3-5-sonnet") {
Ok(Self::Claude3_5Sonnet)
} else if id.starts_with("claude-3-7-sonnet") {
Ok(Self::Claude3_7Sonnet)
} else if id.starts_with("claude-3-5-haiku") {
Ok(Self::Claude3_5Haiku)
} else if id.starts_with("claude-3-opus") {
@@ -75,6 +79,7 @@ impl Model {
pub fn id(&self) -> &str {
match self {
Model::Claude3_5Sonnet => "claude-3-5-sonnet-latest",
Model::Claude3_7Sonnet => "claude-3-7-sonnet-latest",
Model::Claude3_5Haiku => "claude-3-5-haiku-latest",
Model::Claude3Opus => "claude-3-opus-latest",
Model::Claude3Sonnet => "claude-3-sonnet-20240229",
@@ -85,6 +90,7 @@ impl Model {
pub fn display_name(&self) -> &str {
match self {
Self::Claude3_7Sonnet => "Claude 3.7 Sonnet",
Self::Claude3_5Sonnet => "Claude 3.5 Sonnet",
Self::Claude3_5Haiku => "Claude 3.5 Haiku",
Self::Claude3Opus => "Claude 3 Opus",
@@ -98,13 +104,14 @@ impl Model {
pub fn cache_configuration(&self) -> Option<AnthropicModelCacheConfiguration> {
match self {
Self::Claude3_5Sonnet | Self::Claude3_5Haiku | Self::Claude3Haiku => {
Some(AnthropicModelCacheConfiguration {
min_total_token: 2_048,
should_speculate: true,
max_cache_anchors: 4,
})
}
Self::Claude3_5Sonnet
| Self::Claude3_5Haiku
| Self::Claude3_7Sonnet
| Self::Claude3Haiku => Some(AnthropicModelCacheConfiguration {
min_total_token: 2_048,
should_speculate: true,
max_cache_anchors: 4,
}),
Self::Custom {
cache_configuration,
..
@@ -117,6 +124,7 @@ impl Model {
match self {
Self::Claude3_5Sonnet
| Self::Claude3_5Haiku
| Self::Claude3_7Sonnet
| Self::Claude3Opus
| Self::Claude3Sonnet
| Self::Claude3Haiku => 200_000,
@@ -127,7 +135,7 @@ impl Model {
pub fn max_output_tokens(&self) -> u32 {
match self {
Self::Claude3Opus | Self::Claude3Sonnet | Self::Claude3Haiku => 4_096,
Self::Claude3_5Sonnet | Self::Claude3_5Haiku => 8_192,
Self::Claude3_5Sonnet | Self::Claude3_7Sonnet | Self::Claude3_5Haiku => 8_192,
Self::Custom {
max_output_tokens, ..
} => max_output_tokens.unwrap_or(4_096),
@@ -137,6 +145,7 @@ impl Model {
pub fn default_temperature(&self) -> f32 {
match self {
Self::Claude3_5Sonnet
| Self::Claude3_7Sonnet
| Self::Claude3_5Haiku
| Self::Claude3Opus
| Self::Claude3Sonnet

View File

@@ -387,6 +387,7 @@ impl InlineAssistant {
}
}
#[allow(clippy::too_many_arguments)]
pub fn suggest_assist(
&mut self,
editor: &Entity<Editor>,
@@ -1674,6 +1675,7 @@ impl Focusable for PromptEditor {
impl PromptEditor {
const MAX_LINES: u8 = 8;
#[allow(clippy::too_many_arguments)]
fn new(
id: InlineAssistId,
gutter_dimensions: Arc<Mutex<GutterDimensions>>,
@@ -2332,6 +2334,7 @@ struct InlineAssist {
}
impl InlineAssist {
#[allow(clippy::too_many_arguments)]
fn new(
assist_id: InlineAssistId,
group_id: InlineAssistGroupId,

View File

@@ -702,6 +702,7 @@ impl Focusable for PromptEditor {
impl PromptEditor {
const MAX_LINES: u8 = 8;
#[allow(clippy::too_many_arguments)]
fn new(
id: TerminalInlineAssistId,
prompt_history: VecDeque<String>,

View File

@@ -36,6 +36,7 @@ pub struct ContextStrip {
}
impl ContextStrip {
#[allow(clippy::too_many_arguments)]
pub fn new(
context_store: Entity<ContextStore>,
workspace: WeakEntity<Workspace>,

View File

@@ -480,6 +480,7 @@ impl InlineAssistant {
}
}
#[allow(clippy::too_many_arguments)]
pub fn suggest_assist(
&mut self,
editor: &Entity<Editor>,
@@ -1450,6 +1451,7 @@ struct InlineAssistScrollLock {
}
impl EditorInlineAssists {
#[allow(clippy::too_many_arguments)]
fn new(editor: &Entity<Editor>, window: &mut Window, cx: &mut App) -> Self {
let (highlight_updates_tx, mut highlight_updates_rx) = async_watch::channel(());
Self {
@@ -1561,6 +1563,7 @@ pub struct InlineAssist {
}
impl InlineAssist {
#[allow(clippy::too_many_arguments)]
fn new(
assist_id: InlineAssistId,
group_id: InlineAssistGroupId,

View File

@@ -823,6 +823,7 @@ impl InlineAssistId {
}
impl PromptEditor<BufferCodegen> {
#[allow(clippy::too_many_arguments)]
pub fn new_buffer(
id: InlineAssistId,
gutter_dimensions: Arc<Mutex<GutterDimensions>>,
@@ -983,6 +984,7 @@ impl TerminalInlineAssistId {
}
impl PromptEditor<TerminalCodegen> {
#[allow(clippy::too_many_arguments)]
pub fn new_terminal(
id: TerminalInlineAssistId,
prompt_history: VecDeque<String>,

View File

@@ -650,6 +650,7 @@ impl AssistantContext {
)
}
#[allow(clippy::too_many_arguments)]
pub fn new(
id: ContextId,
replica_id: ReplicaId,
@@ -770,6 +771,7 @@ impl AssistantContext {
}
}
#[allow(clippy::too_many_arguments)]
pub fn deserialize(
saved_context: SavedContext,
path: PathBuf,

View File

@@ -517,6 +517,7 @@ impl ContextEditor {
}
}
#[allow(clippy::too_many_arguments)]
pub fn run_command(
&mut self,
command_range: Range<language::Anchor>,
@@ -2057,6 +2058,7 @@ impl ContextEditor {
.unwrap_or_else(|| Cow::Borrowed(DEFAULT_TAB_TITLE))
}
#[allow(clippy::too_many_arguments)]
fn render_patch_block(
&mut self,
range: Range<text::Anchor>,

View File

@@ -136,6 +136,7 @@ impl SlashCommandCompletionProvider {
})
}
#[allow(clippy::too_many_arguments)]
fn complete_command_argument(
&self,
command_name: &str,

View File

@@ -88,7 +88,7 @@ pub trait SlashCommand: 'static + Send + Sync {
fn accepts_arguments(&self) -> bool {
self.requires_argument()
}
#[allow(clippy::too_many_arguments)]
fn run(
self: Arc<Self>,
arguments: &[String],

View File

@@ -719,6 +719,7 @@ impl BufferDiff {
Some(start..end)
}
#[allow(clippy::too_many_arguments)]
pub async fn update_diff(
this: Entity<BufferDiff>,
buffer: text::BufferSnapshot,

View File

@@ -229,6 +229,7 @@ impl Database {
}
/// Creates a new channel message.
#[allow(clippy::too_many_arguments)]
pub async fn create_channel_message(
&self,
channel_id: ChannelId,

View File

@@ -122,6 +122,7 @@ impl Database {
.await
}
#[allow(clippy::too_many_arguments)]
pub async fn get_or_create_user_by_github_account_tx(
&self,
github_login: &str,

View File

@@ -256,6 +256,7 @@ async fn perform_completion(
// so that users can use the new version, without having to update Zed.
request.model = match model.as_str() {
"claude-3-5-sonnet" => anthropic::Model::Claude3_5Sonnet.id().to_string(),
"claude-3-7-sonnet" => anthropic::Model::Claude3_7Sonnet.id().to_string(),
"claude-3-opus" => anthropic::Model::Claude3Opus.id().to_string(),
"claude-3-haiku" => anthropic::Model::Claude3Haiku.id().to_string(),
"claude-3-sonnet" => anthropic::Model::Claude3Sonnet.id().to_string(),

View File

@@ -289,6 +289,7 @@ impl LlmDatabase {
.await
}
#[allow(clippy::too_many_arguments)]
pub async fn record_usage(
&self,
user_id: UserId,
@@ -553,6 +554,7 @@ impl LlmDatabase {
.await
}
#[allow(clippy::too_many_arguments)]
async fn update_usage_for_measure(
&self,
user_id: UserId,

View File

@@ -33,6 +33,7 @@ pub struct LlmTokenClaims {
const LLM_TOKEN_LIFETIME: Duration = Duration::from_secs(60 * 60);
impl LlmTokenClaims {
#[allow(clippy::too_many_arguments)]
pub fn create(
user: &user::Model,
is_staff: bool,

View File

@@ -691,6 +691,7 @@ impl Server {
})
}
#[allow(clippy::too_many_arguments)]
pub fn handle_connection(
self: &Arc<Self>,
connection: Connection,
@@ -1074,6 +1075,7 @@ pub fn routes(server: Arc<Server>) -> Router<(), Body> {
.layer(Extension(server))
}
#[allow(clippy::too_many_arguments)]
pub async fn handle_websocket_request(
TypedHeader(ProtocolVersion(protocol_version)): TypedHeader<ProtocolVersion>,
app_version_header: Option<TypedHeader<AppVersionHeader>>,

View File

@@ -463,6 +463,7 @@ impl<T: RandomizedTest> TestPlan<T> {
})
}
#[allow(clippy::too_many_arguments)]
async fn apply_server_operation(
plan: Arc<Mutex<Self>>,
deterministic: BackgroundExecutor,

View File

@@ -869,6 +869,7 @@ impl CollabPanel {
})
}
#[allow(clippy::too_many_arguments)]
fn render_participant_project(
&self,
project_id: u64,

View File

@@ -450,6 +450,7 @@ impl Copilot {
binary,
root_path,
None,
Default::default(),
cx.clone(),
)?;

View File

@@ -40,6 +40,8 @@ pub enum Model {
O3Mini,
#[serde(alias = "claude-3-5-sonnet", rename = "claude-3.5-sonnet")]
Claude3_5Sonnet,
#[serde(alias = "claude-3-7-sonnet", rename = "claude-3.7-sonnet")]
Claude3_7Sonnet,
#[serde(alias = "gemini-2.0-flash", rename = "gemini-2.0-flash-001")]
Gemini20Flash,
}
@@ -47,7 +49,11 @@ pub enum Model {
impl Model {
pub fn uses_streaming(&self) -> bool {
match self {
Self::Gpt4o | Self::Gpt4 | Self::Gpt3_5Turbo | Self::Claude3_5Sonnet => true,
Self::Gpt4o
| Self::Gpt4
| Self::Gpt3_5Turbo
| Self::Claude3_5Sonnet
| Self::Claude3_7Sonnet => true,
Self::O3Mini | Self::O1 | Self::Gemini20Flash => false,
}
}
@@ -60,6 +66,7 @@ impl Model {
"o1" => Ok(Self::O1),
"o3-mini" => Ok(Self::O3Mini),
"claude-3-5-sonnet" => Ok(Self::Claude3_5Sonnet),
"claude-3-7-sonnet" => Ok(Self::Claude3_7Sonnet),
"gemini-2.0-flash-001" => Ok(Self::Gemini20Flash),
_ => Err(anyhow!("Invalid model id: {}", id)),
}
@@ -73,6 +80,7 @@ impl Model {
Self::O3Mini => "o3-mini",
Self::O1 => "o1",
Self::Claude3_5Sonnet => "claude-3-5-sonnet",
Self::Claude3_7Sonnet => "claude-3-7-sonnet",
Self::Gemini20Flash => "gemini-2.0-flash-001",
}
}
@@ -85,18 +93,20 @@ impl Model {
Self::O3Mini => "o3-mini",
Self::O1 => "o1",
Self::Claude3_5Sonnet => "Claude 3.5 Sonnet",
Self::Claude3_7Sonnet => "Claude 3.7 Sonnet",
Self::Gemini20Flash => "Gemini 2.0 Flash",
}
}
pub fn max_token_count(&self) -> usize {
match self {
Self::Gpt4o => 64000,
Self::Gpt4 => 32768,
Self::Gpt3_5Turbo => 12288,
Self::O3Mini => 20000,
Self::O1 => 20000,
Self::Gpt4o => 64_000,
Self::Gpt4 => 32_768,
Self::Gpt3_5Turbo => 12_288,
Self::O3Mini => 64_000,
Self::O1 => 20_000,
Self::Claude3_5Sonnet => 200_000,
Self::Claude3_7Sonnet => 90_000,
Model::Gemini20Flash => 128_000,
}
}

View File

@@ -113,6 +113,7 @@ pub struct DisplayMap {
}
impl DisplayMap {
#[allow(clippy::too_many_arguments)]
pub fn new(
buffer: Entity<MultiBuffer>,
font: Font,
@@ -1910,6 +1911,67 @@ pub mod tests {
);
}
#[gpui::test]
fn test_inlays_with_newlines_after_blocks(cx: &mut gpui::TestAppContext) {
cx.update(|cx| init_test(cx, |_| {}));
let buffer = cx.new(|cx| Buffer::local("a", cx));
let buffer = cx.new(|cx| MultiBuffer::singleton(buffer, cx));
let buffer_snapshot = buffer.read_with(cx, |buffer, cx| buffer.snapshot(cx));
let font_size = px(14.0);
let map = cx.new(|cx| {
DisplayMap::new(
buffer.clone(),
font("Helvetica"),
font_size,
None,
true,
1,
1,
1,
FoldPlaceholder::test(),
cx,
)
});
map.update(cx, |map, cx| {
map.insert_blocks(
[BlockProperties {
placement: BlockPlacement::Above(
buffer_snapshot.anchor_before(Point::new(0, 0)),
),
height: 2,
style: BlockStyle::Sticky,
render: Arc::new(|_| div().into_any()),
priority: 0,
}],
cx,
);
});
map.update(cx, |m, cx| assert_eq!(m.snapshot(cx).text(), "\n\na"));
map.update(cx, |map, cx| {
map.splice_inlays(
&[],
vec![Inlay {
id: InlayId::InlineCompletion(0),
position: buffer_snapshot.anchor_after(0),
text: "\n".into(),
}],
cx,
);
});
map.update(cx, |m, cx| assert_eq!(m.snapshot(cx).text(), "\n\n\na"));
// Regression test: updating the display map does not crash when a
// block is immediately followed by a multi-line inlay.
buffer.update(cx, |buffer, cx| {
buffer.edit([(1..1, "b")], None, cx);
});
map.update(cx, |m, cx| assert_eq!(m.snapshot(cx).text(), "\n\n\nab"));
}
#[gpui::test]
async fn test_chunks(cx: &mut gpui::TestAppContext) {
let text = r#"

View File

@@ -638,10 +638,13 @@ impl BlockMap {
self.custom_blocks[start_block_ix..end_block_ix]
.iter()
.filter_map(|block| {
Some((
block.placement.to_wrap_row(wrap_snapshot)?,
Block::Custom(block.clone()),
))
let placement = block.placement.to_wrap_row(wrap_snapshot)?;
if let BlockPlacement::Above(row) = placement {
if row < new_start {
return None;
}
}
Some((placement, Block::Custom(block.clone())))
}),
);
@@ -723,6 +726,7 @@ impl BlockMap {
self.show_excerpt_controls
}
#[allow(clippy::too_many_arguments)]
fn header_and_footer_blocks<'a, R, T>(
show_excerpt_controls: bool,
excerpt_footer_height: u32,

View File

@@ -5934,6 +5934,7 @@ impl Editor {
editor_bg_color.blend(accent_color.opacity(0.1))
}
#[allow(clippy::too_many_arguments)]
fn render_edit_prediction_cursor_popover(
&self,
min_width: Pixels,
@@ -7112,10 +7113,10 @@ impl Editor {
cx: &mut Context<Self>,
) {
let selections = self.selections.all(cx).into_iter().map(|s| s.range());
self.discard_hunks_in_ranges(selections, window, cx);
self.revert_hunks_in_ranges(selections, window, cx);
}
fn discard_hunks_in_ranges(
fn revert_hunks_in_ranges(
&mut self,
ranges: impl Iterator<Item = Range<Point>>,
window: &mut Window,

View File

@@ -18,10 +18,10 @@ use crate::{
BlockId, ChunkReplacement, CursorShape, CustomBlockId, DisplayPoint, DisplayRow,
DocumentHighlightRead, DocumentHighlightWrite, EditDisplayMode, Editor, EditorMode,
EditorSettings, EditorSnapshot, EditorStyle, ExpandExcerpts, FocusedBlock, GoToHunk,
GutterDimensions, HalfPageDown, HalfPageUp, HandleInput, HoveredCursor, InlineCompletion,
JumpData, LineDown, LineUp, OpenExcerpts, PageDown, PageUp, Point, RevertSelectedHunks, RowExt,
RowRangeExt, SelectPhase, SelectedTextHighlight, Selection, SoftWrap, StickyHeaderExcerpt,
ToPoint, ToggleFold, ToggleStagedSelectedDiffHunks, COLUMNAR_SELECTION_MODIFIERS,
GoToPrevHunk, GutterDimensions, HalfPageDown, HalfPageUp, HandleInput, HoveredCursor,
InlineCompletion, JumpData, LineDown, LineUp, OpenExcerpts, PageDown, PageUp, Point,
RevertSelectedHunks, RowExt, RowRangeExt, SelectPhase, SelectedTextHighlight, Selection,
SoftWrap, StickyHeaderExcerpt, ToPoint, ToggleFold, COLUMNAR_SELECTION_MODIFIERS,
CURSORS_VISIBLE_FOR, FILE_HEADER_HEIGHT, GIT_BLAME_MAX_AUTHOR_CHARS_DISPLAYED, MAX_LINE_LEN,
MULTI_BUFFER_EXCERPT_HEADER_HEIGHT,
};
@@ -34,8 +34,8 @@ use gpui::{
anchored, deferred, div, fill, linear_color_stop, linear_gradient, outline, pattern_slash,
point, px, quad, relative, size, svg, transparent_black, Action, AnyElement, App,
AvailableSpace, Axis, Bounds, ClickEvent, ClipboardItem, ContentMask, Context, Corner, Corners,
CursorStyle, DispatchPhase, Edges, Element, ElementInputHandler, Entity, Focusable, FontId,
GlobalElementId, Hitbox, Hsla, InteractiveElement, IntoElement, Keystroke, Length,
CursorStyle, DispatchPhase, Edges, Element, ElementInputHandler, Entity, Focusable as _,
FontId, GlobalElementId, Hitbox, Hsla, InteractiveElement, IntoElement, Keystroke, Length,
ModifiersChangedEvent, MouseButton, MouseDownEvent, MouseMoveEvent, MouseUpEvent, PaintQuad,
ParentElement, Pixels, ScrollDelta, ScrollWheelEvent, ShapedLine, SharedString, Size,
StatefulInteractiveElement, Style, Styled, Subscription, TextRun, TextStyleRefinement,
@@ -931,6 +931,7 @@ impl EditorElement {
cx.notify()
}
#[allow(clippy::too_many_arguments)]
fn layout_selections(
&self,
start_anchor: Anchor,
@@ -1102,6 +1103,7 @@ impl EditorElement {
cursors
}
#[allow(clippy::too_many_arguments)]
fn layout_visible_cursors(
&self,
snapshot: &EditorSnapshot,
@@ -1451,6 +1453,7 @@ impl EditorElement {
axis_pair(horizontal_scrollbar, vertical_scrollbar)
}
#[allow(clippy::too_many_arguments)]
fn prepaint_crease_toggles(
&self,
crease_toggles: &mut [Option<AnyElement>],
@@ -1485,6 +1488,7 @@ impl EditorElement {
}
}
#[allow(clippy::too_many_arguments)]
fn prepaint_crease_trailers(
&self,
trailers: Vec<Option<AnyElement>>,
@@ -1600,6 +1604,7 @@ impl EditorElement {
display_hunks
}
#[allow(clippy::too_many_arguments)]
fn layout_inline_blame(
&self,
display_row: DisplayRow,
@@ -1686,6 +1691,7 @@ impl EditorElement {
Some(element)
}
#[allow(clippy::too_many_arguments)]
fn layout_blame_entries(
&self,
buffer_rows: &[RowInfo],
@@ -1754,6 +1760,7 @@ impl EditorElement {
Some(shaped_lines)
}
#[allow(clippy::too_many_arguments)]
fn layout_indent_guides(
&self,
content_origin: gpui::Point<Pixels>,
@@ -1871,6 +1878,7 @@ impl EditorElement {
(offset_y, length)
}
#[allow(clippy::too_many_arguments)]
fn layout_run_indicators(
&self,
line_height: Pixels,
@@ -1963,6 +1971,7 @@ impl EditorElement {
})
}
#[allow(clippy::too_many_arguments)]
fn layout_code_actions_indicator(
&self,
line_height: Pixels,
@@ -2061,6 +2070,7 @@ impl EditorElement {
relative_rows
}
#[allow(clippy::too_many_arguments)]
fn layout_line_numbers(
&self,
gutter_hitbox: Option<&Hitbox>,
@@ -2273,6 +2283,7 @@ impl EditorElement {
}
}
#[allow(clippy::too_many_arguments)]
fn prepaint_lines(
&self,
start_row: DisplayRow,
@@ -2299,6 +2310,7 @@ impl EditorElement {
line_elements
}
#[allow(clippy::too_many_arguments)]
fn render_block(
&self,
block: &Block,
@@ -2760,6 +2772,7 @@ impl EditorElement {
}))
}
#[allow(clippy::too_many_arguments)]
fn render_blocks(
&self,
rows: Range<DisplayRow>,
@@ -2944,6 +2957,7 @@ impl EditorElement {
/// Returns true if any of the blocks changed size since the previous frame. This will trigger
/// a restart of rendering for the editor based on the new sizes.
#[allow(clippy::too_many_arguments)]
fn layout_blocks(
&self,
blocks: &mut Vec<BlockLayout>,
@@ -2987,6 +3001,7 @@ impl EditorElement {
}
}
#[allow(clippy::too_many_arguments)]
fn layout_sticky_buffer_header(
&self,
StickyHeaderExcerpt {
@@ -3061,6 +3076,7 @@ impl EditorElement {
header
}
#[allow(clippy::too_many_arguments)]
fn layout_cursor_popovers(
&self,
line_height: Pixels,
@@ -3249,6 +3265,7 @@ impl EditorElement {
);
}
#[allow(clippy::too_many_arguments)]
fn layout_gutter_menu(
&self,
line_height: Pixels,
@@ -3301,6 +3318,7 @@ impl EditorElement {
);
}
#[allow(clippy::too_many_arguments)]
fn layout_popovers_above_or_below_line(
&self,
target_position: gpui::Point<Pixels>,
@@ -3405,6 +3423,7 @@ impl EditorElement {
Some((laid_out_popovers, y_flipped))
}
#[allow(clippy::too_many_arguments)]
fn layout_context_menu_aside(
&self,
y_flipped: bool,
@@ -3526,6 +3545,7 @@ impl EditorElement {
}
}
#[allow(clippy::too_many_arguments)]
fn layout_edit_prediction_popover(
&self,
text_bounds: &Bounds<Pixels>,
@@ -3982,6 +4002,7 @@ impl EditorElement {
Some(element)
}
#[allow(clippy::too_many_arguments)]
fn layout_hover_popovers(
&self,
snapshot: &EditorSnapshot,
@@ -4098,6 +4119,7 @@ impl EditorElement {
}
}
#[allow(clippy::too_many_arguments)]
fn layout_diff_hunk_controls(
&self,
row_range: Range<DisplayRow>,
@@ -4152,16 +4174,13 @@ impl EditorElement {
let y = display_row_range.start.as_f32() * line_height
+ text_hitbox.bounds.top()
- scroll_pixel_position.y;
let x = text_hitbox.bounds.right()
- rems(6.).to_pixels(window.rem_size())
- px(33.);
let x = text_hitbox.bounds.right() - px(100.);
let mut element = diff_hunk_controls(
display_row_range.start.0,
multi_buffer_range.clone(),
line_height,
&editor,
window,
cx,
);
element.prepaint_as_root(
@@ -4178,6 +4197,7 @@ impl EditorElement {
controls
}
#[allow(clippy::too_many_arguments)]
fn layout_signature_help(
&self,
hitbox: &Hitbox,
@@ -5416,6 +5436,7 @@ impl EditorElement {
});
}
#[allow(clippy::too_many_arguments)]
fn paint_highlighted_range(
&self,
range: Range<DisplayPoint>,
@@ -5830,6 +5851,7 @@ impl AcceptEditPredictionBinding {
}
}
#[allow(clippy::too_many_arguments)]
fn prepaint_gutter_button(
button: IconButton,
row: DisplayRow,
@@ -6069,6 +6091,7 @@ impl fmt::Debug for LineFragment {
}
impl LineWithInvisibles {
#[allow(clippy::too_many_arguments)]
fn from_chunks<'a>(
chunks: impl Iterator<Item = HighlightedChunk<'a>>,
editor_style: &EditorStyle,
@@ -6273,6 +6296,7 @@ impl LineWithInvisibles {
layouts
}
#[allow(clippy::too_many_arguments)]
fn prepaint(
&mut self,
line_height: Pixels,
@@ -6307,6 +6331,7 @@ impl LineWithInvisibles {
}
}
#[allow(clippy::too_many_arguments)]
fn draw(
&self,
layout: &EditorLayout,
@@ -6350,6 +6375,7 @@ impl LineWithInvisibles {
);
}
#[allow(clippy::too_many_arguments)]
fn draw_invisibles(
&self,
selection_ranges: &[Range<DisplayPoint>],
@@ -7679,6 +7705,7 @@ struct ScrollbarRangeData {
}
impl ScrollbarRangeData {
#[allow(clippy::too_many_arguments)]
pub fn new(
scrollbar_bounds: Bounds<Pixels>,
letter_size: Size<Pixels>,
@@ -8907,13 +8934,8 @@ fn diff_hunk_controls(
hunk_range: Range<Anchor>,
line_height: Pixels,
editor: &Entity<Editor>,
_window: &mut Window,
cx: &mut App,
) -> AnyElement {
let stage = editor.update(cx, |editor, cx| {
let snapshot = editor.buffer.read(cx).snapshot(cx);
editor.has_stageable_diff_hunks_in_ranges(&[hunk_range.start..hunk_range.start], &snapshot)
});
h_flex()
.h(line_height)
.mr_1()
@@ -8926,7 +8948,59 @@ fn diff_hunk_controls(
.bg(cx.theme().colors().editor_background)
.gap_1()
.child(
IconButton::new(("discard-hunk", row as u64), IconName::Undo)
IconButton::new(("next-hunk", row as u64), IconName::ArrowDown)
.shape(IconButtonShape::Square)
.icon_size(IconSize::Small)
// .disabled(!has_multiple_hunks)
.tooltip({
let focus_handle = editor.focus_handle(cx);
move |window, cx| {
Tooltip::for_action_in("Next Hunk", &GoToHunk, &focus_handle, window, cx)
}
})
.on_click({
let editor = editor.clone();
move |_event, window, cx| {
editor.update(cx, |editor, cx| {
let snapshot = editor.snapshot(window, cx);
let position = hunk_range.end.to_point(&snapshot.buffer_snapshot);
editor.go_to_hunk_after_position(&snapshot, position, window, cx);
editor.expand_selected_diff_hunks(cx);
});
}
}),
)
.child(
IconButton::new(("prev-hunk", row as u64), IconName::ArrowUp)
.shape(IconButtonShape::Square)
.icon_size(IconSize::Small)
// .disabled(!has_multiple_hunks)
.tooltip({
let focus_handle = editor.focus_handle(cx);
move |window, cx| {
Tooltip::for_action_in(
"Previous Hunk",
&GoToPrevHunk,
&focus_handle,
window,
cx,
)
}
})
.on_click({
let editor = editor.clone();
move |_event, window, cx| {
editor.update(cx, |editor, cx| {
let snapshot = editor.snapshot(window, cx);
let point = hunk_range.start.to_point(&snapshot.buffer_snapshot);
editor.go_to_hunk_before_position(&snapshot, point, window, cx);
editor.expand_selected_diff_hunks(cx);
});
}
}),
)
.child(
IconButton::new("discard", IconName::Undo)
.shape(IconButtonShape::Square)
.icon_size(IconSize::Small)
.tooltip({
@@ -8947,59 +9021,10 @@ fn diff_hunk_controls(
editor.update(cx, |editor, cx| {
let snapshot = editor.snapshot(window, cx);
let point = hunk_range.start.to_point(&snapshot.buffer_snapshot);
editor.discard_hunks_in_ranges([point..point].into_iter(), window, cx);
editor.revert_hunks_in_ranges([point..point].into_iter(), window, cx);
});
}
}),
)
.child(
Button::new(("skip-hunk", row as u64), "Skip")
.label_size(LabelSize::Small)
.tooltip({
let focus_handle = editor.focus_handle(cx);
move |window, cx| {
Tooltip::for_action_in("Skip Hunk", &GoToHunk, &focus_handle, window, cx)
}
})
.on_click({
let editor = editor.clone();
move |_event, window, cx| {
editor.update(cx, |editor, cx| {
let snapshot = editor.snapshot(window, cx);
let position = hunk_range.end.to_point(&snapshot.buffer_snapshot);
editor.go_to_hunk_after_position(&snapshot, position, window, cx);
editor.expand_selected_diff_hunks(cx);
});
}
}),
)
.child(
Button::new(
("stage-unstage-hunk", row as u64),
if stage { "Stage" } else { "Unstage" },
)
.label_size(LabelSize::Small)
.tooltip({
let focus_handle = editor.focus_handle(cx);
move |window, cx| {
Tooltip::for_action_in(
if stage { "Stage Hunk" } else { "Unstage Hunk" },
&ToggleStagedSelectedDiffHunks,
&focus_handle,
window,
cx,
)
}
})
.on_click({
let editor = editor.clone();
move |_event, _window, cx| {
editor.update(cx, |editor, cx| {
editor
.stage_or_unstage_diff_hunks(&[hunk_range.start..hunk_range.start], cx);
});
}
}),
)
.into_any_element()
}

View File

@@ -224,6 +224,7 @@ impl ScrollManager {
self.anchor.scroll_position(snapshot)
}
#[allow(clippy::too_many_arguments)]
fn set_scroll_position(
&mut self,
scroll_position: gpui::Point<f32>,
@@ -298,6 +299,7 @@ impl ScrollManager {
);
}
#[allow(clippy::too_many_arguments)]
fn set_anchor(
&mut self,
anchor: ScrollAnchor,

View File

@@ -399,6 +399,7 @@ async fn run_evaluation(
}
}
#[allow(clippy::too_many_arguments)]
async fn run_eval_project(
evaluation_project: EvaluationProject,
user_store: &Entity<UserStore>,

View File

@@ -191,7 +191,7 @@ static mut EXTENSION: Option<Box<dyn Extension>> = None;
pub static ZED_API_VERSION: [u8; 6] = *include_bytes!(concat!(env!("OUT_DIR"), "/version_bytes"));
mod wit {
#![allow(clippy::missing_safety_doc)]
#![allow(clippy::too_many_arguments, clippy::missing_safety_doc)]
wit_bindgen::generate!({
skip: ["init-extension"],

View File

@@ -218,6 +218,7 @@ impl ExtensionStore {
cx.global::<GlobalExtensionStore>().0.clone()
}
#[allow(clippy::too_many_arguments)]
pub fn new(
extensions_dir: PathBuf,
build_dir: Option<PathBuf>,

View File

@@ -25,7 +25,6 @@ use project::{PathMatchCandidateSet, Project, ProjectPath, WorktreeId};
use settings::Settings;
use std::{
cmp,
ops::Range,
path::{Path, PathBuf},
sync::{
atomic::{self, AtomicBool},
@@ -382,7 +381,6 @@ impl PartialOrd for ProjectPanelOrdMatch {
struct Matches {
separate_history: bool,
matches: Vec<Match>,
elided_byte_range: Option<Range<usize>>,
}
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone)]
@@ -394,35 +392,6 @@ enum Match {
Search(ProjectPanelOrdMatch),
}
struct MatchLabels {
path: String,
path_positions: Vec<usize>,
file_name: String,
file_name_positions: Vec<usize>,
}
#[derive(Clone, Copy, Debug)]
struct EmWidths {
normal: Pixels,
small: Pixels,
}
fn em_widths(window: &mut Window, cx: &mut App) -> EmWidths {
let style = window.text_style();
let font_id = window.text_system().resolve_font(&style.font());
let font_size = TextSize::Default.rems(cx).to_pixels(window.rem_size());
let normal = cx
.text_system()
.em_width(font_id, font_size)
.unwrap_or(px(16.));
let font_size = TextSize::Small.rems(cx).to_pixels(window.rem_size());
let small = cx
.text_system()
.em_width(font_id, font_size)
.unwrap_or(px(10.));
EmWidths { normal, small }
}
impl Match {
fn path(&self) -> &Arc<Path> {
match self {
@@ -437,43 +406,6 @@ impl Match {
Match::Search(panel_match) => Some(&panel_match),
}
}
fn common_prefix<'a>(&self, other: &'a Path) -> &'a Path {
let mut prefix = other;
let path_positions = match self {
Match::History {
panel_match: Some(mat),
..
}
| Match::Search(mat) => mat.0.positions.as_slice(),
Match::History {
panel_match: None, ..
} => &[],
};
let first_path_position = *path_positions.iter().min().unwrap_or(&0);
while self.path().strip_prefix(prefix).is_err()
|| prefix.to_string_lossy().len() > first_path_position
{
let Some(parent) = prefix.parent() else {
break;
};
prefix = parent;
}
prefix
}
fn approx_width(&self, em_widths: EmWidths) -> Pixels {
let file_name = self.path().file_name().map_or_else(
|| self.path().to_string_lossy(),
|file_name| file_name.to_string_lossy(),
);
let parent = self
.path()
.parent()
.map_or_else(|| "".into(), |parent| parent.to_string_lossy());
px(file_name.chars().count() as f32) * em_widths.normal
+ px(parent.chars().count() as f32) * em_widths.small
}
}
impl Matches {
@@ -519,11 +451,7 @@ impl Matches {
query: Option<&FileSearchQuery>,
new_search_matches: impl Iterator<Item = ProjectPanelOrdMatch>,
extend_old_matches: bool,
em_widths: EmWidths,
max_width: Pixels,
) {
self.elided_byte_range = None;
let Some(query) = query else {
// assuming that if there's no query, then there's no search matches.
self.matches.clear();
@@ -579,31 +507,6 @@ impl Matches {
}
}
}
let Some((first, rest)) = self.matches.split_first() else {
return;
};
let mut prefix = first.path().as_ref();
let mut widest_match = first.approx_width(em_widths);
for mat in rest {
widest_match = widest_match.max(mat.approx_width(em_widths));
prefix = mat.common_prefix(prefix);
}
if widest_match > max_width {
let components = prefix.components().collect::<Vec<_>>();
let prefix = prefix.to_string_lossy();
if components.len() > 3 {
let after_first = components[1..].iter().collect::<PathBuf>();
let after_first = after_first.to_string_lossy();
let start = prefix.len() - after_first.len();
let after_first_before_last = components[1..components.len() - 2]
.iter()
.collect::<PathBuf>();
let after_first_before_last = after_first_before_last.to_string_lossy();
self.elided_byte_range = Some(start..start + after_first_before_last.len());
}
}
}
/// If a < b, then a is a worse match, aligning with the `ProjectPanelOrdMatch` ordering.
@@ -632,25 +535,6 @@ impl Matches {
}
}
impl MatchLabels {
fn check(&self) {
let file_name = &self.file_name;
for i in &self.file_name_positions {
assert!(
self.file_name.is_char_boundary(*i),
"{i} is not a valid char boundary in file name {file_name:?}"
);
}
let path = &self.path;
for i in &self.path_positions {
assert!(
self.path.is_char_boundary(*i),
"{i} is not a valid char boundary in path {path:?}"
);
}
}
}
fn matching_history_items<'a>(
history_items: impl IntoIterator<Item = &'a FoundPath>,
currently_opened: Option<&'a FoundPath>,
@@ -760,6 +644,7 @@ impl FileSearchQuery {
}
impl FileFinderDelegate {
#[allow(clippy::too_many_arguments)]
fn new(
file_finder: WeakEntity<FileFinder>,
workspace: WeakEntity<Workspace>,
@@ -860,10 +745,10 @@ impl FileFinderDelegate {
.map(ProjectPanelOrdMatch);
let did_cancel = cancel_flag.load(atomic::Ordering::Relaxed);
picker
.update_in(&mut cx, |picker, window, cx| {
.update(&mut cx, |picker, cx| {
picker
.delegate
.set_search_matches(search_id, did_cancel, query, matches, window, cx)
.set_search_matches(search_id, did_cancel, query, matches, cx)
})
.log_err();
})
@@ -875,13 +760,9 @@ impl FileFinderDelegate {
did_cancel: bool,
query: FileSearchQuery,
matches: impl IntoIterator<Item = ProjectPanelOrdMatch>,
window: &mut Window,
cx: &mut Context<Picker<Self>>,
) {
let em_widths = em_widths(window, cx);
let file_finder_settings = FileFinderSettings::get_global(cx);
let max_width = FileFinder::modal_max_width(file_finder_settings.modal_max_width, window);
if search_id >= self.latest_search_id {
self.latest_search_id = search_id;
let query_changed = Some(query.path_query())
@@ -903,8 +784,6 @@ impl FileFinderDelegate {
Some(&query),
matches.into_iter(),
extend_old_matches,
em_widths,
max_width,
);
self.selected_index = selected_match.map_or_else(
@@ -923,8 +802,13 @@ impl FileFinderDelegate {
}
}
fn labels_for_match(&self, path_match: &Match, cx: &App, ix: usize) -> MatchLabels {
let mut labels = match &path_match {
fn labels_for_match(
&self,
path_match: &Match,
cx: &App,
ix: usize,
) -> (String, Vec<usize>, String, Vec<usize>) {
let (file_name, file_name_positions, full_path, full_path_positions) = match &path_match {
Match::History {
path: entry_path,
panel_match,
@@ -939,18 +823,18 @@ impl FileFinderDelegate {
if !has_worktree {
if let Some(absolute_path) = &entry_path.absolute {
return MatchLabels {
file_name: absolute_path
return (
absolute_path
.file_name()
.map_or_else(
|| project_relative_path.to_string_lossy(),
|file_name| file_name.to_string_lossy(),
)
.to_string(),
file_name_positions: Vec::new(),
path: absolute_path.to_string_lossy().to_string(),
path_positions: Vec::new(),
};
Vec::new(),
absolute_path.to_string_lossy().to_string(),
Vec::new(),
);
}
}
@@ -981,39 +865,44 @@ impl FileFinderDelegate {
Match::Search(path_match) => self.labels_for_path_match(&path_match.0),
};
if labels.file_name_positions.is_empty() {
if file_name_positions.is_empty() {
if let Some(user_home_path) = std::env::var("HOME").ok() {
let user_home_path = user_home_path.trim();
if !user_home_path.is_empty() {
if labels.path.starts_with(user_home_path) {
labels.path.replace_range(0..user_home_path.len(), "~");
labels.path_positions.retain_mut(|position| {
if *position >= user_home_path.len() {
*position -= user_home_path.len();
*position += 1;
true
} else {
false
}
})
if (&full_path).starts_with(user_home_path) {
return (
file_name,
file_name_positions,
full_path.replace(user_home_path, "~"),
full_path_positions,
);
}
}
}
}
labels.check();
labels
(
file_name,
file_name_positions,
full_path,
full_path_positions,
)
}
fn labels_for_path_match(&self, path_match: &PathMatch) -> MatchLabels {
fn labels_for_path_match(
&self,
path_match: &PathMatch,
) -> (String, Vec<usize>, String, Vec<usize>) {
let path = &path_match.path;
let path_string = path.to_string_lossy();
let full_path = [path_match.path_prefix.as_ref(), path_string.as_ref()].join("");
let mut path_positions = path_match.positions.clone();
let file_name = path_match.path.file_name().map_or_else(
let file_name = path.file_name().map_or_else(
|| path_match.path_prefix.to_string(),
|file_name| file_name.to_string_lossy().to_string(),
);
let mut path = path_match.path.to_string_lossy().to_string();
let file_name_start = path_match.path_prefix.len() + path.len() - file_name.len();
let file_name_start = path_match.path_prefix.len() + path_string.len() - file_name.len();
let file_name_positions = path_positions
.iter()
.filter_map(|pos| {
@@ -1025,31 +914,10 @@ impl FileFinderDelegate {
})
.collect();
path.drain(file_name_start.saturating_sub(path_match.path_prefix.len())..);
path_positions.retain_mut(|idx| {
if *idx < path.len() {
if let Some(elided_range) = &self.matches.elided_byte_range {
if *idx >= elided_range.end {
*idx += '…'.len_utf8();
*idx -= elided_range.len();
}
}
true
} else {
false
}
});
let full_path = full_path.trim_end_matches(&file_name).to_string();
path_positions.retain(|idx| *idx < full_path.len());
if let Some(elided_range) = &self.matches.elided_byte_range {
path.replace_range(elided_range.clone(), "");
}
MatchLabels {
file_name,
file_name_positions,
path,
path_positions,
}
(file_name, file_name_positions, full_path, path_positions)
}
fn lookup_absolute_path(
@@ -1101,17 +969,10 @@ impl FileFinderDelegate {
}
picker
.update_in(&mut cx, |picker, window, cx| {
.update_in(&mut cx, |picker, _, cx| {
let picker_delegate = &mut picker.delegate;
let search_id = util::post_inc(&mut picker_delegate.search_count);
picker_delegate.set_search_matches(
search_id,
false,
query,
path_matches,
window,
cx,
);
picker_delegate.set_search_matches(search_id, false, query, path_matches, cx);
anyhow::Ok(())
})
@@ -1188,10 +1049,6 @@ impl PickerDelegate for FileFinderDelegate {
window: &mut Window,
cx: &mut Context<Picker<Self>>,
) -> Task<()> {
let em_widths = em_widths(window, cx);
let file_finder_settings = FileFinderSettings::get_global(cx);
let max_width = FileFinder::modal_max_width(file_finder_settings.modal_max_width, window);
let raw_query = raw_query.replace(' ', "");
let raw_query = raw_query.trim();
if raw_query.is_empty() {
@@ -1219,8 +1076,6 @@ impl PickerDelegate for FileFinderDelegate {
None,
None.into_iter(),
false,
em_widths,
max_width,
);
self.first_update = false;
@@ -1414,10 +1269,11 @@ impl PickerDelegate for FileFinderDelegate {
.size(IconSize::Small.rems())
.into_any_element(),
};
let labels = self.labels_for_match(path_match, cx, ix);
let (file_name, file_name_positions, full_path, full_path_positions) =
self.labels_for_match(path_match, cx, ix);
let file_icon = if settings.file_icons {
FileIcons::get_icon(Path::new(&labels.file_name), cx)
FileIcons::get_icon(Path::new(&file_name), cx)
.map(Icon::from_path)
.map(|icon| icon.color(Color::Muted))
} else {
@@ -1435,12 +1291,9 @@ impl PickerDelegate for FileFinderDelegate {
h_flex()
.gap_2()
.py_px()
.child(HighlightedLabel::new(
labels.file_name,
labels.file_name_positions,
))
.child(HighlightedLabel::new(file_name, file_name_positions))
.child(
HighlightedLabel::new(labels.path, labels.path_positions)
HighlightedLabel::new(full_path, full_path_positions)
.size(LabelSize::Small)
.color(Color::Muted),
),

View File

@@ -384,7 +384,6 @@ async fn test_matching_cancellation(cx: &mut TestAppContext) {
ProjectPanelOrdMatch(matches[1].clone()),
ProjectPanelOrdMatch(matches[3].clone()),
],
window,
cx,
);
@@ -399,7 +398,6 @@ async fn test_matching_cancellation(cx: &mut TestAppContext) {
ProjectPanelOrdMatch(matches[2].clone()),
ProjectPanelOrdMatch(matches[3].clone()),
],
window,
cx,
);
@@ -494,11 +492,12 @@ async fn test_single_file_worktrees(cx: &mut TestAppContext) {
let matches = collect_search_matches(picker).search_matches_only();
assert_eq!(matches.len(), 1);
let labels = delegate.labels_for_path_match(&matches[0]);
assert_eq!(labels.file_name, "the-file");
assert_eq!(labels.file_name_positions, &[0, 1, 4]);
assert_eq!(labels.path, "");
assert_eq!(labels.path_positions, &[0; 0]);
let (file_name, file_name_positions, full_path, full_path_positions) =
delegate.labels_for_path_match(&matches[0]);
assert_eq!(file_name, "the-file");
assert_eq!(file_name_positions, &[0, 1, 4]);
assert_eq!(full_path, "");
assert_eq!(full_path_positions, &[0; 0]);
});
// Since the worktree root is a file, searching for its name followed by a slash does

View File

@@ -164,6 +164,7 @@ impl<'a> Matcher<'a> {
score
}
#[allow(clippy::too_many_arguments)]
fn recursive_score_match(
&mut self,
path: &[char],

View File

@@ -115,6 +115,7 @@ pub struct WaylandWindowStatePtr {
}
impl WaylandWindowState {
#[allow(clippy::too_many_arguments)]
pub(crate) fn new(
handle: AnyWindowHandle,
surface: wl_surface::WlSurface,

View File

@@ -353,6 +353,7 @@ where
}
impl X11WindowState {
#[allow(clippy::too_many_arguments)]
pub fn new(
handle: AnyWindowHandle,
client: X11ClientStatePtr,
@@ -711,6 +712,7 @@ enum WmHintPropertyState {
}
impl X11Window {
#[allow(clippy::too_many_arguments)]
pub fn new(
handle: AnyWindowHandle,
client: X11ClientStatePtr,

View File

@@ -132,6 +132,7 @@ impl WrappedLine {
}
}
#[allow(clippy::too_many_arguments)]
fn paint_line(
origin: Point<Pixels>,
layout: &LineLayout,

View File

@@ -1250,6 +1250,7 @@ fn parse_text(
})
}
#[allow(clippy::too_many_arguments)]
fn get_injections(
config: &InjectionConfig,
text: &BufferSnapshot,

View File

@@ -62,7 +62,7 @@ impl CloudModel {
pub fn availability(&self) -> LanguageModelAvailability {
match self {
Self::Anthropic(model) => match model {
anthropic::Model::Claude3_5Sonnet => {
anthropic::Model::Claude3_5Sonnet | anthropic::Model::Claude3_7Sonnet => {
LanguageModelAvailability::RequiresPlan(Plan::Free)
}
anthropic::Model::Claude3Opus

View File

@@ -296,6 +296,10 @@ impl LanguageModelProvider for CloudLanguageModelProvider {
anthropic::Model::Claude3_5Sonnet.id().to_string(),
CloudModel::Anthropic(anthropic::Model::Claude3_5Sonnet),
);
models.insert(
anthropic::Model::Claude3_7Sonnet.id().to_string(),
CloudModel::Anthropic(anthropic::Model::Claude3_7Sonnet),
);
}
let llm_closed_beta_models = if cx.has_flag::<LlmClosedBeta>() {

View File

@@ -177,6 +177,7 @@ impl LanguageModel for CopilotChatLanguageModel {
) -> BoxFuture<'static, Result<usize>> {
match self.model {
CopilotChatModel::Claude3_5Sonnet => count_anthropic_tokens(request, cx),
CopilotChatModel::Claude3_7Sonnet => count_anthropic_tokens(request, cx),
CopilotChatModel::Gemini20Flash => count_google_tokens(request, cx),
_ => {
let model = match self.model {
@@ -184,7 +185,9 @@ impl LanguageModel for CopilotChatLanguageModel {
CopilotChatModel::Gpt4 => open_ai::Model::Four,
CopilotChatModel::Gpt3_5Turbo => open_ai::Model::ThreePointFiveTurbo,
CopilotChatModel::O1 | CopilotChatModel::O3Mini => open_ai::Model::Four,
CopilotChatModel::Claude3_5Sonnet | CopilotChatModel::Gemini20Flash => {
CopilotChatModel::Claude3_5Sonnet
| CopilotChatModel::Claude3_7Sonnet
| CopilotChatModel::Gemini20Flash => {
unreachable!()
}
};

View File

@@ -100,6 +100,7 @@ pub struct LanguageServer {
output_done_rx: Mutex<Option<barrier::Receiver>>,
server: Arc<Mutex<Option<Child>>>,
workspace_folders: Arc<Mutex<BTreeSet<Url>>>,
root_uri: Url,
}
/// Identifies a running language server.
@@ -328,6 +329,7 @@ impl lsp_types::notification::Notification for ServerStatus {
impl LanguageServer {
/// Starts a language server process.
#[allow(clippy::too_many_arguments)]
pub fn new(
stderr_capture: Arc<Mutex<Option<String>>>,
server_id: LanguageServerId,
@@ -335,6 +337,7 @@ impl LanguageServer {
binary: LanguageServerBinary,
root_path: &Path,
code_action_kinds: Option<Vec<CodeActionKind>>,
workspace_folders: Arc<Mutex<BTreeSet<Url>>>,
cx: AsyncApp,
) -> Result<Self> {
let working_dir = if root_path.is_dir() {
@@ -369,6 +372,8 @@ impl LanguageServer {
let stdin = server.stdin.take().unwrap();
let stdout = server.stdout.take().unwrap();
let stderr = server.stderr.take().unwrap();
let root_uri = Url::from_file_path(&working_dir)
.map_err(|_| anyhow!("{} is not a valid URI", working_dir.display()))?;
let server = Self::new_internal(
server_id,
server_name,
@@ -379,6 +384,8 @@ impl LanguageServer {
Some(server),
code_action_kinds,
binary,
root_uri,
workspace_folders,
cx,
move |notification| {
log::info!(
@@ -393,6 +400,7 @@ impl LanguageServer {
Ok(server)
}
#[allow(clippy::too_many_arguments)]
fn new_internal<Stdin, Stdout, Stderr, F>(
server_id: LanguageServerId,
server_name: LanguageServerName,
@@ -403,6 +411,8 @@ impl LanguageServer {
server: Option<Child>,
code_action_kinds: Option<Vec<CodeActionKind>>,
binary: LanguageServerBinary,
root_uri: Url,
workspace_folders: Arc<Mutex<BTreeSet<Url>>>,
cx: AsyncApp,
on_unhandled_notification: F,
) -> Self
@@ -485,7 +495,8 @@ impl LanguageServer {
io_tasks: Mutex::new(Some((input_task, output_task))),
output_done_rx: Mutex::new(Some(output_done_rx)),
server: Arc::new(Mutex::new(server)),
workspace_folders: Default::default(),
workspace_folders,
root_uri,
}
}
@@ -610,11 +621,21 @@ impl LanguageServer {
}
pub fn default_initialize_params(&self, cx: &App) -> InitializeParams {
let workspace_folders = self
.workspace_folders
.lock()
.iter()
.cloned()
.map(|uri| WorkspaceFolder {
name: Default::default(),
uri,
})
.collect::<Vec<_>>();
#[allow(deprecated)]
InitializeParams {
process_id: None,
root_path: None,
root_uri: None,
root_uri: Some(self.root_uri.clone()),
initialization_options: None,
capabilities: ClientCapabilities {
general: Some(GeneralClientCapabilities {
@@ -784,7 +805,7 @@ impl LanguageServer {
}),
},
trace: None,
workspace_folders: None,
workspace_folders: Some(workspace_folders),
client_info: release_channel::ReleaseChannel::try_global(cx).map(|release_channel| {
ClientInfo {
name: release_channel.display_name().to_string(),
@@ -1253,24 +1274,27 @@ impl LanguageServer {
}
pub fn set_workspace_folders(&self, folders: BTreeSet<Url>) {
let mut workspace_folders = self.workspace_folders.lock();
let old_workspace_folders = std::mem::take(&mut *workspace_folders);
let added: Vec<_> = folders
.iter()
.difference(&old_workspace_folders)
.map(|uri| WorkspaceFolder {
uri: uri.clone(),
name: String::default(),
})
.collect();
let removed: Vec<_> = std::mem::replace(&mut *workspace_folders, folders)
.into_iter()
let removed: Vec<_> = old_workspace_folders
.difference(&folders)
.map(|uri| WorkspaceFolder {
uri: uri.clone(),
name: String::default(),
})
.collect();
let should_notify = !added.is_empty() || !removed.is_empty();
if should_notify {
*workspace_folders = folders;
drop(workspace_folders);
let params = DidChangeWorkspaceFoldersParams {
event: WorkspaceFoldersChangeEvent { added, removed },
};
@@ -1384,6 +1408,8 @@ impl FakeLanguageServer {
let server_name = LanguageServerName(name.clone().into());
let process_name = Arc::from(name.as_str());
let root = Self::root_path();
let workspace_folders: Arc<Mutex<BTreeSet<Url>>> = Default::default();
let mut server = LanguageServer::new_internal(
server_id,
server_name.clone(),
@@ -1394,6 +1420,8 @@ impl FakeLanguageServer {
None,
None,
binary.clone(),
root,
workspace_folders.clone(),
cx.clone(),
|_| {},
);
@@ -1411,6 +1439,8 @@ impl FakeLanguageServer {
None,
None,
binary,
Self::root_path(),
workspace_folders,
cx.clone(),
move |msg| {
notifications_tx
@@ -1445,6 +1475,15 @@ impl FakeLanguageServer {
(server, fake)
}
#[cfg(target_os = "windows")]
fn root_path() -> Url {
Url::from_file_path("C:/").unwrap()
}
#[cfg(not(target_os = "windows"))]
fn root_path() -> Url {
Url::from_file_path("/").unwrap()
}
}
#[cfg(any(test, feature = "test-support"))]

View File

@@ -2902,6 +2902,7 @@ impl MultiBuffer {
snapshot.check_invariants();
}
#[allow(clippy::too_many_arguments)]
fn recompute_diff_transforms_for_edit(
&self,
edit: &Edit<TypedOffset<Excerpt>>,

View File

@@ -142,15 +142,15 @@ impl Model {
pub fn max_token_count(&self) -> usize {
match self {
Self::ThreePointFiveTurbo => 16385,
Self::Four => 8192,
Self::FourTurbo => 128000,
Self::FourOmni => 128000,
Self::FourOmniMini => 128000,
Self::O1 => 200000,
Self::O1Preview => 128000,
Self::O1Mini => 128000,
Self::O3Mini => 200000,
Self::ThreePointFiveTurbo => 16_385,
Self::Four => 8_192,
Self::FourTurbo => 128_000,
Self::FourOmni => 128_000,
Self::FourOmniMini => 128_000,
Self::O1 => 200_000,
Self::O1Preview => 128_000,
Self::O1Mini => 128_000,
Self::O3Mini => 200_000,
Self::Custom { max_tokens, .. } => *max_tokens,
}
}

View File

@@ -2360,6 +2360,7 @@ impl OutlinePanel {
)
}
#[allow(clippy::too_many_arguments)]
fn render_search_match(
&mut self,
multi_buffer_snapshot: Option<&MultiBufferSnapshot>,
@@ -2451,6 +2452,7 @@ impl OutlinePanel {
))
}
#[allow(clippy::too_many_arguments)]
fn entry_element(
&self,
rendered_entry: PanelEntry,
@@ -3834,6 +3836,7 @@ impl OutlinePanel {
})
}
#[allow(clippy::too_many_arguments)]
fn push_entry(
&self,
state: &mut GenerationState,
@@ -4051,6 +4054,7 @@ impl OutlinePanel {
update_cached_entries
}
#[allow(clippy::too_many_arguments)]
fn add_excerpt_entries(
&self,
state: &mut GenerationState,
@@ -4109,6 +4113,7 @@ impl OutlinePanel {
}
}
#[allow(clippy::too_many_arguments)]
fn add_search_entries(
&mut self,
state: &mut GenerationState,

View File

@@ -279,6 +279,7 @@ impl Prettier {
server_binary,
&prettier_dir,
None,
Default::default(),
cx.clone(),
)
.context("prettier server creation")?;

View File

@@ -209,14 +209,14 @@ impl LocalLspStore {
);
let binary = self.get_language_server_binary(adapter.clone(), delegate.clone(), true, cx);
let pending_workspace_folders: Arc<Mutex<BTreeSet<Url>>> = Default::default();
let pending_server = cx.spawn({
let adapter = adapter.clone();
let server_name = adapter.name.clone();
let stderr_capture = stderr_capture.clone();
#[cfg(any(test, feature = "test-support"))]
let lsp_store = self.weak.clone();
let pending_workspace_folders = pending_workspace_folders.clone();
move |cx| async move {
let binary = binary.await?;
#[cfg(any(test, feature = "test-support"))]
@@ -242,12 +242,12 @@ impl LocalLspStore {
binary,
&root_path,
adapter.code_action_kinds(),
pending_workspace_folders,
cx,
)
}
});
let pending_workspace_folders: Arc<Mutex<BTreeSet<Url>>> = Default::default();
let startup = {
let server_name = adapter.name.0.clone();
let delegate = delegate as Arc<dyn LspAdapterDelegate>;
@@ -1201,6 +1201,7 @@ impl LocalLspStore {
Ok(project_transaction)
}
#[allow(clippy::too_many_arguments)]
async fn execute_formatters(
lsp_store: WeakEntity<LspStore>,
formatters: &[Formatter],
@@ -1450,6 +1451,7 @@ impl LocalLspStore {
}
}
#[allow(clippy::too_many_arguments)]
async fn format_via_lsp(
this: &WeakEntity<LspStore>,
buffer: &Entity<Buffer>,
@@ -1925,14 +1927,17 @@ impl LocalLspStore {
self.buffer_snapshots
.entry(buffer_id)
.or_default()
.insert(server.server_id(), vec![snapshot]);
.entry(server.server_id())
.or_insert_with(|| {
server.register_buffer(
uri.clone(),
adapter.language_id(&language.name()),
0,
initial_snapshot.text(),
);
server.register_buffer(
uri.clone(),
adapter.language_id(&language.name()),
0,
initial_snapshot.text(),
);
vec![snapshot]
});
}
}
}
@@ -2958,6 +2963,7 @@ impl LspStore {
}
}
#[allow(clippy::too_many_arguments)]
pub fn new_local(
buffer_store: Entity<BufferStore>,
worktree_store: Entity<WorktreeStore>,
@@ -3051,6 +3057,7 @@ impl LspStore {
})
}
#[allow(clippy::too_many_arguments)]
pub(super) fn new_remote(
buffer_store: Entity<BufferStore>,
worktree_store: Entity<WorktreeStore>,
@@ -4462,6 +4469,7 @@ impl LspStore {
Ok(())
}
#[allow(clippy::too_many_arguments)]
async fn resolve_completion_remote(
project_id: u64,
server_id: LanguageServerId,
@@ -7514,6 +7522,7 @@ impl LspStore {
Ok(())
}
#[allow(clippy::too_many_arguments)]
fn insert_newly_running_language_server(
&mut self,
adapter: Arc<CachedLspAdapter>,
@@ -7539,10 +7548,11 @@ impl LspStore {
// Update language_servers collection with Running variant of LanguageServerState
// indicating that the server is up and running and ready
let workspace_folders = workspace_folders.lock().clone();
local.language_servers.insert(
server_id,
LanguageServerState::running(
workspace_folders.lock().clone(),
workspace_folders,
adapter.clone(),
language_server.clone(),
None,

View File

@@ -971,6 +971,7 @@ impl Project {
.await
}
#[allow(clippy::too_many_arguments)]
async fn from_join_project_response(
response: TypedEnvelope<proto::JoinProjectResponse>,
subscriptions: [EntitySubscription; 5],

View File

@@ -1279,6 +1279,7 @@ impl From<SshRemoteClient> for AnyProtoClient {
#[async_trait(?Send)]
trait RemoteConnection: Send + Sync {
#[allow(clippy::too_many_arguments)]
fn start_proxy(
&self,
unique_identifier: String,

View File

@@ -175,6 +175,7 @@ impl RichText {
}
}
#[allow(clippy::too_many_arguments)]
pub fn render_markdown_mut(
block: &str,
mut mentions: &[Mention],

View File

@@ -116,6 +116,7 @@ impl WorktreeIndex {
})
}
#[allow(clippy::too_many_arguments)]
pub fn new(
worktree: Entity<Worktree>,
db_connection: heed::Env,

View File

@@ -325,6 +325,7 @@ pub struct TerminalBuilder {
}
impl TerminalBuilder {
#[allow(clippy::too_many_arguments)]
pub fn new(
working_directory: Option<PathBuf>,
python_venv_directory: Option<PathBuf>,

View File

@@ -171,6 +171,7 @@ impl InteractiveElement for TerminalElement {
impl StatefulInteractiveElement for TerminalElement {}
impl TerminalElement {
#[allow(clippy::too_many_arguments)]
pub fn new(
terminal: Entity<Terminal>,
terminal_view: Entity<TerminalView>,

View File

@@ -191,6 +191,7 @@ impl TitleBar {
)
}
#[allow(clippy::too_many_arguments)]
fn render_collaborator(
&self,
user: &Arc<User>,

View File

@@ -85,6 +85,7 @@ impl ToolchainSelector {
Some(())
}
#[allow(clippy::too_many_arguments)]
fn new(
workspace: WeakEntity<Workspace>,
project: Entity<Project>,
@@ -142,6 +143,7 @@ pub struct ToolchainSelectorDelegate {
}
impl ToolchainSelectorDelegate {
#[allow(clippy::too_many_arguments)]
fn new(
active_toolchain: Option<Toolchain>,
toolchain_selector: WeakEntity<ToolchainSelector>,

View File

@@ -843,6 +843,7 @@ impl Pane {
}
}
#[allow(clippy::too_many_arguments)]
pub(crate) fn open_item(
&mut self,
project_entry_id: Option<ProjectEntryId>,

View File

@@ -122,6 +122,7 @@ impl PaneGroup {
};
}
#[allow(clippy::too_many_arguments)]
pub fn render(
&self,
project: &Entity<Project>,
@@ -227,6 +228,7 @@ impl Member {
}
}
#[allow(clippy::too_many_arguments)]
pub fn render(
&self,
project: &Entity<Project>,
@@ -676,6 +678,7 @@ impl PaneAxis {
None
}
#[allow(clippy::too_many_arguments)]
fn render(
&self,
project: &Entity<Project>,
@@ -879,6 +882,7 @@ mod element {
self
}
#[allow(clippy::too_many_arguments)]
fn compute_resize(
flexes: &Arc<Mutex<Vec<f32>>>,
e: &MouseMoveEvent,
@@ -968,6 +972,7 @@ mod element {
window.refresh();
}
#[allow(clippy::too_many_arguments)]
fn layout_handle(
axis: Axis,
pane_bounds: Bounds<Pixels>,

View File

@@ -2696,6 +2696,7 @@ impl Workspace {
)
}
#[allow(clippy::too_many_arguments)]
pub fn add_item(
&mut self,
pane: Entity<Pane>,

View File

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

View File

@@ -1 +1 @@
dev
stable

View File

@@ -355,6 +355,7 @@ impl Zeta {
}
}
#[allow(clippy::too_many_arguments)]
fn request_completion_impl<F, R>(
&mut self,
workspace: Option<Entity<Workspace>>,
@@ -792,6 +793,7 @@ and then another
}
}
#[allow(clippy::too_many_arguments)]
fn process_completion_response(
prediction_response: PredictEditsResponse,
buffer: Entity<Buffer>,

View File

@@ -118,7 +118,7 @@ mv Cargo.toml.backup Cargo.toml
popd
echo "Bundled ${app_path}"
if [[ -n "${MACOS_CERTIFICATE:-}" && -n "${MACOS_CERTIFICATE_PASSWORD:-}" && -n "${APPLE_NOTARIZATION_USERNAME:-}" && -n "${APPLE_NOTARIZATION_PASSWORD:-}" ]]; then
if [[ -n "${MACOS_CERTIFICATE:-}" && -n "${MACOS_CERTIFICATE_PASSWORD:-}" && -n "${APPLE_NOTARIZATION_KEY:-}" && -n "${APPLE_NOTARIZATION_KEY_ID:-}" && -n "${APPLE_NOTARIZATION_ISSUER_ID:-}" ]]; then
can_code_sign=true
echo "Setting up keychain for code signing..."
@@ -247,7 +247,7 @@ function sign_app_binaries() {
/usr/bin/codesign --deep --force --timestamp --options runtime --entitlements crates/zed/resources/zed.entitlements --sign "$IDENTITY" "${app_path}/Contents/MacOS/zed" -v
/usr/bin/codesign --force --timestamp --options runtime --entitlements crates/zed/resources/zed.entitlements --sign "$IDENTITY" "${app_path}" -v
else
echo "One or more of the following variables are missing: MACOS_CERTIFICATE, MACOS_CERTIFICATE_PASSWORD, APPLE_NOTARIZATION_USERNAME, APPLE_NOTARIZATION_PASSWORD"
echo "One or more of the following variables are missing: MACOS_CERTIFICATE, MACOS_CERTIFICATE_PASSWORD, APPLE_NOTARIZATION_KEY, APPLE_NOTARIZATION_KEY_ID, APPLE_NOTARIZATION_ISSUER_ID"
if [[ "$local_only" = false ]]; then
echo "To create a self-signed local build use ./scripts/build.sh -ldf"
exit 1
@@ -311,6 +311,7 @@ function sign_app_binaries() {
rm -rf ${dmg_source_directory}
mkdir -p ${dmg_source_directory}
mv "${app_path}" "${dmg_source_directory}"
notarization_key_file=$(mktemp)
if [[ $can_code_sign = true ]]; then
echo "Creating temporary DMG at ${dmg_file_path} using ${dmg_source_directory} to notarize app bundle"
@@ -320,7 +321,8 @@ function sign_app_binaries() {
/usr/bin/codesign --deep --force --timestamp --options runtime --sign "$IDENTITY" "$(pwd)/${dmg_file_path}" -v
echo "Notarizing DMG with Apple"
"${xcode_bin_dir_path}/notarytool" submit --wait --apple-id "$APPLE_NOTARIZATION_USERNAME" --password "$APPLE_NOTARIZATION_PASSWORD" --team-id "$APPLE_NOTARIZATION_TEAM" "${dmg_file_path}"
echo "$APPLE_NOTARIZATION_KEY" > "$notarization_key_file"
"${xcode_bin_dir_path}/notarytool" submit --wait --key "$notarization_key_file" --key-id "$APPLE_NOTARIZATION_KEY_ID" --issuer "$APPLE_NOTARIZATION_ISSUER_ID" "${dmg_file_path}"
echo "Removing temporary DMG (used only for notarization)"
rm "${dmg_file_path}"
@@ -347,8 +349,9 @@ function sign_app_binaries() {
if [[ $can_code_sign = true ]]; then
echo "Notarizing DMG with Apple"
/usr/bin/codesign --deep --force --timestamp --options runtime --sign "$IDENTITY" "$(pwd)/${dmg_file_path}" -v
"${xcode_bin_dir_path}/notarytool" submit --wait --apple-id "$APPLE_NOTARIZATION_USERNAME" --password "$APPLE_NOTARIZATION_PASSWORD" --team-id "$APPLE_NOTARIZATION_TEAM" "${dmg_file_path}"
"${xcode_bin_dir_path}/notarytool" submit --wait --key "$notarization_key_file" --key-id "$APPLE_NOTARIZATION_KEY_ID" --issuer "$APPLE_NOTARIZATION_ISSUER_ID" "${dmg_file_path}"
"${xcode_bin_dir_path}/stapler" staple "${dmg_file_path}"
rm "$notarization_key_file"
fi
if [ "$open_result" = true ]; then