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

Empty diagnostics send invalid URI #71

Closed
tomaskallup opened this issue Sep 13, 2024 · 1 comment
Closed

Empty diagnostics send invalid URI #71

tomaskallup opened this issue Sep 13, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@tomaskallup
Copy link

Describe the bug
When a file has diagnostic errors and they all get resolved, the server gives invalid URI (missing file:/ prefix).

To Reproduce

  1. Open any c3 source file
  2. Cause an error (for example remove ;)
  3. Save
  4. Fix the error
  5. Save
  6. Diagnostics with invald URI should be sent from the LSP

Expected behavior
The URI should be correct and error should just disappear.

Screenshots
image

Desktop (please complete the following information):

  • OS: NixOS
  • Editor: neovim

Additional context
I tried fixing this myself, but this required moving the clearOldDiagnostics under the Server struct so I'm not sure if it's the right way to do this (I have pretty much zero experience in Go).

I have my fix in a commit tomaskallup@489f24e, tested it after rebuilding and everything seemed fine.
The fix is tiny, so if it's correct, feel free to just commit it here, I could create a PR, but I would have to cherry-pick it into a fresh branch.

@pherrymason pherrymason added the bug Something isn't working label Sep 15, 2024
@pherrymason
Copy link
Owner

Thank you @tomaskallup !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants