Files
openidea/languages/javascriptreact.toml
LU XIANGRUIandwildcatDownstairs 2f799aede9 fix(editor): match WebStorm's JS/TS inlay hint defaults and cut long hints (#7338)
JS/TS inlay hints default as in WebStorm: inferred types for variables and fields, enum values, and parameter names for literal and anonymous-function arguments. The Editor toggle now reaches the typescript-language-server fallback too. Long hints are cut with the full label in the tooltip, which also refreshes when the server changes it.

Closes #7326

Co-authored-by: wildcatDownstairs <26499420+wildcatDownstairs@users.noreply.github.com>
2026-12-02 14:32:27 +08:00

140 lines
5.7 KiB
TOML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
id = "javascriptreact"
name = "JavaScript JSX"
formatter = { tool = "prettier", parser = "babel", range = true }
extensions = ["jsx"]
line-comment = "//"
block-comment = ["/*", "*/"]
indent = { tab-size = 2, insert-spaces = true }
ui-mode = "JSX"
tree-sitter = "javascript"
# Rainbow brackets › angle: editor syntax nodes of markup tags, whose `<` `>` pair up.
[rainbow-brackets]
tags = ["JSXOpenTag", "JSXCloseTag", "JSXSelfClosingTag", "JSXFragmentTag"]
[[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
# Moving a file: the IDE asks for the import updates up front (preview, undo); the server
# doesn't prompt after the move.
[language-servers.initialization-options.typescript.updateImportsOnFileMove]
enabled = "never"
[language-servers.initialization-options.javascript.updateImportsOnFileMove]
enabled = "never"
# Inlay hints (off in vtsls by default), as in WebStorm: parameter names at literal and function
# arguments (the server sends all of them; the IDE keeps those), inferred variable and field types
# (Editor › Inlay Hints › JavaScript and TypeScript types) and enum member values.
[language-servers.initialization-options.typescript.inlayHints]
parameterNames = { enabled = "all", suppressWhenArgumentMatchesName = true }
variableTypes = { enabled = true, suppressWhenTypeMatchesName = true }
enumMemberValues = { enabled = true }
[language-servers.initialization-options.javascript.inlayHints]
parameterNames = { enabled = "all", suppressWhenArgumentMatchesName = true }
variableTypes = { enabled = true, suppressWhenTypeMatchesName = true }
enumMemberValues = { enabled = true }
[[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
# Inlay hints, as for vtsls above. Variable and field types come from the Editor switch, which
# the settings here would override.
[language-servers.settings.typescript.inlayHints]
includeInlayParameterNameHints = "all"
includeInlayParameterNameHintsWhenArgumentMatchesName = false
includeInlayVariableTypeHintsWhenTypeMatchesName = false
includeInlayEnumMemberValueHints = true
[language-servers.settings.javascript.inlayHints]
includeInlayParameterNameHints = "all"
includeInlayParameterNameHintsWhenArgumentMatchesName = false
includeInlayVariableTypeHintsWhenTypeMatchesName = false
includeInlayEnumMemberValueHints = true
[[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"
# ESLint: only below a project's ESLint configuration; the server runs the project's own eslint.
[[language-servers]]
name = "eslint"
command = "vscode-eslint-language-server"
args = ["--stdio"]
root-markers = ["eslint.config.js", "eslint.config.mjs", "eslint.config.cjs", "eslint.config.ts", "eslint.config.mts", "eslint.config.cts", ".eslintrc", ".eslintrc.js", ".eslintrc.cjs", ".eslintrc.json", ".eslintrc.yml", ".eslintrc.yaml", "package.json#eslintConfig"]
require-root-marker = true
install-hint = "npm i -g vscode-langservers-extracted"
[language-servers.settings]
# Read by every request (`experimental.useFlatConfig`); ESLint picks flat or legacy config itself.
experimental = {}
validate = "on"
run = "onType"
quiet = false
onIgnoredFiles = "off"
rulesCustomizations = []
nodePath = ""
problems = { shortenToSingleLine = false }
workingDirectory = { mode = "auto" }
codeAction = { disableRuleComment = { enable = true, location = "separateLine" }, showDocumentation = { enable = true } }
# vscode-eslint reads it for every source.fixAll request (Actions on Save, Code Cleanup).
# No `rules`: an empty list there means no rule gets fixed.
codeActionOnSave = { mode = "all" }
# Biome: lint diagnostics, quick fixes and fix-all below a Biome configuration or installation,
# from the project's own biome. Formatting is Reformat Code's (Settings › Biome).
[[language-servers]]
name = "biome"
command = "biome"
args = ["lsp-proxy"]
root-markers = ["biome.json", "biome.jsonc", "node_modules/@biomejs/biome"]
require-root-marker = true
features = ["code-action", "diagnostics"]
install-hint = "npm i -D @biomejs/biome"
# Tailwind CSS: class completion, hover and diagnostics, only in a project that uses Tailwind
# (`tailwind.config.*` or `tailwindcss` in package.json). After the language's own servers,
# which answer hover first.
[[language-servers]]
name = "tailwindcss-language-server"
command = "tailwindcss-language-server"
args = ["--stdio"]
root-markers = ["tailwind.config.*", "package.json#dependencies.tailwindcss", "package.json#devDependencies.tailwindcss"]
require-root-marker = true
install-hint = "npm i -g @tailwindcss/language-server"
[debugger]
adapter = "js-debug"
command = "js-debug-adapter"
args = ["${port}", "127.0.0.1"]
transport = "tcp"
install-hint = "Install JavaScript Debugger (vscode-js-debug) in Settings › Languages & Frameworks › Language Servers"