sublimelsp / LSP-volar

Vue support for Sublime's LSP plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LSP-volar dosn't work with the bundled volar npm dependecy

predragnikolic opened this issue · comments

I have the volar server installed via npm and the server is located at this location:
/home/predragnikolic/.cache/sublime-text/Package Storage/LSP-volar/14.17.1/server/node_modules/@volar/server/out/index.js

And I have the volar repo(commit hash fe38e6f448ff55e6364e3bae868c31a29f851c66) cloned and compiled locally, with the compiled server path at /home/predragnikolic/Documents/sandbox/volar/packages/server/out/index.js

if I start the volar server which was installed via npm dependecy:

{
	"command": ["${node_bin}", "/home/predragnikolic/.cache/sublime-text/Package Storage/LSP-volar/14.17.1/server/node_modules/@volar/server/out/index.js", "--stdio"],
}

LSP-volar wont register any capability dynamically, and won't provide any intellisense.

if I start my locally cloned volar server:

{
	"command": ["${node_bin}", "/home/predragnikolic/Documents/sandbox/volar/packages/server/out/index.js", "--stdio"],
}

LSP-volar will register capability dynamically, and it will provide intellisense.

Ok found the cause why the npm volar doesn't work.

Here is the difference between the npm volar and the cloned volar repo:
npm volar:

$  pwd
/home/predragnikolic/.cache/sublime-text/Package Storage/LSP-volar/14.17.1/server/node_modules/@volar/server
$  ls
LICENSE  out  package.json

cloned volar:

$ pwd
/home/predragnikolic/Documents/sandbox/volar/packages/server
$  ls
LICENSE  node_modules  out  package.json  src  tsconfig.build.json  tsconfig.build.tsbuildinfo

The difference is that the npm volar is missing the node_modules folder inside @volar/server
Once I run npm i inside the /home/predragnikolic/.cache/sublime-text/Package Storage/LSP-volar/14.17.1/server/node_modules/@volar/server directory, the npm volar version starts working agian.

lsp_utils logs the output of npm install to sublimes console. Should provide a clue on what's going on

I do not think that this is a lsp_utils issue.

lsp_utils correctly installs the volar npm package.

{
  "name": "sublime-volar",
  "version": "0.0.0",
  "dependencies": {
    "@volar/server": "^0.27.7"
  }
}

The deal is that the volar package itself has a folder inside of it .../Package Storage/LSP-volar/14.17.1/server/node_modules/@volar/server/ that also has a package.json.
And those dependencies also needs to be installed in order for the server to work.

image

Shouldn't the volar dependency ship with all that is required for the dependecy to work?

To simply explaining the issue:
This is the same as installing npm i eslint,
and then manually going into eslint folder in node_modules
and then running npm i inside to make sure that dependency for that package are installed.

I am now looking at the package.json file for the volar dep,
to see if there is away to tell npm to bundle those dependencies in the final output directory...
I have never published a npm package, so I clearly still don't know where to look or do... I guess someone with more experience could tell what is wrong. :)

npm i automatically also installs sub-dependencies. The only thing is that it might hoist those to the root node_modules directory if it decides to de-duplicate dependencies used by multiple packages. That shouldn't affect the behavior as long as the packages use standard "require" to import dependencies. Maybe volar does some custom logic that breaks when the sub-dependencies are hoisted to the root node_modules...

I should also add that lsp_utils runs npm i with --production flag. So if dependencies are not set up correctly regarding dependencies/devDependencies then that could result in missing dependencies.

With all that said, the server appears to more or less work for me. I've tried it on a Vue 2 (Nuxt 2) project so I don't expect it work fully correctly but it appears to work at least:

:: --> LSP-volar initialize(1): {'workspaceFolders': [{'uri': 'file:///Users/rafal/workspace/web/project', 'name': 'project'}], 'processId': 41106, 'clientInfo': {'name': 'Sublime Text LSP', 'version': '1.9.0'}, 'initializationOptions': {'languageFeatures': {'documentHighlight': True, 'rename': True, 'diagnostics': True, 'codeLens': False, 'references': True, 'schemaRequestService': False, 'signatureHelp': True, 'definition': True, 'completion': {'defaultAttrNameCase': 'kebab', 'getDocumentSelectionRequest': False, 'getDocumentNameCasesRequest': False, 'defaultTagNameCase': 'both'}, 'typeDefinition': True, 'documentLink': False, 'renameFileRefactoring': False, 'callHierarchy': False, 'codeAction': True, 'semanticTokens': False, 'hover': True}, 'documentFeatures': {'documentColor': True, 'linkedEditingRange': False, 'foldingRange': True, 'documentFormatting': {'defaultPrintWidth': 90}, 'documentSymbol': True, 'selectionRange': True}, 'typescript': {'serverPath': '/Users/rafal/workspace/web/project/node_modules/typescript/lib/tsserver.js'}}, 'capabilities': {'textDocument': {'documentHighlight': {'dynamicRegistration': True}, 'rename': {'prepareSupport': True, 'dynamicRegistration': True}, 'synchronization': {'didSave': True, 'dynamicRegistration': True, 'willSave': True, 'willSaveWaitUntil': True}, 'codeLens': {'dynamicRegistration': True}, 'implementation': {'linkSupport': True, 'dynamicRegistration': True}, 'references': {'dynamicRegistration': True}, 'selectionRange': {'dynamicRegistration': True}, 'didChangeWatchedFiles': {'dynamicRegistration': True}, 'colorProvider': {'dynamicRegistration': True}, 'definition': {'linkSupport': True, 'dynamicRegistration': True}, 'signatureHelp': {'dynamicRegistration': True, 'signatureInformation': {'parameterInformation': {'labelOffsetSupport': True}, 'documentationFormat': ['markdown', 'plaintext']}}, 'declaration': {'linkSupport': True, 'dynamicRegistration': True}, 'publishDiagnostics': {'dataSupport': True, 'codeDescriptionSupport': True, 'relatedInformation': True, 'versionSupport': True, 'tagSupport': {'valueSet': [2, 1]}}, 'completion': {'completionItemKind': {'valueSet': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]}, 'insertTextMode': 2, 'dynamicRegistration': True, 'completionItem': {'resolveSupport': {'properties': ['detail', 'documentation', 'additionalTextEdits']}, 'snippetSupport': True, 'tagSupport': {'valueSet': [1]}, 'labelDetailsSupport': True, 'documentationFormat': ['markdown', 'plaintext'], 'deprecatedSupport': True, 'insertTextModeSupport': {'valueSet': [2]}}}, 'typeDefinition': {'linkSupport': True, 'dynamicRegistration': True}, 'formatting': {'dynamicRegistration': True}, 'rangeFormatting': {'dynamicRegistration': True}, 'documentSymbol': {'hierarchicalDocumentSymbolSupport': True, 'symbolKind': {'valueSet': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]}, 'dynamicRegistration': True, 'tagSupport': {'valueSet': [1]}}, 'codeAction': {'resolveSupport': {'properties': ['edit']}, 'dynamicRegistration': True, 'codeActionLiteralSupport': {'codeActionKind': {'valueSet': ['quickfix', 'refactor', 'refactor.extract', 'refactor.inline', 'refactor.rewrite', 'source.organizeImports']}}, 'dataSupport': True}, 'hover': {'dynamicRegistration': True, 'contentFormat': ['markdown', 'plaintext']}}, 'experimental': {}, 'general': {'markdown': {'parser': 'Python-Markdown', 'version': '3.2.2'}, 'regularExpressions': {'engine': 'ECMAScript'}}, 'window': {'workDoneProgress': True, 'showDocument': {'support': True}, 'showMessage': {'messageActionItem': {'additionalPropertiesSupport': True}}}, 'workspace': {'executeCommand': {}, 'applyEdit': True, 'configuration': True, 'workspaceEdit': {'failureHandling': 'abort', 'documentChanges': True}, 'symbol': {'symbolKind': {'valueSet': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]}, 'dynamicRegistration': True, 'tagSupport': {'valueSet': [1]}}, 'workspaceFolders': True, 'didChangeConfiguration': {'dynamicRegistration': True}}}, 'rootUri': 'file:///Users/rafal/workspace/web/project', 'rootPath': '/Users/rafal/workspace/web/project'}
:: <<< LSP-volar 1: {'capabilities': {'textDocumentSync': {'didOpen': {}, 'save': {}, 'didClose': {}, 'change': {'syncKind': 2}}}}
::  -> LSP-volar initialized: {}
::  -> LSP-volar textDocument/didOpen: {'textDocument': {'uri': 'file:///Users/rafal/workspace/web/project/app/pages/subscription/cancel.vue', 'text': '...', 'languageId': 'vue', 'version': 0}}
:: <-- LSP-volar workspace/configuration(0): {'items': [{'section': 'js/ts.implicitProjectConfig'}, {'section': 'javascript.implicitProjectConfig'}]}
:: >>> LSP-volar 0: [None, None]
:: <-- LSP-volar window/workDoneProgress/create(1): {'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: >>> LSP-volar 1: None
:: <-- LSP-volar window/workDoneProgress/create(2): {'token': '995761ca-9d2a-477c-9534-bc1eccc3ae57'}
:: >>> LSP-volar 2: None
:: <-- LSP-volar client/registerCapability(3): {'registrations': [{'registerOptions': {'documentSelector': [{'language': 'vue', 'scheme': 'file'}]}, 'method': 'textDocument/references', 'id': 'f9f2a289-482f-42cd-ab54-f76b64ab8418'}]}
:: >>> LSP-volar 3: None
:: <-- LSP-volar client/registerCapability(4): {'registrations': [{'registerOptions': {'documentSelector': [{'language': 'vue', 'scheme': 'file'}]}, 'method': 'textDocument/definition', 'id': '0e96d919-7b81-4657-9daa-b63671f2e7b6'}]}
:: >>> LSP-volar 4: None
:: <-- LSP-volar client/registerCapability(5): {'registrations': [{'registerOptions': {'documentSelector': [{'language': 'vue', 'scheme': 'file'}]}, 'method': 'textDocument/typeDefinition', 'id': '7b8d216a-6d36-4f68-b87f-f122b34864f7'}]}
:: >>> LSP-volar 5: None
:: <-- LSP-volar client/registerCapability(6): {'registrations': [{'registerOptions': {'documentSelector': [{'language': 'vue', 'scheme': 'file'}]}, 'method': 'textDocument/hover', 'id': '04e004f6-099a-48b1-a4fa-ed169dfaa3cd'}]}
:: >>> LSP-volar 6: None
:: <-- LSP-volar client/registerCapability(7): {'registrations': [{'registerOptions': {'prepareProvider': True, 'documentSelector': [{'language': 'vue', 'scheme': 'file'}]}, 'method': 'textDocument/rename', 'id': '163ef21c-dfa4-4bbf-8328-346f6f8b9b77'}]}
:: >>> LSP-volar 7: None
:: <-- LSP-volar client/registerCapability(8): {'registrations': [{'registerOptions': {'retriggerCharacters': [')'], 'triggerCharacters': ['(', ',', '<'], 'documentSelector': [{'language': 'vue', 'scheme': 'file'}]}, 'method': 'textDocument/signatureHelp', 'id': 'b1db8ada-67bc-40b8-9fdc-0ff16321ed83'}]}
:: >>> LSP-volar 8: None
:: <-- LSP-volar client/registerCapability(9): {'registrations': [{'registerOptions': {'resolveProvider': True, 'triggerCharacters': ['.', '"', "'", '`', '/', '@', '<', '#', '<', ':', '@', '.', '/', '.', '@', '/', '"', ':'], 'documentSelector': [{'language': 'vue', 'scheme': 'file'}]}, 'method': 'textDocument/completion', 'id': '6417e2ed-701d-44b1-8b66-0a7a109a5270'}]}
:: >>> LSP-volar 9: None
:: <-- LSP-volar client/registerCapability(10): {'registrations': [{'registerOptions': {'commands': ['volar.server.executeConvertToKebabCase', 'volar.server.executeConvertToPascalCase']}, 'method': 'workspace/executeCommand', 'id': '6d5e3a8f-ca65-4793-90bb-29866b986237'}]}
:: >>> LSP-volar 10: None
:: <-- LSP-volar client/registerCapability(11): {'registrations': [{'registerOptions': {'documentSelector': [{'language': 'vue', 'scheme': 'file'}]}, 'method': 'textDocument/documentHighlight', 'id': '37386cce-6e23-4542-9c49-cab3b3e508a6'}]}
:: >>> LSP-volar 11: None
:: <-- LSP-volar client/registerCapability(12): {'registrations': [{'registerOptions': {'codeActionKinds': ['', 'quickfix', 'refactor', 'refactor.extract', 'refactor.inline', 'refactor.rewrite', 'source', 'source.fixAll', 'source.organizeImports'], 'resolveProvider': True, 'documentSelector': [{'language': 'vue', 'scheme': 'file'}]}, 'method': 'textDocument/codeAction', 'id': '3342da6e-e702-450d-ab5d-7255dbb9e46b'}]}
:: >>> LSP-volar 12: None
:: <-- LSP-volar client/registerCapability(13): {'registrations': [{'registerOptions': {}, 'method': 'workspace/didChangeConfiguration', 'id': '61e2ad92-eaa8-468d-8d68-61c298c91604'}]}
:: >>> LSP-volar 13: None
:: <-- LSP-volar workspace/configuration(14): {'items': [{'section': 'volar.codeLens.references'}]}
:: >>> LSP-volar 14: [None]
:: <-- LSP-volar workspace/configuration(15): {'items': [{'section': 'volar.codeLens.pugTools'}]}
:: >>> LSP-volar 15: [None]
:: <-- LSP-volar workspace/configuration(16): {'items': [{'section': 'volar.codeLens.scriptSetupTools'}]}
:: >>> LSP-volar 16: [None]
:: <-- LSP-volar workspace/configuration(17): {'items': [{'section': 'emmet'}]}
:: >>> LSP-volar 17: [None]
:: <-- LSP-volar client/registerCapability(18): {'registrations': [{'registerOptions': {'documentSelector': [{'language': 'vue'}]}, 'method': 'textDocument/selectionRange', 'id': '9a9576f0-751d-4616-b1f6-34f73996230e'}]}
:: >>> LSP-volar 18: None
:: <-- LSP-volar client/registerCapability(19): {'registrations': [{'registerOptions': {'documentSelector': [{'language': 'vue'}]}, 'method': 'textDocument/foldingRange', 'id': '99410362-ab0a-4ecc-85cc-8e356ea6611b'}]}
:: >>> LSP-volar 19: None
:: <-- LSP-volar client/registerCapability(20): {'registrations': [{'registerOptions': {'documentSelector': [{'language': 'vue'}]}, 'method': 'textDocument/documentSymbol', 'id': '3a5e6c5b-bf19-4217-ba50-5c8ac158a99c'}]}
:: >>> LSP-volar 20: None
:: <-- LSP-volar client/registerCapability(21): {'registrations': [{'registerOptions': {'documentSelector': [{'language': 'vue'}]}, 'method': 'textDocument/documentColor', 'id': 'fe96e764-849b-42a8-8769-ba417a5d0607'}]}
:: >>> LSP-volar 21: None
:: <-- LSP-volar client/registerCapability(22): {'registrations': [{'registerOptions': {'documentSelector': [{'language': 'vue'}]}, 'method': 'textDocument/formatting', 'id': '42734a87-bbb6-42d9-a660-ef85caff61aa'}]}
:: >>> LSP-volar 22: None
:: --> LSP-volar textDocument/documentHighlight(2): {'textDocument': {'uri': 'file:///Users/rafal/workspace/web/project/app/pages/subscription/cancel.vue'}, 'position': {'character': 53, 'line': 20}}
:: --> LSP-volar textDocument/codeAction(3): {'textDocument': {'uri': 'file:///Users/rafal/workspace/web/project/app/pages/subscription/cancel.vue'}, 'context': {'diagnostics': []}, 'range': {'end': {'character': 53, 'line': 20}, 'start': {'character': 53, 'line': 20}}}
:: <-  LSP-volar textDocument/publishDiagnostics: {'uri': 'file:///Users/rafal/workspace/web/project/app/pages/subscription/cancel.vue', 'diagnostics': []}
:: <-  LSP-volar textDocument/publishDiagnostics: {'uri': 'file:///Users/rafal/workspace/web/project/app/pages/subscription/cancel.vue', 'diagnostics': [{'message': "Property '$t' does not exist on type '{ name: string; middleware: string; head(): MetaInfo; }'.", 'severity': 1, 'source': 'ts', 'range': {'end': {'character': 33, 'line': 46}, 'uri': 'file:///Users/rafal/workspace/web/project/app/pages/subscription/cancel.vue', 'start': {'character': 31, 'line': 46}}, 'code': 2339}]}
:: <-  LSP-volar textDocument/publishDiagnostics: {'uri': 'file:///Users/rafal/workspace/web/project/app/pages/subscription/cancel.vue', 'diagnostics': [{'message': "Property '$t' does not exist on type '{ name: string; middleware: string; head(): MetaInfo; }'.", 'severity': 1, 'source': 'ts', 'range': {'end': {'character': 33, 'line': 46}, 'uri': 'file:///Users/rafal/workspace/web/project/app/pages/subscription/cancel.vue', 'start': {'character': 31, 'line': 46}}, 'code': 2339}]}
:: <-  LSP-volar textDocument/publishDiagnostics: {'uri': 'file:///Users/rafal/workspace/web/project/app/pages/subscription/cancel.vue', 'diagnostics': [{'message': "Property '$t' does not exist on type '{ name: string; middleware: string; head(): MetaInfo; }'.", 'severity': 1, 'source': 'ts', 'range': {'end': {'character': 33, 'line': 46}, 'uri': 'file:///Users/rafal/workspace/web/project/app/pages/subscription/cancel.vue', 'start': {'character': 31, 'line': 46}}, 'code': 2339}]}
:: <-  LSP-volar $/progress: {'value': {'kind': 'begin', 'title': 'Initializing Vue language features (10 features)'}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 0}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 1.8181818181818181}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 3.6363636363636362}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 5.454545454545454}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 7.2727272727272725}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 9.090909090909092}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 10.909090909090908}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 12.727272727272727}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 14.545454545454545}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 16.363636363636363}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 18.181818181818183}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 20}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 21.818181818181817}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 23.636363636363637}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 25.454545454545453}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 27.27272727272727}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 29.09090909090909}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 30.909090909090907}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 32.72727272727273}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 34.54545454545455}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 36.36363636363637}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 38.18181818181819}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 40}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 41.81818181818181}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 43.63636363636363}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 45.45454545454545}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 47.27272727272727}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 49.09090909090909}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 50.90909090909091}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 52.72727272727272}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 54.54545454545454}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 56.36363636363636}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 58.18181818181818}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 60}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 61.81818181818181}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 63.63636363636363}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 65.45454545454545}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 67.27272727272727}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 69.0909090909091}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 70.9090909090909}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 72.72727272727273}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 74.54545454545455}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 76.36363636363637}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 78.18181818181819}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 80}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 81.81818181818183}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 83.63636363636363}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 85.45454545454545}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 87.27272727272727}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 89.0909090909091}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 90.9090909090909}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 92.72727272727272}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 94.54545454545455}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 96.36363636363636}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'report', 'percentage': 98.18181818181819}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'end'}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar $/progress: {'value': {'kind': 'end'}, 'token': '335e6a4e-afad-45d6-b236-c5dc4b652c33'}
:: <-  LSP-volar textDocument/publishDiagnostics: {'uri': 'file:///Users/rafal/workspace/web/project/app/pages/subscription/cancel.vue', 'diagnostics': [{'message': "Cannot find name '$t'.", 'severity': 1, 'source': 'ts', 'range': {'end': {'character': 99, 'line': 32}, 'uri': 'file:///Users/rafal/workspace/web/project/app/pages/subscription/cancel.vue', 'start': {'character': 97, 'line': 32}}, 'code': 2304}, {'message': "Cannot find name 'localePath'.", 'severity': 1, 'source': 'ts', 'range': {'end': {'character': 46, 'line': 32}, 'uri': 'file:///Users/rafal/workspace/web/project/app/pages/subscription/cancel.vue', 'start': {'character': 36, 'line': 32}}, 'code': 2304}, {'message': "Cannot find name '$t'.", 'severity': 1, 'source': 'ts', 'range': {'end': {'character': 106, 'line': 31}, 'uri': 'file:///Users/rafal/workspace/web/project/app/pages/subscription/cancel.vue', 'start': {'character': 104, 'line': 31}}, 'code': 2304}, {'message': "Cannot find name 'localePath'.", 'severity': 1, 'source': 'ts', 'range': {'end': {'character': 46, 'line': 31}, 'uri': 'file:///Users/rafal/workspace/web/project/app/pages/subscription/cancel.vue', 'start': {'character': 36, 'line': 31}}, 'code': 2304}, {'message': "Cannot find name '$t'.", 'severity': 1, 'source': 'ts', 'range': {'end': {'character': 99, 'line': 26}, 'uri': 'file:///Users/rafal/workspace/web/project/app/pages/subscription/cancel.vue', 'start': {'character': 97, 'line': 26}}, 'code': 2304}, {'message': "Cannot find name '$t'.", 'severity': 1, 'source': 'ts', 'range': {'end': {'character': 90, 'line': 21}, 'uri': 'file:///Users/rafal/workspace/web/project/app/pages/subscription/cancel.vue', 'start': {'character': 88, 'line': 21}}, 'code': 2304}, {'message': "Cannot find name 'localePath'.", 'severity': 1, 'source': 'ts', 'range': {'end': {'character': 60, 'line': 21}, 'uri': 'file:///Users/rafal/workspace/web/project/app/pages/subscription/cancel.vue', 'start': {'character': 50, 'line': 21}}, 'code': 2304}, {'message': "Cannot find name '$t'.", 'severity': 1, 'source': 'ts', 'range': {'end': {'character': 110, 'line': 16}, 'uri': 'file:///Users/rafal/workspace/web/project/app/pages/subscription/cancel.vue', 'start': {'character': 108, 'line': 16}}, 'code': 2304}, {'message': "Cannot find name '$t'.", 'severity': 1, 'source': 'ts', 'range': {'end': {'character': 96, 'line': 6}, 'uri': 'file:///Users/rafal/workspace/web/project/app/pages/subscription/cancel.vue', 'start': {'character': 94, 'line': 6}}, 'code': 2304}, {'message': "Cannot find name 'localePath'.", 'severity': 1, 'source': 'ts', 'range': {'end': {'character': 46, 'line': 6}, 'uri': 'file:///Users/rafal/workspace/web/project/app/pages/subscription/cancel.vue', 'start': {'character': 36, 'line': 6}}, 'code': 2304}, {'message': "Property '$t' does not exist on type '{ name: string; middleware: string; head(): MetaInfo; }'.", 'severity': 1, 'source': 'ts', 'range': {'end': {'character': 33, 'line': 46}, 'uri': 'file:///Users/rafal/workspace/web/project/app/pages/subscription/cancel.vue', 'start': {'character': 31, 'line': 46}}, 'code': 2339}]}

@rchl can you try if the server works for you in vue 3?

You can scaffold a vue 3 project with Vite:

npm init vite@latest my-app -- --template vue

Fails because of missing typescript dependency in the project

::  -> LSP-volar initialized: {}
LSP-volar: (node:42531) UnhandledPromiseRejectionWarning: Error: Cannot find module '/Users/rafal/workspace/temp/my-vue3-app/node_modules/typescript/lib/tsserver.js'
LSP-volar: Require stack:
LSP-volar: - /Users/rafal/Library/Caches/Sublime Text/Package Storage/LSP-volar/14.17.1/server/node_modules/@volar/shared/out/ts.js
LSP-volar: - /Users/rafal/Library/Caches/Sublime Text/Package Storage/LSP-volar/14.17.1/server/node_modules/@volar/shared/out/index.js
LSP-volar: - /Users/rafal/Library/Caches/Sublime Text/Package Storage/LSP-volar/14.17.1/server/node_modules/@volar/server/out/index.js
LSP-volar:     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
LSP-volar:     at Function.Module._load (internal/modules/cjs/loader.js:746:27)
LSP-volar:     at Module.require (internal/modules/cjs/loader.js:974:19)
LSP-volar:     at require (internal/modules/cjs/helpers.js:92:18)
LSP-volar:     at Object.loadTypescript (/Users/rafal/Library/Caches/Sublime Text/Package Storage/LSP-volar/14.17.1/server/node_modules/@volar/shared/out/ts.js:91:12)
LSP-volar:     at onInitialized (/Users/rafal/Library/Caches/Sublime Text/Package Storage/LSP-volar/14.17.1/server/node_modules/@volar/server/out/index.js:56:23)
LSP-volar:     at handleNotification (/Users/rafal/Library/Caches/Sublime Text/Package Storage/LSP-volar/14.17.1/server/node_modules/vscode-jsonrpc/lib/common/connection.js:565:25)
LSP-volar:     at processMessageQueue (/Users/rafal/Library/Caches/Sublime Text/Package Storage/LSP-volar/14.17.1/server/node_modules/vscode-jsonrpc/lib/common/connection.js:293:17)
LSP-volar:     at Immediate.<anonymous> (/Users/rafal/Library/Caches/Sublime Text/Package Storage/LSP-volar/14.17.1/server/node_modules/vscode-jsonrpc/lib/common/connection.js:280:13)
LSP-volar:     at processImmediate (internal/timers.js:464:21)
LSP-volar: (Use `node --trace-warnings ...` to show where the warning was created)
LSP-volar: (node:42531) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
LSP-volar: (node:42531) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

For LSP-typescript we include the typescript dependency in LSP-typescript's package.json so that it can fall back to that but it doesn't look like the same works for LSP-volar (just tried).

It works after npm i -D typescript in the project's directory.

Yes,
Also when choosing the template via vite, there are two options, vue and vue-ts (this would also install typescript).


So apparently LSP-volar works on a Mac,
but I am having this problem on Linux.

And the LSP log panel shows nothing suspicious?

And the LSP log panel shows nothing suspicious?

Nothing on linux.

here is the npm volar contents of the sever folder on a Mac:

➜  server pwd
/Users/codetribe/Library/Caches/Sublime Text/Package Storage/LSP-volar/14.17.5/server/node_modules/@volar/server
➜  server ls
LICENSE      out          package.json

It is the same as on Linux... :) (I was expecting to see node_modules inside of the server folder... but I guess I had the wrong expectations)


I will try to upgrade my node version on Linux just to match the Node version on Mac.

Yes, wrong expectations. Those dependencies are likely hoisted to the root node_modules.

I matched the Node to be the same as on Mac,
deleted the LSP-volar folder in the .cache folder.
I reopened ST.
LSP-volar finished installing and it initialized successfully, but still nothing.
The server doesn't send dynamic registration requests after didOpen.

:: --> LSP-volar initialize(1): {'initializationOptions': {'languageFeatures': {'renameFileRefactoring': False, 'references': True, 'schemaRequestService': False, 'documentLink': False, 'codeLens': False, 'callHierarchy': False, 'completion': {'defaultTagNameCase': 'both', 'getDocumentNameCasesRequest': False, 'defaultAttrNameCase': 'kebab', 'getDocumentSelectionRequest': False}, 'signatureHelp': True, 'codeAction': True, 'documentHighlight': True, 'typeDefinition': True, 'hover': True, 'semanticTokens': False, 'definition': True, 'diagnostics': True, 'rename': True}, 'documentFeatures': {'selectionRange': True, 'documentFormatting': {'defaultPrintWidth': 90}, 'foldingRange': True, 'documentColor': True, 'linkedEditingRange': False, 'documentSymbol': True}, 'typescript': {'serverPath': '/home/predragnikolic/Documents/sandbox/my-vue-app/node_modules/typescript/lib/tsserver.js'}}, 'rootUri': 'file:///home/predragnikolic/Documents/sandbox/my-vue-app', 'processId': 12440, 'clientInfo': {'version': '1.9.0', 'name': 'Sublime Text LSP'}, 'workspaceFolders': [{'name': 'my-vue-app', 'uri': 'file:///home/predragnikolic/Documents/sandbox/my-vue-app'}], 'rootPath': '/home/predragnikolic/Documents/sandbox/my-vue-app', 'capabilities': {'textDocument': {'synchronization': {'dynamicRegistration': True, 'willSaveWaitUntil': True, 'didSave': True, 'willSave': True}, 'references': {'dynamicRegistration': True}, 'selectionRange': {'dynamicRegistration': True}, 'colorProvider': {'dynamicRegistration': True}, 'rangeFormatting': {'dynamicRegistration': True}, 'codeLens': {'dynamicRegistration': True}, 'declaration': {'dynamicRegistration': True, 'linkSupport': True}, 'publishDiagnostics': {'codeDescriptionSupport': True, 'relatedInformation': True, 'dataSupport': True, 'tagSupport': {'valueSet': [2, 1]}, 'versionSupport': True}, 'implementation': {'dynamicRegistration': True, 'linkSupport': True}, 'completion': {'dynamicRegistration': True, 'insertTextMode': 2, 'completionItemKind': {'valueSet': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]}, 'completionItem': {'resolveSupport': {'properties': ['detail', 'documentation', 'additionalTextEdits']}, 'tagSupport': {'valueSet': [1]}, 'deprecatedSupport': True, 'snippetSupport': True, 'labelDetailsSupport': True, 'documentationFormat': ['markdown', 'plaintext'], 'insertTextModeSupport': {'valueSet': [2]}}}, 'signatureHelp': {'dynamicRegistration': True, 'signatureInformation': {'documentationFormat': ['markdown', 'plaintext'], 'parameterInformation': {'labelOffsetSupport': True}}}, 'codeAction': {'dynamicRegistration': True, 'dataSupport': True, 'codeActionLiteralSupport': {'codeActionKind': {'valueSet': ['quickfix', 'refactor', 'refactor.extract', 'refactor.inline', 'refactor.rewrite', 'source.organizeImports']}}, 'resolveSupport': {'properties': ['edit']}}, 'documentHighlight': {'dynamicRegistration': True}, 'typeDefinition': {'dynamicRegistration': True, 'linkSupport': True}, 'hover': {'dynamicRegistration': True, 'contentFormat': ['markdown', 'plaintext']}, 'definition': {'dynamicRegistration': True, 'linkSupport': True}, 'formatting': {'dynamicRegistration': True}, 'rename': {'dynamicRegistration': True, 'prepareSupport': True}, 'documentSymbol': {'dynamicRegistration': True, 'symbolKind': {'valueSet': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]}, 'tagSupport': {'valueSet': [1]}, 'hierarchicalDocumentSymbolSupport': True}}, 'window': {'workDoneProgress': True, 'showMessage': {'messageActionItem': {'additionalPropertiesSupport': True}}, 'showDocument': {'support': True}}, 'workspace': {'executeCommand': {}, 'configuration': True, 'symbol': {'dynamicRegistration': True, 'symbolKind': {'valueSet': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]}, 'tagSupport': {'valueSet': [1]}}, 'applyEdit': True, 'workspaceFolders': True, 'didChangeConfiguration': {'dynamicRegistration': True}, 'workspaceEdit': {'failureHandling': 'abort', 'documentChanges': True}}, 'general': {'regularExpressions': {'engine': 'ECMAScript'}, 'markdown': {'version': '3.2.2', 'parser': 'Python-Markdown'}}, 'experimental': {}}}
:: <<< LSP-volar 1: {'capabilities': {'textDocumentSync': {'change': {'syncKind': 2}, 'didOpen': {}, 'didClose': {}, 'save': {}}}}
::  -> LSP-volar initialized: {}
::  -> LSP-volar textDocument/didOpen: {'textDocument': {'languageId': 'vue', 'uri': 'file:///home/predragnikolic/Documents/sandbox/my-vue-app/src/App.vue', 'text': '<template>\n  <img alt="Vue logo" src="./assets/logo.png" />\n  <HelloWorld msg="Hello Vue 3 + TypeScript + Vite" />\n  {{a}}\n</template>\n<script lang="ts" setup>\n\nimport { defineComponent, ref } from \'vue\'\nimport HelloWorld from \'./components/HelloWorld.vue\'\n\nconst a = ref(2)\n</script>\n\n<style>\n#app {\n  font-family: Avenir, Helvetica, Arial, sans-serif;\n  -webkit-font-smoothing: antialiased;\n  -moz-osx-font-smoothing: grayscale;\n  text-align: center;\n  color: #2c3e50;\n  margin-top: 60px;\n}\n</style>\n', 'version': 0}}

Sorry it is a volar issue, fixed in vuejs/language-tools@d0ddec3.