mirror of
https://github.com/l0ng-ai/openidea.git
synced 2026-11-06 08:07:49 +00:00
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.
55 lines
1.8 KiB
TOML
55 lines
1.8 KiB
TOML
id = "javascript"
|
|
name = "JavaScript"
|
|
formatter = { tool = "prettier", parser = "babel", range = true }
|
|
extensions = ["js", "mjs", "cjs"]
|
|
first-line = "^#!.*\\b(node|nodejs|deno|bun)\\b"
|
|
line-comment = "//"
|
|
block-comment = ["/*", "*/"]
|
|
indent = { tab-size = 2, insert-spaces = true }
|
|
ui-mode = "JavaScript"
|
|
tree-sitter = "javascript"
|
|
|
|
[[language-servers]]
|
|
name = "vtsls"
|
|
tsserver-project = true
|
|
command = "vtsls"
|
|
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
|
|
# Alternative: used only when the server above is not installed.
|
|
fallback = true
|
|
command = "typescript-language-server"
|
|
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"
|
|
args = ["--lsp"]
|
|
root-markers = [".oxlintrc.json", ".oxlintrc.jsonc", "oxlint.config.ts", "oxlint.config.mts"]
|
|
require-root-marker = true
|
|
install-hint = "npm i -D oxlint"
|
|
|
|
[debugger]
|
|
adapter = "js-debug"
|
|
command = "js-debug-adapter"
|
|
args = ["${port}", "127.0.0.1"]
|
|
transport = "tcp"
|
|
install-hint = "Install vscode-js-debug's DAP server (js-debug-dap-*.tar.gz from https://github.com/microsoft/vscode-js-debug/releases) as `js-debug-adapter`"
|