Skip to content

Commit 563dbdc

Browse files
authored
Update for the latest server version (#122)
1 parent f91be71 commit 563dbdc

File tree

3 files changed

+15
-34
lines changed

3 files changed

+15
-34
lines changed

LSP-typescript.sublime-settings

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"command": ["${node_bin}", "${server_path}", "--stdio"],
32
"initializationOptions": {
43
"logVerbosity": "off",
54
"maxTsServerMemory": 0,
@@ -14,6 +13,7 @@
1413
"includeAutomaticOptionalChainCompletions": true,
1514
"includeCompletionsForImportStatements": true,
1615
"includeCompletionsForModuleExports": true,
16+
"includeCompletionsWithClassMemberSnippets": true,
1717
"includeCompletionsWithInsertText": true,
1818
"includeCompletionsWithSnippetText": true,
1919
"jsxAttributeCompletionStyle": "auto"
@@ -78,38 +78,6 @@
7878
"typescript.inlayHints.includeInlayPropertyDeclarationTypeHints": false,
7979
"typescript.inlayHints.includeInlayVariableTypeHints": false,
8080
},
81-
// ST4 configuration
81+
"command": ["${node_bin}", "${server_path}", "--stdio"],
8282
"selector": "source.js, source.jsx, source.ts, source.tsx",
83-
// ST3 configuration
84-
"languages": [
85-
{
86-
"languageId": "javascriptreact",
87-
"scopes": ["source.jsx", "source.js.react"],
88-
"syntaxes": [
89-
"Packages/User/JS Custom/Syntaxes/React.sublime-syntax",
90-
],
91-
},
92-
{
93-
"languageId": "javascript",
94-
"scopes": ["source.js"],
95-
"syntaxes": [
96-
"Packages/JavaScript/JavaScript.sublime-syntax",
97-
"Packages/Babel/JavaScript (Babel).sublime-syntax",
98-
],
99-
},
100-
{
101-
"languageId": "typescriptreact",
102-
"scopes": ["source.tsx"],
103-
"syntaxes": [
104-
"Packages/TypeScript Syntax/TypeScriptReact.tmLanguage",
105-
],
106-
},
107-
{
108-
"languageId": "typescript",
109-
"scopes": ["source.ts"],
110-
"syntaxes": [
111-
"Packages/TypeScript Syntax/TypeScript.tmLanguage",
112-
],
113-
},
114-
],
11583
}

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,15 @@ To sort or remove unused imports you can trigger the `LSP-typescript: Organize I
2727
},
2828
```
2929

30+
## Code Actions on Save
31+
32+
Server supports the following code actions that can be specified in the global `lsp_code_actions_on_save` setting and run on saving files:
33+
34+
- `source.addMissingImports.ts` - adds imports for used but not imported symbols
35+
- `source.fixAll.ts` - despite the name, fixes a couple of specific issues: unreachable code, await in non-async functions, incorrectly implemented interface
36+
- `source.removeUnused.ts` - removes declared but unused variables
37+
- `source.organizeImports.ts` - organizes and removes unused imports
38+
3039
## Find Callers command
3140

3241
The `LSP-typescript: Find Callers` command can be used to find what is calling the given symbol. It has some overlap with the built-in `LSP: Find References` command but returns only the places where the symbol was called.

sublime-package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@
104104
"type": "boolean",
105105
"markdownDescription": "Unless this option is `false`, or `includeCompletionsWithInsertText` is not enabled, member completion lists triggered with `.` will include entries on potentially-null and potentially-undefined values, with insertion text to replace preceding `.` tokens with `?.`."
106106
},
107+
"includeCompletionsWithClassMemberSnippets": {
108+
"type": "boolean",
109+
"markdownDescription": "If enabled, completions for class members (e.g. methods and properties) will include a whole declaration for the member. E.g., `class A { f| }` could be completed to `class A { foo(): number {} }`, instead of `class A { foo }`.\n\nRequires TypeScript 4.5+."
110+
},
107111
"importModuleSpecifierPreference": {
108112
"enum": [
109113
"shortest",

0 commit comments

Comments
 (0)