mirror of
https://github.com/astral-sh/ruff
synced 2026-01-09 07:34:06 -05:00
<!-- 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](https://github.com/astral-sh/ruff/issues/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>