Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions assets/settings/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,11 @@
//
// Default: split
"diff_view_style": "split",
// Whether to automatically detect the language of pasted code
// in Plain Text buffers using tree-sitter grammar scoring.
//
// Default: true
"auto_detect_language": true,
// Show method signatures in the editor, when inside parentheses.
"auto_signature_help": false,
// Whether to show the signature help after completion or a bracket pair inserted.
Expand Down
2 changes: 2 additions & 0 deletions crates/editor/src/editor_settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ pub struct EditorSettings {
pub completion_menu_scrollbar: ShowScrollbar,
pub completion_detail_alignment: CompletionDetailAlignment,
pub diff_view_style: DiffViewStyle,
pub auto_detect_language: bool,
}
#[derive(Debug, Clone)]
pub struct Jupyter {
Expand Down Expand Up @@ -297,6 +298,7 @@ impl Settings for EditorSettings {
completion_menu_scrollbar: editor.completion_menu_scrollbar.map(Into::into).unwrap(),
completion_detail_alignment: editor.completion_detail_alignment.unwrap(),
diff_view_style: editor.diff_view_style.unwrap(),
auto_detect_language: editor.auto_detect_language.unwrap(),
}
}
}
1 change: 1 addition & 0 deletions crates/settings/src/vscode_import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ impl VsCodeSettings {
completion_menu_scrollbar: None,
completion_detail_alignment: None,
diff_view_style: None,
auto_detect_language: None,
}
}

Expand Down
6 changes: 6 additions & 0 deletions crates/settings_content/src/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,12 @@ pub struct EditorSettingsContent {
///
/// Default: split
pub diff_view_style: Option<DiffViewStyle>,

/// Whether to automatically detect the language of pasted code
/// in Plain Text buffers using tree-sitter grammar scoring.
///
/// Default: true
pub auto_detect_language: Option<bool>,
}

#[derive(
Expand Down
2 changes: 2 additions & 0 deletions crates/zed/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ language_tools.workspace = true
languages = { workspace = true, features = ["load-grammars"] }
line_ending_selector.workspace = true
log.workspace = true
grammars = { workspace = true, features = ["load-grammars"] }
tree-sitter.workspace = true
markdown.workspace = true
markdown_preview.workspace = true
menu.workspace = true
Expand Down
1 change: 1 addition & 0 deletions crates/zed/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,7 @@ fn main() {
load_embedded_fonts(cx);

editor::init(cx);
zed::language_detection::init(cx);
image_viewer::init(cx);
repl::notebook::init(cx);
diagnostics::init(cx);
Expand Down
1 change: 1 addition & 0 deletions crates/zed/src/zed.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
mod app_menus;
pub mod edit_prediction_registry;
pub mod language_detection;
#[cfg(target_os = "macos")]
pub(crate) mod mac_only_instance;
mod migrate;
Expand Down
Loading
Loading