internal: Make autoclosing angle brackets configurable, disabled by default
This commit is contained in:
@@ -386,6 +386,9 @@ config_data! {
|
||||
/// Show documentation.
|
||||
signatureInfo_documentation_enable: bool = "true",
|
||||
|
||||
/// Whether to insert closing angle brackets when typing an opening angle bracket of a generic argument list.
|
||||
typing_autoClosingAngleBrackets_enable: bool = "false",
|
||||
|
||||
/// Workspace symbol search kind.
|
||||
workspace_symbol_search_kind: WorkspaceSymbolSearchKindDef = "\"only_types\"",
|
||||
/// Limits the number of items returned from a workspace symbol search (Defaults to 128).
|
||||
@@ -1220,6 +1223,10 @@ impl Config {
|
||||
n => n,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn typing_autoclose_angle(&self) -> bool {
|
||||
self.data.typing_autoClosingAngleBrackets_enable
|
||||
}
|
||||
}
|
||||
// Deserialization definitions
|
||||
|
||||
|
||||
@@ -299,7 +299,8 @@ pub(crate) fn handle_on_type_formatting(
|
||||
return Ok(None);
|
||||
}
|
||||
|
||||
let edit = snap.analysis.on_char_typed(position, char_typed)?;
|
||||
let edit =
|
||||
snap.analysis.on_char_typed(position, char_typed, snap.config.typing_autoclose_angle())?;
|
||||
let edit = match edit {
|
||||
Some(it) => it,
|
||||
None => return Ok(None),
|
||||
|
||||
Reference in New Issue
Block a user