Unnamed repository; edit this file 'description' to name the repository.
chore: deprecate `typing.autoClosingAngleBrackets` configuration
Signed-off-by: Tarek <[email protected]>
Tarek 2024-12-04
parent d6b701e · commit 9aff466
-rw-r--r--crates/ide/src/lib.rs4
-rw-r--r--crates/rust-analyzer/src/config.rs6
-rw-r--r--crates/rust-analyzer/src/handlers/request.rs7
-rw-r--r--docs/user/generated_config.adoc5
-rw-r--r--editors/code/package.json10
5 files changed, 1 insertions, 31 deletions
diff --git a/crates/ide/src/lib.rs b/crates/ide/src/lib.rs
index b4f3de3b17..b43685ffee 100644
--- a/crates/ide/src/lib.rs
+++ b/crates/ide/src/lib.rs
@@ -410,16 +410,12 @@ impl Analysis {
&self,
position: FilePosition,
char_typed: char,
- autoclose: bool,
chars_to_exclude: Option<String>,
) -> Cancellable<Option<SourceChange>> {
// Fast path to not even parse the file.
if !typing::TRIGGER_CHARS.contains(char_typed) {
return Ok(None);
}
- if char_typed == '<' && !autoclose {
- return Ok(None);
- }
if let Some(chars_to_exclude) = chars_to_exclude {
if chars_to_exclude.contains(char_typed) {
return Ok(None);
diff --git a/crates/rust-analyzer/src/config.rs b/crates/rust-analyzer/src/config.rs
index c2d6196ca4..392bfbf15f 100644
--- a/crates/rust-analyzer/src/config.rs
+++ b/crates/rust-analyzer/src/config.rs
@@ -308,8 +308,6 @@ 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,
/// Specify the characters to exclude from triggering typing assists. The default trigger characters are `.`, `=`, `<`, `>`, `{`, and `(`. Setting this to a string will disable typing assists for the specified characters.
typing_excludeChars: Option<String> = None,
@@ -2158,10 +2156,6 @@ impl Config {
}
}
- pub fn typing_autoclose_angle(&self) -> bool {
- *self.typing_autoClosingAngleBrackets_enable()
- }
-
pub fn typing_exclude_chars(&self) -> Option<String> {
self.typing_excludeChars().clone()
}
diff --git a/crates/rust-analyzer/src/handlers/request.rs b/crates/rust-analyzer/src/handlers/request.rs
index 29820a3e37..0fadfa6c42 100644
--- a/crates/rust-analyzer/src/handlers/request.rs
+++ b/crates/rust-analyzer/src/handlers/request.rs
@@ -461,12 +461,7 @@ pub(crate) fn handle_on_type_formatting(
}
let chars_to_exclude = snap.config.typing_exclude_chars();
- let edit = snap.analysis.on_char_typed(
- position,
- char_typed,
- snap.config.typing_autoclose_angle(),
- chars_to_exclude,
- )?;
+ let edit = snap.analysis.on_char_typed(position, char_typed, chars_to_exclude)?;
let edit = match edit {
Some(it) => it,
None => return Ok(None),
diff --git a/docs/user/generated_config.adoc b/docs/user/generated_config.adoc
index d0c95912c3..a3172c7ca2 100644
--- a/docs/user/generated_config.adoc
+++ b/docs/user/generated_config.adoc
@@ -992,11 +992,6 @@ Show full signature of the callable. Only shows parameters if disabled.
--
Show documentation.
--
-[[rust-analyzer.typing.autoClosingAngleBrackets.enable]]rust-analyzer.typing.autoClosingAngleBrackets.enable (default: `false`)::
-+
---
-Whether to insert closing angle brackets when typing an opening angle bracket of a generic argument list.
---
[[rust-analyzer.typing.excludeChars]]rust-analyzer.typing.excludeChars (default: `null`)::
+
--
diff --git a/editors/code/package.json b/editors/code/package.json
index e98205e0ea..68c61e4bf6 100644
--- a/editors/code/package.json
+++ b/editors/code/package.json
@@ -2605,16 +2605,6 @@
{
"title": "typing",
"properties": {
- "rust-analyzer.typing.autoClosingAngleBrackets.enable": {
- "markdownDescription": "Whether to insert closing angle brackets when typing an opening angle bracket of a generic argument list.",
- "default": false,
- "type": "boolean"
- }
- }
- },
- {
- "title": "typing",
- "properties": {
"rust-analyzer.typing.excludeChars": {
"markdownDescription": "Specify the characters to exclude from triggering typing assists. The default trigger characters are `.`, `=`, `<`, `>`, `{`, and `(`. Setting this to a string will disable typing assists for the specified characters.",
"default": null,