Skip to content

Commit

Permalink
Updates to align with version 0.7.0 of the server (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
rchl authored Nov 10, 2021
1 parent d0b950d commit eef4b77
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 15 deletions.
6 changes: 6 additions & 0 deletions LSP-typescript.sublime-settings
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
13 changes: 0 additions & 13 deletions plugin.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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)
Expand Down
10 changes: 10 additions & 0 deletions sublime-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
},
Expand Down

0 comments on commit eef4b77

Please sign in to comment.