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.
This commit is contained in:
l0ng-ai authored and GitHub committed 2026-11-04 23:32:58 +08:00
1 parent 4906bcb2a1
commit a0dfb1e741
5 files changed
+51

No files matched your search

+11
View File
@@ -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"