Skip to content

Commit eef4b77

Browse files
authored
Updates to align with version 0.7.0 of the server (#103)
1 parent d0b950d commit eef4b77

File tree

4 files changed

+18
-15
lines changed

4 files changed

+18
-15
lines changed

LSP-typescript.sublime-settings

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,16 @@
55
"maxTsServerMemory": 0,
66
"plugins": [],
77
"preferences": {
8+
"allowIncompleteCompletions": true,
89
"allowRenameOfImportPath": true,
10+
"allowTextChangesInNewFiles": true,
11+
"displayPartsForJSDoc": true,
12+
"generateReturnInDocTemplate": true,
13+
"includeAutomaticOptionalChainCompletions": true,
914
"includeCompletionsForImportStatements": true,
1015
"includeCompletionsForModuleExports": true,
1116
"includeCompletionsWithInsertText": true,
17+
"includeCompletionsWithSnippetText": true,
1218
},
1319
},
1420
"settings": {

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# LSP-typescript
22

3-
TypeScript and JavaScript support for Sublime's LSP plugin provided through [Theia TypeScript Language Server](https://github.com/theia-ide/typescript-language-server).
3+
TypeScript and JavaScript support for Sublime's LSP plugin provided through [Theia TypeScript Language Server](https://github.com/typescript-language-server/typescript-language-server).
44

55
## Installation
66

77
* Install [`LSP`](https://packagecontrol.io/packages/LSP) and `LSP-typescript` from Package Control.
8-
* For ST3: If you use TypeScript install [TypeScript Syntax](https://packagecontrol.io/packages/TypeScript%20Syntax). If you use React install [JSCustom](https://packagecontrol.io/packages/JSCustom).
98
* For ST4: The TypeScript and React (TSX) syntaxes are built-in so no need to install anything else.
9+
* For ST3: If you are working with TypeScript install [TypeScript Syntax](https://packagecontrol.io/packages/TypeScript%20Syntax). If you are working with React install [JSCustom](https://packagecontrol.io/packages/JSCustom).
1010
* Restart Sublime.
1111

1212
## Configuration

plugin.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
from .protocol import InlayHint, InlayHintRequestParams, InlayHintResponse
22
from html import escape as html_escape
3-
from LSP.plugin import ClientConfig
43
from LSP.plugin import SessionBufferProtocol
54
from LSP.plugin import uri_to_filename
6-
from LSP.plugin import WorkspaceFolder
75
from LSP.plugin.core.protocol import Point
86
from LSP.plugin.core.typing import Any, Callable, List, Optional
97
from LSP.plugin.core.views import point_to_offset
@@ -52,17 +50,6 @@ class LspTypescriptPlugin(NpmClientHandler):
5250
server_directory = 'typescript-language-server'
5351
server_binary_path = os.path.join(server_directory, 'node_modules', 'typescript-language-server', 'lib', 'cli.js')
5452

55-
@classmethod
56-
def is_allowed_to_start(
57-
cls,
58-
window: sublime.Window,
59-
initiating_view: Optional[sublime.View] = None,
60-
workspace_folders: Optional[List[WorkspaceFolder]] = None,
61-
configuration: Optional[ClientConfig] = None
62-
) -> Optional[str]:
63-
if not workspace_folders:
64-
return 'This server only works when the window workspace includes some folders!'
65-
6653
def __init__(self, *args: Any, **kwargs: Any) -> None:
6754
self._api = None # type: Optional[ApiWrapperInterface]
6855
super().__init__(*args, **kwargs)

sublime-package.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818
"type": "string",
1919
"markdownDescription": "Information about the host, for example `Emacs 24.4` or `Sublime Text version 3075`. This value is only relevant when using `yarn pnp` which might apply special logic for certain values."
2020
},
21+
"disableAutomaticTypingAcquisition": {
22+
"type": "boolean",
23+
"default": false,
24+
"markdownDescription": "Disables tsserver from automatically fetching missing type definitions (`@types` packages) for external modules."
25+
},
2126
"logVerbosity": {
2227
"enum": [
2328
"off",
@@ -60,6 +65,11 @@
6065
"preferences": {
6166
"type": "object",
6267
"properties": {
68+
"allowIncompleteCompletions": {
69+
"type": "boolean",
70+
"default": true,
71+
"markdownDescription": "Allows import module names to be resolved in the initial completions request."
72+
},
6373
"disableSuggestions": {
6474
"type": "boolean",
6575
},

0 commit comments

Comments
 (0)