Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vlang syntax not work by default #6164

Closed
linc01 opened this issue Mar 3, 2023 · 12 comments
Closed

Vlang syntax not work by default #6164

linc01 opened this issue Mar 3, 2023 · 12 comments
Labels
C-bug Category: This is a bug S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.

Comments

@linc01
Copy link

linc01 commented Mar 3, 2023

Summary

Although there are some configurations available for Vlang in the languages.toml file by default, they do not seem to work as documented. Please advise on how to enable vlang-lsp, as it is working well with my Vim environment.

Thanks!

Platform

Linux

Terminal Emulator

Qt

Helix Version

22.12

@linc01 linc01 added the C-bug Category: This is a bug label Mar 3, 2023
@kirawi
Copy link
Member

kirawi commented Mar 3, 2023

Thanks for opening an issue. Can you check if https://github.com/helix-editor/helix/wiki/Troubleshooting#missing-syntax-highlighting addresses your problem?

@linc01
Copy link
Author

linc01 commented Mar 3, 2023

Thanks kirawi, here is:

Configured language server: vls
Binary for language server: Not found in $PATH
Configured debug adapter: None
Highlight queries: ✓
Textobject queries: ✘
Indent queries: ✘

and the vls $PATH(export PATH=~/.vls/bin/vls_linux_x64:$PATH) is there, but it's not found in the above check.

@askreet
Copy link
Contributor

askreet commented Mar 3, 2023

@linc01 PATH is a Unix environment variable that lists directories to search for binaries when running them by name. You can't add a binary directly to PATH.

Edit: I'm assuming bin/vls_linux_x64 is a binary, not a directory, just by convention. Apologies if that's not right.

@linc01
Copy link
Author

linc01 commented Mar 4, 2023

@askreet Thank you for your response! Unfortunately, I have already attempted using the bin file at first, but not work.

@askreet
Copy link
Contributor

askreet commented Mar 4, 2023

Unfortunately, I have already attempted using the bin file at first, but not work.

When you added only the bin directory to your path, did hx --health v continue to show "Not found in $PATH"? If you have a binary called vls_linux_x64 in a directory called bin that will not work, as (per the output of --health) Helix is looking to find a binary called vls.

And it's not affect the syntax highlight, right?

Correct, the language server has nothing to do with syntax highlighting. The fact that your output shows Highlight queries: ✓ indicates the treesitter queries exist for the language and should be highlighting. Does the correct filetype show when you use :set-language?

I don't know anything about V or Vue, but hx --health v appears to want a language server called v while hx --health vue wants one called vls -- which type of file are you working with?

@linc01
Copy link
Author

linc01 commented Mar 4, 2023

.v file for Vlang

this is the current highlight:
vlang

seems the highlight works, but not very well.

@kirawi
Copy link
Member

kirawi commented Mar 5, 2023

That's quite different from "doesn't work by default." The highlighting queries for V result in simple highlighting: https://github.com/helix-editor/helix/blob/master/runtime/queries/v/highlights.scm

Someone would need to put in the work to get more detailed highlighting.

@kirawi kirawi added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Mar 9, 2023
@bfg-coding
Copy link

@linc01 do you by chance have the vue lsp setup on helix as well. I just V setup on my machine and saw the same thing you do but it looks like both vue lsp and V lsp are called vls and I think that is leading to a bug in helix

@erasin
Copy link
Contributor

erasin commented Mar 11, 2023

@linc01 @bfg-coding

Use ":lang" to get language id.

Probably this error is caused by a file type conflict, v and verilog both use v as the file suffix.

v

helix/languages.toml

Lines 1614 to 1617 in 3d230e7

[[language]]
name = "v"
scope = "source.v"
file-types = ["v", "vv"]

verilog

helix/languages.toml

Lines 1629 to 1632 in 3d230e7

[[language]]
name = "verilog"
scope = "source.verilog"
file-types = ["v", "vh", "sv", "svh"]

Custom configurations can be solved, append to .config/helix/languages.toml like this:

[[language]]
name = "v"
file-types = ["v", "vv"]

[[language]]
name = "verilog"
file-types = ["vh", "sv", "svh"]

there has remove "v" from verilog.

We can config statusline to show language id.
https://docs.helix-editor.com/configuration.html#editorstatusline-section

@linc01
Copy link
Author

linc01 commented Mar 11, 2023

@askreet @bfg-coding @erasin @kirawi
:lang shows Bad arguments and :set-language v for vlang's .v file works. I've changed the languages.toml file and all looks good, it is the file type conflict.

Thanks guys!

@linc01 linc01 closed this as completed Mar 11, 2023
@erasin
Copy link
Contributor

erasin commented Mar 11, 2023

:lang shows Bad arguments

Because I use the master branch,in new version,:lang is short of :set-language, when not input parameters, it will return the current language ID.


@kirawi There are have type conflicts in the languages.toml default configuration.

@linc01
Copy link
Author

linc01 commented Mar 11, 2023

:lang shows Bad arguments

Because I use the master branch,in new version,:lang is short of :set-language, when not input parameters, it will return the current language ID.

@kirawi There are have type conflicts in the languages.toml default configuration.

Thanks, looking forward to using the upcoming version. Helix is awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

No branches or pull requests

5 participants