ruff/crates/ruff_server
Jane Lewis 6b580c1544
Support unused code formatting for ruff server (#10644)
## Summary

Fixes #10589.

Code that violates `F401` or `F841` (in other words, unused variables or
imports) should now appear greyed out or 'unused' in an editor.

## Test Plan

Put the following test code in a new file within the extension
development host window:

```python
import math
def func():
   if False:
      unused = "<- this should be greyed out"
```

The following test code should have greyed out/unused import and
variable names, like so:
<img width="294" alt="Screenshot 2024-03-28 at 4 23 18 AM"
src="e84a6e7a-49e2-4fed-9624-f8f9559e0837">
2024-03-28 11:30:35 +00:00
..
resources/test/fixtures ruff server - A new built-in LSP for Ruff, written in Rust (#10158) 2024-03-08 20:57:23 -08:00
src Support unused code formatting for ruff server (#10644) 2024-03-28 11:30:35 +00:00
tests ruff server - A new built-in LSP for Ruff, written in Rust (#10158) 2024-03-08 20:57:23 -08:00
Cargo.toml Remove unused dependencies (#10475) 2024-03-19 17:33:47 +01:00
CONTRIBUTING.md High-level project overview and contributing guide for ruff server (#10565) 2024-03-25 23:08:37 -07:00
README.md High-level project overview and contributing guide for ruff server (#10565) 2024-03-25 23:08:37 -07:00

The Ruff Language Server

Welcome! ruff server is a language server that powers editor integrations with Ruff. The job of the language server is to listen for requests from the client, (in this case, the code editor of your choice) and call into Ruff's linter and formatter crates to create real-time diagnostics or formatted code, which is then sent back to the client. It also tracks configuration files in your editor's workspace, and will refresh its in-memory configuration whenever those files are modified.

Contributing

If you're interested in contributing to ruff server - well, first of all, thank you! Second of all, you might find the contribution guide to be a useful resource. Finally, don't hesitate to reach out on our Discord if you have questions.