Skip to content

The IDE you know, rebuilt in Rust. IntelliJ IDEA–style keymap, tool windows and search-everywhere in a fast native app: editor, code insight, debugger, Git, terminal, database and HTTP clients for 60+ languages.

fix(lsp): rename TypeScript symbols everywhere instead of aliasing the import (#1302)

l0ng-aia0dfb1e741e6
diff --git a/languages/javascript.toml b/languages/javascript.toml
index 5f19df869..8d31fefe9 100644
--- a/languages/javascript.toml
+++ b/languages/javascript.toml
@@ -17,6 +17,13 @@ args = ["--stdio"]
root-markers = ["jsconfig.json", "tsconfig.json", "package.json"]
install-hint = "npm i -g @vtsls/language-server"
+# Rename renames the symbol everywhere: no `import { a as b }` alias in the file renamed from.
+[language-servers.initialization-options.typescript.preferences]
+useAliasesForRenames = false
+
+[language-servers.initialization-options.javascript.preferences]
+useAliasesForRenames = false
+
[[language-servers]]
name = "typescript-language-server"
tsserver-project = true
@@ -27,6 +34,10 @@ args = ["--stdio"]
root-markers = ["jsconfig.json", "tsconfig.json", "package.json"]
install-hint = "npm i -g typescript@6 typescript-language-server"
+# Rename renames the symbol everywhere: no `import { a as b }` alias in the file renamed from.
+[language-servers.initialization-options.preferences]
+providePrefixAndSuffixTextForRename = false
+
[[language-servers]]
name = "oxlint"
command = "oxlint"
diff --git a/languages/javascriptreact.toml b/languages/javascriptreact.toml
index be5b5ab90..d3c6c57df 100644
--- a/languages/javascriptreact.toml
+++ b/languages/javascriptreact.toml
@@ -16,6 +16,13 @@ args = ["--stdio"]
root-markers = ["jsconfig.json", "tsconfig.json", "package.json"]
install-hint = "npm i -g @vtsls/language-server"
+# Rename renames the symbol everywhere: no `import { a as b }` alias in the file renamed from.
+[language-servers.initialization-options.typescript.preferences]
+useAliasesForRenames = false
+
+[language-servers.initialization-options.javascript.preferences]
+useAliasesForRenames = false
+
[[language-servers]]
name = "typescript-language-server"
tsserver-project = true
@@ -26,6 +33,10 @@ args = ["--stdio"]
root-markers = ["jsconfig.json", "tsconfig.json", "package.json"]
install-hint = "npm i -g typescript@6 typescript-language-server"
+# Rename renames the symbol everywhere: no `import { a as b }` alias in the file renamed from.
+[language-servers.initialization-options.preferences]
+providePrefixAndSuffixTextForRename = false
+
[[language-servers]]
name = "oxlint"
command = "oxlint"
diff --git a/languages/typescript.toml b/languages/typescript.toml
index 0dedc17ad..c0da45953 100644
--- a/languages/typescript.toml
+++ b/languages/typescript.toml
@@ -16,6 +16,13 @@ args = ["--stdio"]
root-markers = ["tsconfig.json", "jsconfig.json", "package.json"]
install-hint = "npm i -g @vtsls/language-server"
+# Rename renames the symbol everywhere: no `import { a as b }` alias in the file renamed from.
+[language-servers.initialization-options.typescript.preferences]
+useAliasesForRenames = false
+
+[language-servers.initialization-options.javascript.preferences]
+useAliasesForRenames = false
+
[[language-servers]]
name = "typescript-language-server"
tsserver-project = true
@@ -26,6 +33,10 @@ args = ["--stdio"]
root-markers = ["tsconfig.json", "jsconfig.json", "package.json"]
install-hint = "npm i -g typescript@6 typescript-language-server"
+# Rename renames the symbol everywhere: no `import { a as b }` alias in the file renamed from.
+[language-servers.initialization-options.preferences]
+providePrefixAndSuffixTextForRename = false
+
# Angular projects only: templates inline in components (`template: ...`),
# and their usages and renames in templates. Last: TypeScript's own hover,
# definition and symbols come first.
diff --git a/languages/typescriptreact.toml b/languages/typescriptreact.toml
index d7ecf0b8c..82a1a5bcd 100644
--- a/languages/typescriptreact.toml
+++ b/languages/typescriptreact.toml
@@ -16,6 +16,13 @@ args = ["--stdio"]
root-markers = ["tsconfig.json", "jsconfig.json", "package.json"]
install-hint = "npm i -g @vtsls/language-server"
+# Rename renames the symbol everywhere: no `import { a as b }` alias in the file renamed from.
+[language-servers.initialization-options.typescript.preferences]
+useAliasesForRenames = false
+
+[language-servers.initialization-options.javascript.preferences]
+useAliasesForRenames = false
+
[[language-servers]]
name = "typescript-language-server"
tsserver-project = true
@@ -26,6 +33,10 @@ args = ["--stdio"]
root-markers = ["tsconfig.json", "jsconfig.json", "package.json"]
install-hint = "npm i -g typescript@6 typescript-language-server"
+# Rename renames the symbol everywhere: no `import { a as b }` alias in the file renamed from.
+[language-servers.initialization-options.preferences]
+providePrefixAndSuffixTextForRename = false
+
[[language-servers]]
name = "oxlint"
command = "oxlint"
diff --git a/languages/vue.toml b/languages/vue.toml
index 247f09303..2f1b2d73c 100644
--- a/languages/vue.toml
+++ b/languages/vue.toml
@@ -23,6 +23,13 @@ args = ["--stdio"]
root-markers = ["tsconfig.json", "jsconfig.json", "package.json"]
install-hint = "npm i -g @vtsls/language-server"
+# Rename renames the symbol everywhere: no `import { a as b }` alias in the file renamed from.
+[language-servers.initialization-options.typescript.preferences]
+useAliasesForRenames = false
+
+[language-servers.initialization-options.javascript.preferences]
+useAliasesForRenames = false
+
[[language-servers]]
name = "oxlint"
command = "oxlint"