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

Provide hover implementation for the new Ruff language server #10595

Closed
dhruvmanila opened this issue Mar 26, 2024 · 1 comment
Closed

Provide hover implementation for the new Ruff language server #10595

dhruvmanila opened this issue Mar 26, 2024 · 1 comment
Labels
server Related to the LSP server

Comments

@dhruvmanila
Copy link
Member

Screenshot 2024-03-26 at 09 10 57

Reference implementation in ruff-lsp: https://github.com/astral-sh/ruff-lsp/blob/187d7790be0783b9ac41ce025a724cf389bf575c/ruff_lsp/server.py#L759-L800

I consider this low priority as user would usually ignore this because it might conflict with other servers.

@dhruvmanila dhruvmanila added the server Related to the LSP server label Mar 26, 2024
@snowsignal snowsignal added this to the Ruff Server: Beta milestone Apr 10, 2024
snowsignal added a commit that referenced this issue Apr 23, 2024
<!--
Thank you for contributing to Ruff! To help us out with reviewing,
please consider the following:

- Does this pull request include a summary of the change? (See below.)
- Does this pull request include a descriptive title?
- Does this pull request include references to any relevant issues?
-->

## Summary

Add support for hover menu to ruff_server, as requested in
[10595](#10595).
Majority of new code is in hover.rs.
I reused the regex from ruff-lsp's implementation. Also reused the
format_rule_text function from ruff/src/commands/rule.rs
Added capability registration in server.rs, and added the handler to
api.rs.

## Test Plan

Tested in NVIM v0.10.0-dev-2582+g2a8cef6bd, configured with lspconfig
using the default options (other than cmd pointing to my test build,
with options "server" and "--preview"). OS: Ubuntu 24.04, kernel
6.8.0-22.

---------

Co-authored-by: Jane Lewis <me@jane.engineering>
@snowsignal
Copy link
Member

Implemented in #11096 🎉

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

No branches or pull requests

2 participants