vlang/vscode-vlang

v.fmt not working

esimov opened this issue · 7 comments

I have installed Vlang together with the vscode plugin on my Windows environment, but it looks like that none of the supported commands are working. For example when I'm trying to run v.fmt by pressing CTRL+SHIFT+P I'm getting the following error:

I figured it out, that v ls wasn't installed and this was the reason that I was getting the above error. Maybe it would help the future developers who want to try out the language somewhere to be mentioned that v ls should be installed in order to use the VsCode plugin.

The plugin used to ask if you wanted to install vls. Perhaps this is a regression.

It didn't asked me.

It's not related to the original question, but how can I enable the autoformat function on file save? Is it possible or only by using the CTRL-SHIFT-P + V: Format current file command?

Did you enable vls in the options?

I don't use vscode, so not sure, but most editors have a way to set up "do this when saving a file" operations.

Yes, I did. Also "editor.formatOnSave" is set as true globally, but for V is not working unfortunately.

v.fmt is not called by vscode to format files on save. There is no explicit languageformatter registered for v, formatting is done through the language server.
"editor.formatOnSave" does work for me though when vls is enabled.