Avoid indexing the project if configurationPreference is editorOnly#16381
Merged
dhruvmanila merged 3 commits intoastral-sh:mainfrom Feb 27, 2025
Merged
Avoid indexing the project if configurationPreference is editorOnly#16381dhruvmanila merged 3 commits intoastral-sh:mainfrom
configurationPreference is editorOnly#16381dhruvmanila merged 3 commits intoastral-sh:mainfrom
Conversation
Contributor
|
dhruvmanila
requested changes
Feb 26, 2025
Member
dhruvmanila
left a comment
There was a problem hiding this comment.
Thanks for taking a look at this. I think we should avoid considering the user settings and only use the default configuration.
Introduce a dedicated `editor_only` method to avoid considering user defined settings when configuration preference is EditorOnly.
dhruvmanila
approved these changes
Feb 27, 2025
Member
dhruvmanila
left a comment
There was a problem hiding this comment.
Thank you! I made couple of tweaks:
- Changed the debug message to include the workspace path
- Used
.ok().map(...)instead of explicitmatchinfallback
configurationPreference is editorOnly
configurationPreference is editorOnlyconfigurationPreference is editorOnly
dcreager
added a commit
that referenced
this pull request
Feb 28, 2025
* main: [red-knot] Switch to a handwritten parser for mdtest error assertions (#16422) [red-knot] Disallow more invalid type expressions (#16427) Bump version to Ruff 0.9.9 (#16434) Check `LinterSettings::preview` for version-related syntax errors (#16429) Avoid caching files with unsupported syntax errors (#16425) Prioritize "bug" label for changelog sections (#16433) [`flake8-copyright`] Add links to applicable options (`CPY001`) (#16421) Fix string-length limit in documentation for PYI054 (#16432) Show version-related syntax errors in the playground (#16419) Allow passing `ParseOptions` to inline tests (#16357) Bump version to 0.9.8 (#16414) [red-knot] Ignore surrounding whitespace when looking for `<!-- snapshot-diagnostics -->` directives in mdtests (#16380) Notify users for invalid client settings (#16361) Avoid indexing the project if `configurationPreference` is `editorOnly` (#16381)
dcreager
added a commit
that referenced
this pull request
Feb 28, 2025
* dcreager/alist-type: Remove unneeded shear override Update property test CI Move alist into red_knot_python_semantic [red-knot] Switch to a handwritten parser for mdtest error assertions (#16422) [red-knot] Disallow more invalid type expressions (#16427) Bump version to Ruff 0.9.9 (#16434) Check `LinterSettings::preview` for version-related syntax errors (#16429) Avoid caching files with unsupported syntax errors (#16425) Prioritize "bug" label for changelog sections (#16433) [`flake8-copyright`] Add links to applicable options (`CPY001`) (#16421) Fix string-length limit in documentation for PYI054 (#16432) Show version-related syntax errors in the playground (#16419) Allow passing `ParseOptions` to inline tests (#16357) Bump version to 0.9.8 (#16414) [red-knot] Ignore surrounding whitespace when looking for `<!-- snapshot-diagnostics -->` directives in mdtests (#16380) Notify users for invalid client settings (#16361) Avoid indexing the project if `configurationPreference` is `editorOnly` (#16381)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes: #16267
This change skips building the
indexin RuffSettingsIndex when the configuration preference, in the editor settings, is set toeditorOnly. This is appropriate due to the fact that the indexes will go unused as long as the configuration preference persists.Test Plan
I have tested this in VSCode and can confirm that we skip indexing when
editorOnlyis set. Upon switching back toeditorFirstorfilesystemFirstwe index the settings as normal.I don't seen any unit tests for setting indexing at the moment, but I am happy to give it a shot if that is something we want.