Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Update typescript docs (#17321)
Conrad Irwin3bdc35f1ac92
diff --git a/docs/src/languages/typescript.md b/docs/src/languages/typescript.mdindex ac36a56f6af..25f0a42b10a 100644--- a/docs/src/languages/typescript.md+++ b/docs/src/languages/typescript.md@@ -7,39 +7,82 @@ TypeScript and TSX support are available natively in Zed.- Alternate Language Server: [typescript-language-server/typescript-language-server](https://github.com/typescript-language-server/typescript-language-server)<!---TBD: Add some english prose Typescript documentation instead of starting with JSON inlayHintsTBD: Document the difference between Language servers-TBD: Add vtsls configuration instructions.-TBD: Document TSX support / configuration-->-## Inlay Hints+## Language servers-Zed sets the following initialization options for inlay hints:+By default Zed uses [vtsls](https://github.com/yioneko/vtsls) for TypeScript, TSX and JavaScript files.+You can configure the use of [typescript-language-server](https://github.com/typescript-language-server/typescript-language-server) per language in your settings file:```json-"preferences": {- "includeInlayParameterNameHints": "all",- "includeInlayParameterNameHintsWhenArgumentMatchesName": true,- "includeInlayFunctionParameterTypeHints": true,- "includeInlayVariableTypeHints": true,- "includeInlayVariableTypeHintsWhenTypeMatchesName": true,- "includeInlayPropertyDeclarationTypeHints": true,- "includeInlayFunctionLikeReturnTypeHints": true,- "includeInlayEnumMemberValueHints": true,+{+ "languages": {+ "TypeScript": {+ "language_servers": ["typescript-language-server", "!vtsls", "..."]+ },+ "TSX": {+ "language_servers": ["typescript-language-server", "!vtsls", "..."]+ },+ "JavaScript": {+ "language_servers": ["typescript-language-server", "!vtsls", "..."]+ }+ }+}+```++Prettier will also be used for TypeScript files by default. To disable this:++```jsonc+{+ "languages": {+ "TypeScript": {+ "prettier": { "allowed": false },+ },+ //...+ },}```-to make the language server send back inlay hints when Zed has them enabled in the settings.+## Large projects++`vtsls` may run out of memory on very large projects. You can configure this limit by passing the following options to the language server:++```json+{+ "lsp": {+ "vtsls": {+ "initialization_options": {+ // For TypeScript:+ "typescript": { "tsserver": { "maxTsServerMemory": 8092 } },+ // For JavaScript:+ "javascript": { "tsserver": { "maxTsServerMemory": 8092 } }+ }+ }+ }+}+```++## Inlay Hints++Zed sets the following initialization options to make the language server send back inlay hints+(when Zed has inlay hints enabled in the settings).-Use+You can override these settings in your configuration file:```json"lsp": {"$LANGUAGE_SERVER_NAME": {"initialization_options": {"preferences": {- ....+ "includeInlayParameterNameHints": "all",+ "includeInlayParameterNameHintsWhenArgumentMatchesName": true,+ "includeInlayFunctionParameterTypeHints": true,+ "includeInlayVariableTypeHints": true,+ "includeInlayVariableTypeHintsWhenTypeMatchesName": true,+ "includeInlayPropertyDeclarationTypeHints": true,+ "includeInlayFunctionLikeReturnTypeHints": true,+ "includeInlayEnumMemberValueHints": true,}}}