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

Ensure returned uri from code actions contain a scheme #642

Merged
merged 1 commit into from
Jul 16, 2024

Conversation

jimnanney
Copy link
Contributor

@jimnanney jimnanney commented Jul 16, 2024

Using Neovim 0.10 with the ruby-lsp plugin, standard returns code actions to allow for quick fixes. They were returning the uri without the scheme, and that caused neovim to give an error.

To correct for the error, I added an ensure_uri_scheme method to parse the uri and add the "file" scheme if the uri did not include one.

Example of the erorr:
image

Edit: Updated tests to use new file type uri in return.

@jimnanney jimnanney marked this pull request as draft July 16, 2024 15:10
@searls
Copy link
Contributor

searls commented Jul 16, 2024

Hi Jim!

Have you pointed your neovim at this to verify it works manually?

@jimnanney
Copy link
Contributor Author

yes, I updated in my neovim copy of standardrb to test it manually. I don't have vscode, so I was a little afraid of maybe breaking vscode.

@jimnanney
Copy link
Contributor Author

looking at fixing the tests now

Using Neovim 0.10 with the ruby-lsp plugin, standard returns code
actions to allow for quick fixes. They were returning the uri without
the scheme, and that caused neovim to give an error.

To correct for the error, I added an ensure_uri_scheme method to parse
the uri and add the "file" scheme if the uri did not include one.
@jimnanney jimnanney force-pushed the neovim-10-code-actions-uri-fix branch from 2c803f5 to 2fcca8d Compare July 16, 2024 15:21
@jimnanney jimnanney marked this pull request as ready for review July 16, 2024 15:22
@searls
Copy link
Contributor

searls commented Jul 16, 2024

I'd be extremely shocked if this broke anything so happy to merge

@searls searls merged commit 7a8ee6b into standardrb:main Jul 16, 2024
4 checks passed
@searls
Copy link
Contributor

searls commented Jul 16, 2024

Released as 1.39.2

If anyone has a chance to test quickfixes (command-period) on VS Code to see if it fixes it there, we should update the table in the README https://github.com/standardrb/standard?tab=readme-ov-file#language-server-protocol-support

@jimnanney
Copy link
Contributor Author

Wow, thanks for merging and releasing that so quickly! Really appreciate it!

@searls
Copy link
Contributor

searls commented Jul 16, 2024

You break it, you buy it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants