ruff/crates/ruff_server/src
Dhruv Manilawala ebe5b06c95
Use fallback settings when indexing the project (#12362)
## Summary

This PR updates the settings index building logic in the language server
to consider the fallback settings for applying ignore filters in
`WalkBuilder` and the exclusion via `exclude` / `extend-exclude`.

This flow matches the one in the `ruff` CLI where the root settings is
built by (1) finding the workspace setting in the ancestor directory (2)
finding the user configuration if that's missing and (3) fallback to
using the default configuration.

Previously, the index building logic was being executed before (2) and
(3). This PR reverses the logic so that the exclusion /
`respect_gitignore` is being considered from the default settings if
there's no workspace / user settings. This has the benefit that the
server no longer enters the `.git` directory or any other excluded
directory when a user opens a file in the home directory.

Related to #11366

## Test plan

Opened a test file from the home directory and confirmed with the debug
trace (removed in #12360) that the server excludes the `.git` directory
when indexing.
2024-07-18 09:16:45 +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 Use fallback settings when indexing the project (#12362) 2024-07-18 09:16:45 +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 Add supported commands in server capabilities (#11850) 2024-06-13 09:32:43 +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