mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-01 06:11:43 +00: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>
This commit is contained in:
parent
455d22cdc8
commit
7c8c1c71a3
6 changed files with 121 additions and 0 deletions
|
@ -257,6 +257,7 @@ impl Server {
|
|||
},
|
||||
},
|
||||
)),
|
||||
hover_provider: Some(types::HoverProviderCapability::Simple(true)),
|
||||
text_document_sync: Some(TextDocumentSyncCapability::Options(
|
||||
TextDocumentSyncOptions {
|
||||
open_close: Some(true),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue