diff --git a/LSP-typescript.sublime-settings b/LSP-typescript.sublime-settings index de81e6a..55a5538 100644 --- a/LSP-typescript.sublime-settings +++ b/LSP-typescript.sublime-settings @@ -5,10 +5,16 @@ "maxTsServerMemory": 0, "plugins": [], "preferences": { + "allowIncompleteCompletions": true, "allowRenameOfImportPath": true, + "allowTextChangesInNewFiles": true, + "displayPartsForJSDoc": true, + "generateReturnInDocTemplate": true, + "includeAutomaticOptionalChainCompletions": true, "includeCompletionsForImportStatements": true, "includeCompletionsForModuleExports": true, "includeCompletionsWithInsertText": true, + "includeCompletionsWithSnippetText": true, }, }, "settings": { diff --git a/README.md b/README.md index 17eda29..e323ad1 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # LSP-typescript -TypeScript and JavaScript support for Sublime's LSP plugin provided through [Theia TypeScript Language Server](https://github.com/theia-ide/typescript-language-server). +TypeScript and JavaScript support for Sublime's LSP plugin provided through [Theia TypeScript Language Server](https://github.com/typescript-language-server/typescript-language-server). ## Installation * Install [`LSP`](https://packagecontrol.io/packages/LSP) and `LSP-typescript` from Package Control. - * 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). * For ST4: The TypeScript and React (TSX) syntaxes are built-in so no need to install anything else. + * 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). * Restart Sublime. ## Configuration diff --git a/plugin.py b/plugin.py index 4f79b5d..d375052 100644 --- a/plugin.py +++ b/plugin.py @@ -1,9 +1,7 @@ from .protocol import InlayHint, InlayHintRequestParams, InlayHintResponse from html import escape as html_escape -from LSP.plugin import ClientConfig from LSP.plugin import SessionBufferProtocol from LSP.plugin import uri_to_filename -from LSP.plugin import WorkspaceFolder from LSP.plugin.core.protocol import Point from LSP.plugin.core.typing import Any, Callable, List, Optional from LSP.plugin.core.views import point_to_offset @@ -52,17 +50,6 @@ class LspTypescriptPlugin(NpmClientHandler): server_directory = 'typescript-language-server' server_binary_path = os.path.join(server_directory, 'node_modules', 'typescript-language-server', 'lib', 'cli.js') - @classmethod - def is_allowed_to_start( - cls, - window: sublime.Window, - initiating_view: Optional[sublime.View] = None, - workspace_folders: Optional[List[WorkspaceFolder]] = None, - configuration: Optional[ClientConfig] = None - ) -> Optional[str]: - if not workspace_folders: - return 'This server only works when the window workspace includes some folders!' - def __init__(self, *args: Any, **kwargs: Any) -> None: self._api = None # type: Optional[ApiWrapperInterface] super().__init__(*args, **kwargs) diff --git a/sublime-package.json b/sublime-package.json index 8769fed..f670115 100644 --- a/sublime-package.json +++ b/sublime-package.json @@ -18,6 +18,11 @@ "type": "string", "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." }, + "disableAutomaticTypingAcquisition": { + "type": "boolean", + "default": false, + "markdownDescription": "Disables tsserver from automatically fetching missing type definitions (`@types` packages) for external modules." + }, "logVerbosity": { "enum": [ "off", @@ -60,6 +65,11 @@ "preferences": { "type": "object", "properties": { + "allowIncompleteCompletions": { + "type": "boolean", + "default": true, + "markdownDescription": "Allows import module names to be resolved in the initial completions request." + }, "disableSuggestions": { "type": "boolean", },