Файли
Jaw 352efc02a7 feat(angular): highlight inline templates and auto-close tags (#1897)
Angular component templates in @Component({ template }) were parsed as TypeScript strings, so template highlighting and tag closing never applied. TypeScript files in Angular projects (angular.json or @angular/core) now use an Angular TypeScript mode that mounts the Angular template parser on literal template strings; other strings and non-Angular projects are unchanged. Inline and external templates both close tags on /, with multiple cursors and undo.

Closes #1895

Co-authored-by: jaw52 <[email protected]>
2026-11-07 11:13:09 +08:00

77 рядки
2.7 KiB
TOML
Неформатований Постійне посилання Анотація Історія

Цей файл містить неоднозначні символи Юнікоду
Цей файл містить символи Юнікоду, які можна сплутати з іншими символами. Якщо ви вважаєте, що це зроблено навмисно, можете сміливо ігнорувати це попередження. Щоб показати їх, скористайтеся кнопкою Escape.
id = "typescript"
name = "TypeScript"
formatter = { tool = "prettier", parser = "typescript", range = true }
extensions = ["ts", "mts", "cts"]
line-comment = "//"
block-comment = ["/*", "*/"]
indent = { tab-size = 2, insert-spaces = true }
ui-mode = "TypeScript"
tree-sitter = "typescript"
[[framework-ui-modes]]
ui-mode = "Angular TypeScript"
root-markers = ["angular.json", "node_modules/@angular/core"]
[[language-servers]]
name = "vtsls"
tsserver-project = true
command = "vtsls"
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
# 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"
[[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 = ["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.
[[language-servers]]
name = "angular-language-server"
command = "ngserver"
args = ["--stdio", "--includeCompletionsWithSnippetText", "--includeAutomaticOptionalChainCompletions"]
root-markers = ["angular.json", "node_modules/@angular/core"]
require-root-marker = true
install-hint = "npm i -g @angular/language-server"
[[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 JavaScript Debugger (vscode-js-debug) in Settings › Languages & Frameworks › Language Servers"