Skip to content

Commit

Permalink
Update for the latest server version (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
rchl authored Jan 7, 2022
1 parent f91be71 commit 563dbdc
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 34 deletions.
36 changes: 2 additions & 34 deletions LSP-typescript.sublime-settings
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"command": ["${node_bin}", "${server_path}", "--stdio"],
"initializationOptions": {
"logVerbosity": "off",
"maxTsServerMemory": 0,
Expand All @@ -14,6 +13,7 @@
"includeAutomaticOptionalChainCompletions": true,
"includeCompletionsForImportStatements": true,
"includeCompletionsForModuleExports": true,
"includeCompletionsWithClassMemberSnippets": true,
"includeCompletionsWithInsertText": true,
"includeCompletionsWithSnippetText": true,
"jsxAttributeCompletionStyle": "auto"
Expand Down Expand Up @@ -78,38 +78,6 @@
"typescript.inlayHints.includeInlayPropertyDeclarationTypeHints": false,
"typescript.inlayHints.includeInlayVariableTypeHints": false,
},
// ST4 configuration
"command": ["${node_bin}", "${server_path}", "--stdio"],
"selector": "source.js, source.jsx, source.ts, source.tsx",
// ST3 configuration
"languages": [
{
"languageId": "javascriptreact",
"scopes": ["source.jsx", "source.js.react"],
"syntaxes": [
"Packages/User/JS Custom/Syntaxes/React.sublime-syntax",
],
},
{
"languageId": "javascript",
"scopes": ["source.js"],
"syntaxes": [
"Packages/JavaScript/JavaScript.sublime-syntax",
"Packages/Babel/JavaScript (Babel).sublime-syntax",
],
},
{
"languageId": "typescriptreact",
"scopes": ["source.tsx"],
"syntaxes": [
"Packages/TypeScript Syntax/TypeScriptReact.tmLanguage",
],
},
{
"languageId": "typescript",
"scopes": ["source.ts"],
"syntaxes": [
"Packages/TypeScript Syntax/TypeScript.tmLanguage",
],
},
],
}
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ To sort or remove unused imports you can trigger the `LSP-typescript: Organize I
},
```

## Code Actions on Save

Server supports the following code actions that can be specified in the global `lsp_code_actions_on_save` setting and run on saving files:

- `source.addMissingImports.ts` - adds imports for used but not imported symbols
- `source.fixAll.ts` - despite the name, fixes a couple of specific issues: unreachable code, await in non-async functions, incorrectly implemented interface
- `source.removeUnused.ts` - removes declared but unused variables
- `source.organizeImports.ts` - organizes and removes unused imports

## Find Callers command

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.
Expand Down
4 changes: 4 additions & 0 deletions sublime-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@
"type": "boolean",
"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 `?.`."
},
"includeCompletionsWithClassMemberSnippets": {
"type": "boolean",
"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+."
},
"importModuleSpecifierPreference": {
"enum": [
"shortest",
Expand Down

0 comments on commit 563dbdc

Please sign in to comment.