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

Renaming an imported function at a call site renamed only the local binding,
leaving `import { formatMoney as formatPrice }` and the declaration as it
was: both TypeScript servers default to aliases on rename. vtsls gets
`typescript.preferences.useAliasesForRenames = false` (and the JavaScript
one), typescript-language-server `providePrefixAndSuffixTextForRename = false`,
in every language that starts them.
Цей коміт міститься в:
l0ng-ai authored and GitHub committed 2026-11-04 23:32:58 +08:00
1 джерело 4906bcb2a1
коміт a0dfb1e741
5 files changed
+51

No files matched your search

+11
Переглянути файл
@@ -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"
+11
Переглянути файл
@@ -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"
+11
Переглянути файл
@@ -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.
+11
Переглянути файл
@@ -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"
+7
Переглянути файл
@@ -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"