ruff/crates/ruff_server/src
Dhruv Manilawala 2e77b775b0
Consider --preview flag for server subcommand (#12208)
## Summary

This PR removes the requirement of `--preview` flag to run the `ruff
server` and instead considers it to be an indicator to turn on preview
mode for the linter and the formatter.

resolves: #12161 

## Test Plan

Add test cases to assert the `preview` value is updated accordingly.

In an editor context, I used the local `ruff` executable in Neovim with
the `--preview` flag and verified that the preview-only violations are
being highlighted.

Running with:
```lua
require('lspconfig').ruff.setup({
  cmd = {
    '/Users/dhruv/work/astral/ruff/target/debug/ruff',
    'server',
    '--preview',
  },
})
```
The screenshot shows that `E502` is highlighted with the below config in
`pyproject.toml`:

<img width="877" alt="Screenshot 2024-07-17 at 16 43 09"
src="https://github.com/user-attachments/assets/c7016ef3-55b1-4a14-bbd3-a07b1bcdd323">
2024-07-18 11:05:01 +05:30
..
edit Consider the content of the new cells during notebook sync (#12203) 2024-07-05 17:10:00 +05:30
server Conside include, extend-include for the native server (#12252) 2024-07-10 04:12:57 +00:00
session Consider --preview flag for server subcommand (#12208) 2024-07-18 11:05:01 +05:30
edit.rs Add Jupyter Notebook document change snapshot test (#11944) 2024-06-21 05:29:27 +00:00
fix.rs Conside include, extend-include for the native server (#12252) 2024-07-10 04:12:57 +00: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 Conside include, extend-include for the native server (#12252) 2024-07-10 04:12:57 +00:00
lint.rs Conside include, extend-include for the native server (#12252) 2024-07-10 04:12:57 +00:00
message.rs ruff server: Tracing system now respects log level and trace level, with options to log to a file (#11747) 2024-06-11 11:29:47 -07:00
resolve.rs Conside include, extend-include for the native server (#12252) 2024-07-10 04:12:57 +00:00
server.rs Consider --preview flag for server subcommand (#12208) 2024-07-18 11:05:01 +05:30
session.rs Add Jupyter Notebook document change snapshot test (#11944) 2024-06-21 05:29:27 +00:00
trace.rs ruff server: Support the usage of tildes and environment variables in logFile (#11945) 2024-06-20 18:51:46 +00:00