ruff/crates/ruff_server/src
Dhruv Manilawala aa429b413f
Check diagnostic refresh support from client capability (#15014)
## Summary

Per the LSP spec, the property name is `workspace.diagnostics` with an
`s` at the end but the `lsp-types` dependency uses
`workspace.diagnostic` (without an `s`). Our fork contains this fix
(0f58d62879)
so we should avoid the hardcoded value.

The implication of this is that the client which doesn't support
workspace refresh capability didn't support the [dynamic
configuration](https://docs.astral.sh/ruff/editors/features/#dynamic-configuration)
feature because the server would _always_ send the workspace refresh
request but the client would ignore it. We have a fallback logic to
publish the diagnostics instead:


5f6fc3988b/crates/ruff_server/src/server/api/notifications/did_change_watched_files.rs (L28-L40)

fixes: #15013 

## Test Plan

### VS Code


https://github.com/user-attachments/assets/61ac8e6f-aa20-41cc-b398-998e1866b5bc

### Neovim



https://github.com/user-attachments/assets/4131e13c-3fba-411c-9bb7-478d26eb8d56
2024-12-16 16:26:40 +05:30
..
edit Fix server panic when undoing an edit (#14010) 2024-11-01 08:16:53 +01:00
server Fix typos found by codespell (#14863) 2024-12-09 09:32:12 +00:00
session Check diagnostic refresh support from client capability (#15014) 2024-12-16 16:26:40 +05:30
edit.rs Add support for extensionless Python files for server (#13326) 2024-09-12 00:35:26 +05:30
fix.rs Detect empty implicit namespace packages (#14236) 2024-11-09 22:03:34 -05:00
format.rs ruff server: Formatting a document with syntax problems no longer spams a visible error popup (#11745) 2024-06-04 17:18:21 -07:00
lib.rs Avoid indexing the workspace for single-file mode (#13770) 2024-10-18 10:51:43 +05:30
lint.rs Upgrade Rust toolchain to 1.83 (#14677) 2024-11-29 12:05:05 +00:00
message.rs Ignore non-file workspace URL (#12725) 2024-08-07 09:15:55 +00:00
resolve.rs Add support for extensionless Python files for server (#13326) 2024-09-12 00:35:26 +05:30
server.rs Upgrade to Rust 1.82 (#13816) 2024-10-19 16:05:50 +02:00
session.rs Avoid indexing the workspace for single-file mode (#13770) 2024-10-18 10:51:43 +05:30
trace.rs Use $/logTrace for server trace logs in Zed and VS Code (#12564) 2024-07-30 08:32:20 +05:30