sublimelsp / LSP-typescript

TypeScript, JavaScript support for Sublime LSP plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LSP Typescript crashes

sirganya opened this issue · comments

Hi,

The package crashes consistently on one particular project with this error

file:///Users/gregkavanagh/Library/Caches/Sublime%20Text/Package%20Storage/LSP-typescript/16.15.0/typescript-language-server/node_modules/typescript-language-server/lib/tsServer/serverProcess.js:113
LSP-typescript:         this.reader.dispose();
LSP-typescript:                     ^
LSP-typescript: 
LSP-typescript: TypeError: Cannot read properties of null (reading 'dispose')

Init logs:

:: --> LSP-typescript initialize(1): {'workspaceFolders': [{'name': 'modules', 'uri': 'file:///Users/gregkavanagh/git/bwos/quickpoint/modules'}], 'rootUri': 'file:///Users/gregkavanagh/git/bwos/quickpoint/modules', 'clientInfo': {'name': 'Sublime Text LSP', 'version': '1.20.0'}, 'rootPath': '/Users/gregkavanagh/git/bwos/quickpoint/modules', 'capabilities': {'workspace': {'workspaceFolders': True, 'codeLens': {'refreshSupport': True}, 'symbol': {'dynamicRegistration': True, 'symbolKind': {'valueSet': [23, 12, 22, 3, 16, 17, 21, 5, 24, 10, 11, 7, 14, 15, 4, 13, 2, 20, 19, 9, 8, 6, 26, 1, 25, 18]}, 'tagSupport': {'valueSet': [1]}}, 'inlayHint': {'refreshSupport': True}, 'semanticTokens': {'refreshSupport': True}, 'workspaceEdit': {'documentChanges': True, 'failureHandling': 'abort'}, 'configuration': True, 'applyEdit': True, 'executeCommand': {}, 'didChangeConfiguration': {'dynamicRegistration': True}}, 'general': {'regularExpressions': {'engine': 'ECMAScript'}, 'markdown': {'version': '3.2.2', 'parser': 'Python-Markdown'}}, 'window': {'showDocument': {'support': True}, 'workDoneProgress': True, 'showMessage': {'messageActionItem': {'additionalPropertiesSupport': True}}}, 'textDocument': {'inlayHint': {'dynamicRegistration': True, 'resolveSupport': {'properties': ['textEdits', 'label.command']}}, 'completion': {'insertTextMode': 2, 'dynamicRegistration': True, 'completionItem': {'deprecatedSupport': True, 'snippetSupport': True, 'tagSupport': {'valueSet': [1]}, 'insertTextModeSupport': {'valueSet': [2]}, 'insertReplaceSupport': True, 'resolveSupport': {'properties': ['detail', 'documentation', 'additionalTextEdits']}, 'documentationFormat': ['markdown', 'plaintext'], 'labelDetailsSupport': True}, 'completionItemKind': {'valueSet': [22, 3, 20, 12, 16, 14, 7, 23, 8, 11, 10, 21, 18, 6, 9, 1, 13, 4, 15, 5, 2, 25, 17, 24, 19]}}, 'signatureHelp': {'contextSupport': True, 'dynamicRegistration': True, 'signatureInformation': {'parameterInformation': {'labelOffsetSupport': True}, 'activeParameterSupport': True, 'documentationFormat': ['markdown', 'plaintext']}}, 'hover': {'dynamicRegistration': True, 'contentFormat': ['markdown', 'plaintext']}, 'semanticTokens': {'tokenTypes': ['struct', 'variable', 'function', 'enumMember', 'namespace', 'number', 'parameter', 'event', 'comment', 'class', 'interface', 'regexp', 'property', 'string', 'keyword', 'decorator', 'macro', 'enum', 'type', 'method', 'typeParameter', 'operator', 'modifier'], 'multilineTokenSupport': True, 'formats': ['relative'], 'tokenModifiers': ['definition', 'deprecated', 'abstract', 'documentation', 'static', 'defaultLibrary', 'declaration', 'readonly', 'modification', 'async'], 'overlappingTokenSupport': False, 'dynamicRegistration': True, 'augmentsSyntaxTokens': True, 'requests': {'range': True, 'full': {'delta': True}}}, 'synchronization': {'willSaveWaitUntil': True, 'dynamicRegistration': True, 'willSave': True, 'didSave': True}, 'rangeFormatting': {'dynamicRegistration': True}, 'documentHighlight': {'dynamicRegistration': True}, 'documentSymbol': {'hierarchicalDocumentSymbolSupport': True, 'dynamicRegistration': True, 'symbolKind': {'valueSet': [23, 12, 22, 3, 16, 17, 21, 5, 24, 10, 11, 7, 14, 15, 4, 13, 2, 20, 19, 9, 8, 6, 26, 1, 25, 18]}, 'tagSupport': {'valueSet': [1]}}, 'formatting': {'dynamicRegistration': True}, 'rename': {'prepareSupport': True, 'dynamicRegistration': True}, 'declaration': {'linkSupport': True, 'dynamicRegistration': True}, 'selectionRange': {'dynamicRegistration': True}, 'definition': {'linkSupport': True, 'dynamicRegistration': True}, 'typeDefinition': {'linkSupport': True, 'dynamicRegistration': True}, 'codeAction': {'dynamicRegistration': True, 'isPreferredSupport': True, 'resolveSupport': {'properties': ['edit']}, 'dataSupport': True, 'codeActionLiteralSupport': {'codeActionKind': {'valueSet': ['quickfix', 'refactor', 'refactor.extract', 'refactor.inline', 'refactor.rewrite', 'source.fixAll', 'source.organizeImports']}}, 'disabledSupport': True}, 'implementation': {'linkSupport': True, 'dynamicRegistration': True}, 'references': {'dynamicRegistration': True}, 'documentLink': {'tooltipSupport': True, 'dynamicRegistration': True}, 'codeLens': {'dynamicRegistration': True}, 'colorProvider': {'dynamicRegistration': True}, 'publishDiagnostics': {'dataSupport': True, 'relatedInformation': True, 'tagSupport': {'valueSet': [2, 1]}, 'codeDescriptionSupport': True, 'versionSupport': True}}}, 'initializationOptions': {'maxTsServerMemory': 0, 'preferences': {'includeCompletionsWithSnippetText': True, 'allowTextChangesInNewFiles': True, 'displayPartsForJSDoc': True, 'useLabelDetailsInCompletionEntries': True, 'includeCompletionsWithClassMemberSnippets': True, 'includeCompletionsWithInsertText': True, 'providePrefixAndSuffixTextForRename': True, 'jsxAttributeCompletionStyle': 'auto', 'includeCompletionsForModuleExports': True, 'includeCompletionsWithObjectLiteralMethodSnippets': True, 'allowRenameOfImportPath': True, 'allowIncompleteCompletions': True, 'generateReturnInDocTemplate': True, 'includeAutomaticOptionalChainCompletions': True, 'autoImportFileExcludePatterns': [], 'includeCompletionsForImportStatements': True}, 'tsserver': {'logVerbosity': 'off', 'trace': 'off', 'logDirectory': '', 'path': ''}, 'plugins': [], 'npmLocation': '', 'locale': 'en'}, 'processId': 23605}
  • What version of typescript is being used in that project (assuming that it's installed as a dependency)?
  • It's possible that the server runs out of memory. You could try settings initializationOptions.maxTsServerMemory to 4096 for example.

You could also set initializationOptions.tsserver.logVerbosity to "verbose" which would create a log file in .log directory within the project and that would possibly provide more useful information.

The project uses Yarn PnP and I had just moved to a a monorepo using Yarn workspaces. To fix the issue I had to create and SDK package at the root of the monorepo

https://yarnpkg.com/getting-started/editor-sdks