дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-27 21:12:34 +02:00
Go to Declaration, completion, Find Usages and Rename for CSS Module class names between TS/JSX and *.module.css, through the CSS Modules Kit tsserver plugin on vtsls. The plugin is an IDE-managed tool pinned to @css-modules-kit/[email protected]; a project turns it on with "cmkOptions": { "enabled": true } in tsconfig.json (also inherited through a local extends), which the editor offers to add, installing the plugin if needed. CSS files reach vtsls only once the plugin is installed; references from a selector drop the CSS server's own rule, and rename takes vtsls' edit so the selector keeps its dot. CSS Modules Kit loads before the Vue tsserver plugin outside a Vue project: both are Volar plugins sharing one @volar/typescript, which decorates a project once, so with the Vue language server installed the Vue plugin had claimed every vtsls and CSS Modules Kit did nothing. Closes #6071 Co-authored-by: wildcatDownstairs <[email protected]>
97 рядки
4.5 KiB
TOML
97 рядки
4.5 KiB
TOML
id = "css"
|
||
name = "CSS"
|
||
formatter = { tool = "prettier", parser = "css", range = false }
|
||
extensions = ["css", "pcss", "postcss"]
|
||
block-comment = ["/*", "*/"]
|
||
indent = { tab-size = 2, insert-spaces = true }
|
||
ui-mode = "CSS"
|
||
tree-sitter = "css"
|
||
|
||
[[language-servers]]
|
||
name = "vscode-css-language-server"
|
||
command = "vscode-css-language-server"
|
||
args = ["--stdio"]
|
||
initialization-options = { provideFormatter = true, css = {}, scss = {}, less = {} }
|
||
install-hint = "npm i -g vscode-langservers-extracted"
|
||
|
||
# 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"
|
||
|
||
# Stylelint: only below a project's Stylelint configuration; the server runs the project's own
|
||
# stylelint. Diagnostics, quick fixes and fix-all (Code Cleanup, Actions on Save) only: the
|
||
# server's formatting applies the same fixes, and Reformat Code stays the formatter's.
|
||
[[language-servers]]
|
||
name = "stylelint"
|
||
command = "stylelint-language-server"
|
||
args = ["--stdio"]
|
||
root-markers = [".stylelintrc", ".stylelintrc.json", ".stylelintrc.yaml", ".stylelintrc.yml", ".stylelintrc.js", ".stylelintrc.cjs", ".stylelintrc.mjs", ".stylelintrc.ts", ".stylelintrc.cts", ".stylelintrc.mts", "stylelint.config.js", "stylelint.config.cjs", "stylelint.config.mjs", "stylelint.config.ts", "stylelint.config.cts", "stylelint.config.mts", "package.json#stylelint"]
|
||
require-root-marker = true
|
||
features = ["code-action", "diagnostics"]
|
||
install-hint = "npm i -g @stylelint/language-server"
|
||
|
||
# Read as section `stylelint`: the languages it lints (its default is CSS only).
|
||
[language-servers.settings]
|
||
validate = ["css", "scss", "less"]
|
||
snippet = ["css", "scss", "less"]
|
||
|
||
# CSS Modules (`*.module.css`): vtsls with the CSS Modules Kit tsserver plugin serves the class
|
||
# names (definition, references, rename to and from TS/JSX), only below a tsconfig.json that
|
||
# sets `"cmkOptions": { "enabled": true }` and once the plugin is installed (the IDE hides this
|
||
# server until then). The same definition as TypeScript's: a project's CSS and TS files share
|
||
# one vtsls when the tsconfig is at that server's root.
|
||
# ponytail: a tsconfig below the TS root (a monorepo package) gets a vtsls of its own for CSS.
|
||
[[language-servers]]
|
||
name = "vtsls"
|
||
tsserver-project = true
|
||
command = "vtsls"
|
||
args = ["--stdio"]
|
||
root-markers = ["tsconfig.json#cmkOptions.enabled"]
|
||
require-root-marker = true
|
||
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): parameter names at literal arguments, inferred
|
||
# variable types and enum member values. Editor › Inlay Hints decides which are shown.
|
||
[language-servers.initialization-options.typescript.inlayHints]
|
||
parameterNames = { enabled = "literals", suppressWhenArgumentMatchesName = true }
|
||
variableTypes = { enabled = true, suppressWhenTypeMatchesName = true }
|
||
enumMemberValues = { enabled = true }
|
||
|
||
[language-servers.initialization-options.javascript.inlayHints]
|
||
parameterNames = { enabled = "literals", suppressWhenArgumentMatchesName = true }
|
||
variableTypes = { enabled = true, suppressWhenTypeMatchesName = true }
|
||
enumMemberValues = { enabled = true }
|
||
|
||
# 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"
|