-
Notifications
You must be signed in to change notification settings - Fork 59
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
Document how to use ZLS #142
Comments
At first install the extension runs you through the setup to handle the paths.
That is a bug that I've not been able to reproduce. |
I don't remember seeing this. How do I reproduce a "first install" state? Here's what I'm doing:
After this, I don't see any kind of wizard running me through a setup process.
Have you tried running the command to install zls while the extension is not yet configured to use any version of zig? |
That should do it.
That worked and I was able to confirm that #138 fixes it. I'll try to make a release with #138 within the next weeks. |
What should I expect to see in this situation? Is there some kind of pop-up? Is there a command I can run to manually trigger a setup wizard? |
I found it. There is a notification. I always have "do not disturb" mode enabled because my experience with vscode until now has been that notifications are useless and distracting noise. So the notification never appeared for me. I still feel that it can't hurt to have some kind of concise documentation about the required manual configuration. Notifications are not a very reliable way to ensure user interaction, especially if you only show them once. |
Does it also block modals? I changed the setup messages to be modals in that PR. |
My guess is no but I'm not sure. Is there any easy way for me to test the code in the pr? |
These commands and restarting vscode should do it:
|
If you're talking about the zen mode, then I just tested it and it doesn't hide modals. |
It seems that modals still work with do not disturb. I tested your branch with do not disturb mode turned on, and I saw the popup window requesting me to select my zig path. However, I'm seeing two new issues in this branch. First, there was this error. This does not happen in the marketplace version, where an 0.12 dev version of zls is installed successfully.
Later, I wanted to do some more tests. I uninstalled the extension and cleared the state as I described in a prior comment. I closed vscode and installed the extension from your branch again. This time I didn't see any modal to configure zig. I guess the state is being saved somewhere else to indicate that the first run process has already been completed? It's unclear to me how to trigger the modal again. With the marketplace version, I always see the notification after clearing the state. I suppose you could show a notification every single time that the extension detects the zig or zls path is improperly configured, in addition to the modal on first run. That gets us back into the realm of notification spam, which is why I use do not disturb mode in the first place, so I'm not sure if that's desirable. FYI, Do not disturb mode is not the same as zen mode. Do not disturb only prevents notifications from popping up on the bottom right side of the screen. To enable do not disturb mode:
|
That is because the ZLS team has not yet uploaded the tagged versions to their new backend.
Currently it uses |
After I saw the error message, I installed the marketplace version of the extension, and it installed 0.12-dev. So I think this error comes down to a change in behavior in the extension. But maybe it's an intended behavior... Did you add some logic to check the version of zig so it would install the same version of zls? Previously, it was happy to install 0.12 even though my zig version was 0.11. With the new version, it instead has an error that it can't install zls 0.11 (which is my zig version).
Any suggestions on how to clear this state? I tried this but it wasn't enough to trigger the modal to come back: rm -rf $HOME/.config/Code/User/globalStorage/ziglang.vscode-zig/ |
It'll work once the binaries are uploaded.
Yes, that is the main goal of the PR.
I'd guess the data is stired in one of the caches but the DB might contain data from other extensions as well. I've reset it by changing one of the commands to instead update the value in Turning it into an option will make it easy to reset again. |
What does this mean exactly? I could imagine this meaning a few things
|
The first one. |
I was also having issues with ZSL and Zig vscode extension.
These steps worked for me! Not sure if this was intended as I already had zig installed before any of this. |
After running those steps, you now have two separate versions of zig on your computer. The IDE won't use the version of that you installed. It will use its own version that this extension downloaded into vscode's internal state. |
A new version of the extension has been published, please try running through the setup with it. |
Just tried it and seems like I'm facing exactly same issues described above (couldn't find zig in PATH, modal shown only once and never again, ZLS needs to be manually installed, etc.) I'd say it is worth mentioning in readme that ZLS can be installed via vscode command, I didn't realize that's an option and was getting ready to manually install it before bumping into this github issue.
|
Can you describe how you interacted with the modals? You can run the initial setup again by setting |
hm, just tried to reproduce (and remember what I did the first time). It might be on me the first time it didn't work, most probably I did the following:
|
I was able to reproduce your error with this. With |
@dnut Do you know any workaround, even the manual one, that I can use to get the ZLS work for this one? 🙏 I keep encountering on this one as well on VSCode. No autocomplete or any other language server features, which makes it unable to code in Zig 😞 The pop-up/modal showing message of installing ZLS on the bottom-right on the VSCode was shown, and I have clicked OK on that. The message seems like it's downloading the All VSCode command related to ZLS keep getting the error message of This is my VSCode
Any help is much appreciated here, thank you lots in advance folks! 🙏 |
It is unclear how to use this extension. The README says this extension supports ZLS, but installing the extension is not enough to get that working. The README should explain how to get ZLS support.
The ZLS docs say:
But the only thing you get after installing this extension is syntax highlighting and a bunch of non-functional commands. Nearly every command results in a message like
command 'zig.zls.install' not found
.After spending a while trying to get this working, I eventually figured out some basic steps get this extension working with zls. These steps will get vscode to use its own installed versions of zig and zls.
Alternatively, you can use pre-installed zig and zls binaries with this extension, but the extension will not find them in your PATH automatically (contrary to what it says in the settings gui). You need to explicitly configure something like this:
Or you can do this for a workspace-specific toolchain:
As with the steps described above, you need to restart vscode to apply this configuration before you will be able to start zls.
The text was updated successfully, but these errors were encountered: