Sublime Forum

Vue and LSP

#1

did someone make this stuff https://lsp.readthedocs.io/en/latest/#vue-javascript works?
I had an error on windows 10, that vue-ls had crashed

0 Likes

#2

This description is too vague. Nothing different with “it just does not work.”

Turn on all debug/log options in LSP settings and post proper log.

0 Likes

#3

LSP: received config lsp-css from LspCssPlugin
LSP: received config lsp-html from LspHtmlPlugin
LSP: received config lsp-vue from LspVuePlugin
LSP: global configs ['lsp-html=True', 'lsp-css=True', 'lsp-vue=True', 'cquery=False', 'haskell-ide-engine=False', 'phpls=False', 'metals=False', 'vue-ls=True', 'rls=False', 'eslint=False', 'javascript-typescript-langserver=True', 'jdtls=False', 'polymer-ide=False', 'flow=False', 'ra-lsp=False', 'reason=False', 'gopls=False', 'intelephense-ls=True', 'golsp=False', 'bashls=False', 'pyls=False', 'vscode-css=False', 'clangd=False', 'lsp-tsserver=True', 'dart=False', 'ocaml=False', 'typescript-language-server=False', 'ruby=False']
LSP: window 2 starting 1 initial views
LSP: window 2 requests lsp-vue for W:\www-job\fun-gallery-kibo\src\components\MenuComponent.vue
LSP: starting in W:\www-job\fun-gallery-kibo
LSP: starting ['node', 'C:\\Users\\zion\\AppData\\Roaming\\Sublime Text 3\\Packages\\LSP-vue\\node_modules\\vue-language-server\\bin\\vls']
LSP:  --> initialize
LSP: window 2 added session lsp-vue
LSP: window 2 requests vue-ls for W:\www-job\fun-gallery-kibo\src\components\MenuComponent.vue
LSP: starting in W:\www-job\fun-gallery-kibo
LSP: starting ['vls.cmd']
LSP:  --> initialize
LSP: window 2 added session vue-ls
syncScroll starting
LSP-css: Server is installed.
LSP-html: Server is installed.
LSP-vue: Server is installed.
PyV8: Creating new thread
Emmet: Creating thread
Emmet: Loading https://api.github.com/repos/emmetio/pyv8-binaries/contents
reloading settings Packages/User/SublimeServer.sublime-settings
Emmet: You have the most recent PyV8 binary
LSP: Unhandled notification window/logMessage
LSP: Request initialize failed with message: Cannot read property 'config' of undefined
LSP: Unhandled notification window/logMessage
LSP:  --> initialized
LSP:  --> textDocument/didOpen
LSP:  --> textDocument/codeAction
LSP: LSP stdout process ended.
Package Control: Skipping automatic upgrade, last run at 2019-08-08 22:27:50, next run at 2019-08-08 23:27:50 or after
LSP:  --> textDocument/codeAction
Failure writing to stdout
Traceback (most recent call last):
  File "C:\Users\zion\AppData\Roaming\Sublime Text 3\Installed Packages\LSP.sublime-package\plugin/core/transports.py", line 227, in write_stdin
    self.process.stdin.flush()
OSError: [Errno 22] Invalid argument

LSP: transport failed
LSP: unable to send textDocument/codeAction
Unable to open /C/Users/zion/AppData/Roaming/Sublime Text 3/Packages/LSP/LSP.sublime-settings
LSP: Couldn't determine project directory since no folders are open! Using C:\Users\zion\AppData\Roaming\Sublime Text 3\Packages\User as a fallback.
LSP: no config found or enabled for view C:\Users\zion\AppData\Roaming\Sublime Text 3\Packages\LSP\LSP.sublime-settings
Unable to open /C/Users/zion/AppData/Roaming/Sublime Text 3/Packages/User/LSP-vue.sublime-settings
LSP: Couldn't determine project directory since no folders are open and the current file isn't saved on the disk.
LSP: no config found or enabled for view C:\Users\zion\AppData\Roaming\Sublime Text 3\Packages\User\LSP-vue.sublime-settings

lsp settings

"vue-ls": {
			"command": [
				"vls"
			],
			"enabled": true,
			"languageId": "vue",
			"scopes": ["text.html.vue"],
			"syntaxes": ["Packages/Vue Syntax Highlight/Vue Component.sublime-syntax"]
		}

and I get


restarting does not helps, after click on “Restart” I get same “want to restart it window”

0 Likes

#4

LSP: received config lsp-css from LspCssPlugin
LSP: received config lsp-html from LspHtmlPlugin
LSP: received config lsp-vue from LspVuePlugin
LSP: global configs ['lsp-css=True', 'lsp-html=True', 'lsp-vue=True', 'polymer-ide=False', 'intelephense-ls=True', 'flow=False', 'ocaml=False', 'jdtls=False', 'pyls=False', 'cquery=False', 'gopls=False', 'eslint=False', 'haskell-ide-engine=False', 'ra-lsp=False', 'lsp-tsserver=True', 'clangd=False', 'golsp=False', 'metals=False', 'dart=False', 'javascript-typescript-langserver=True', 'reason=False', 'bashls=False', 'vue-ls=True', 'typescript-language-server=False', 'phpls=False', 'ruby=False', 'vscode-css=False', 'rls=False']
LSP: window 2 starting 1 initial views
LSP: window 2 requests lsp-vue for W:\www-job\fun-gallery-kibo\src\components\MenuComponent.vue
LSP: starting in W:\www-job\fun-gallery-kibo
LSP: starting ['node', 'C:\\Users\\zion\\AppData\\Roaming\\Sublime Text 3\\Packages\\LSP-vue\\node_modules\\vue-language-server\\bin\\vls']
LSP:  --> initialize
LSP: window 2 added session lsp-vue
LSP: window 2 requests vue-ls for W:\www-job\fun-gallery-kibo\src\components\MenuComponent.vue
LSP: starting in W:\www-job\fun-gallery-kibo
LSP: starting ['vls.cmd']
LSP:  --> initialize
LSP: window 2 added session vue-ls
syncScroll starting
LSP-css: Server is installed.
LSP-html: Server is installed.
LSP-vue: Server is installed.
Emmet: No need to update PyV8
reloading settings Packages/User/SublimeServer.sublime-settings
LSP: Unhandled notification window/logMessage
LSP: Request initialize failed with message: Cannot read property 'config' of undefined
LSP: Unhandled notification window/logMessage
LSP:  --> initialized
LSP:  --> textDocument/didOpen
LSP:  --> textDocument/codeAction
LSP: LSP stdout process ended.
LSP:  --> textDocument/codeAction
Failure writing to stdout
Traceback (most recent call last):
  File "C:\Users\zion\AppData\Roaming\Sublime Text 3\Installed Packages\LSP.sublime-package\plugin/core/transports.py", line 227, in write_stdin
    self.process.stdin.flush()
OSError: [Errno 22] Invalid argument

LSP: transport failed
0 Likes

#5

and with this config

"vue-ls":{
			"command": [
				// "vls",
				// "--stdio"
				"node",
				"~/AppData/Roaming/npm/node_modules/vue-language-server/bin/vls",
				// "--stdio"
    			// note: you may need to use the absolute path to the language server binary
    		],
			"enabled": true,
			"languageId": "vue",
			// "languageId": "Vue Component",
			"scopes": ["text.html.vue"],
			// "syntaxes": ["Packages/Vue Component/Vue Component.sublime-syntax"],
			"syntaxes": ["Packages/Vue Syntax Highlight/Vue Component.sublime-syntax"],
			// "syntaxes": ["Vue Component"],
			"initializationOptions": {
				"config": {
					"vetur": {
						"useWorkspaceDependencies": false,
						"validation": { "template": true, "style": true, "script": true },
						"completion": { "autoImport": false, "useScaffoldSnippets": false, "tagCasing": "kebab" },
						"format": {
							"defaultFormatter": {"js": "none", "ts": "none"},
							"defaultFormatterOptions": {},
							"scriptInitialIndent": false,
							"styleInitialIndent": false
						}
					},
					"css": {},
					"html": {"suggest": {} },
					"javascript": {"format": {} },
					"typescript": {"format": {} },
					"emmet": {},
					"stylusSupremacy": {}
				}
			}
		}

I get:

LSP: received config lsp-css from LspCssPlugin
LSP: received config lsp-html from LspHtmlPlugin
LSP: global configs ['lsp-html=True', 'lsp-css=True', 'lsp-tsserver=True', 'ra-lsp=False', 'polymer-ide=False', 'flow=False', 'ocaml=False', 'pyls=False', 'reason=False', 'ruby=False', 'eslint=False', 'golsp=False', 'bashls=False', 'typescript-language-server=False', 'haskell-ide-engine=False', 'metals=False', 'javascript-typescript-langserver=True', 'phpls=False', 'dart=False', 'clangd=False', 'gopls=False', 'jdtls=False', 'vue-ls=True', 'cquery=False', 'rls=False', 'intelephense-ls=True', 'vscode-css=False']
LSP: window 2 starting 1 initial views
LSP: window 2 requests vue-ls for W:\www-job\fun-gallery-kibo\src\components\MenuComponent.vue
LSP: starting in W:\www-job\fun-gallery-kibo
LSP: starting ['node', 'C:\\Users\\zion/AppData/Roaming/npm/node_modules/vue-language-server/bin/vls']
LSP:  --> initialize
LSP: window 2 added session vue-ls
syncScroll starting
LSP-css: Server is installed.
LSP-html: Server is installed.
Emmet: No need to update PyV8
reloading settings Packages/User/SublimeServer.sublime-settings
LSP: Unhandled notification window/logMessage
LSP: Unhandled notification window/logMessage
LSP:  --> initialized
LSP:  --> textDocument/didOpen
LSP: LSP stdout process ended.
Package Control: Skipping automatic upgrade, last run at 2019-08-08 23:27:54, next run at 2019-08-09 00:27:54 or after
LSP:  --> textDocument/codeAction
Failure writing to stdout
Traceback (most recent call last):
  File "C:\Users\zion\AppData\Roaming\Sublime Text 3\Installed Packages\LSP.sublime-package\plugin/core/transports.py", line 227, in write_stdin
    self.process.stdin.flush()
OSError: [Errno 22] Invalid argument

LSP: transport failed
LSP: unable to send textDocument/codeAction
0 Likes

#6

You may file an issue to the LSP package with above log and config if you are using the official recommended settings and it is not working. There may be other vue-lsp users who can help you if the problem is not LSP itself.

0 Likes