-
Notifications
You must be signed in to change notification settings - Fork 40
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
Unable to start language server in VS Code workspace #627
Comments
Thanks for an excellent bug report! Looks like there's some directory in your workspace that Regal isn't permitted to read (or whatever other reasons there might be for err := filepath.WalkDir(workspaceRootPath, func(path string, d os.DirEntry, err error) error {
if err != nil {
return fmt.Errorf("failed to walk workspace dir %q: %w", d.Name(), err)
}
// ...
} Classic rookie mistake, most likely signed yours truly. I'll have it fixed later today and will send you a link to an update binary for you to test with. |
Fixes #627 Signed-off-by: Anders Eknert <anders@styra.com>
Fix is out and v0.20.1 just published. Should be available via brew sometime soon. Thanks @frittsy, and let me know how that works. |
@anderseknert thanks for the quick fix! I'm able to extract the real error now, which I believe is still a bug in its own right?
It appears to be URL encoding the space character in the folder name. I tried moving the repository into a different directory without a space in it and the language server started successfully 🎉 |
Hmm yeah, that's a bug for sure. Although it's not as obvious what the cause is, or rather why one go function would encode the path in a way that another go function can't understand 😅 Or I'm just missing something obvious. Anyway, that'll be trivial to add a test case for, so I should be able to figure something out. I'll look into it as soon as I can. Happy to hear you figured it out and provided a workaround! Should help others who might find their way here if they encounter the same. |
VSCode uses URI-encoded values for file names, I think our logic to process them is only handling the file:// prefixes at the moment. 🤦 I wrote that part... I'll get an issue open. |
Ah, at least I'm off the hook then! 👋 😆 |
See #631 for the follow on fix for this |
Fixes StyraInc#627 Signed-off-by: Anders Eknert <anders@styra.com>
Platform: macOS 14.4.1, M1 arm64
OPA version: 0.63.0
Regal version: 0.20.0
Client: VS Code: 1.88.0
I haven't been able to get the OPA extension for VS Code to work as intended and can't seem to find any issue in GitHub or Slack like this one. I'm not 100% sure if this is an extension issue or a Regal language server issue, but I'm leaning towards the latter so I'm opening the issue here to start.
Here is my full output from
regal-ls
upon opening a.rego
file:I tried a few different settings with no success, but this is what I currently have configured in VS Code:
Please let me know if there's any additional information that I can provide or debug with.
The text was updated successfully, but these errors were encountered: