[ty] Handle configuration errors in LSP more gracefully#19262
Merged
MichaReiser merged 2 commits intomainfrom Jul 14, 2025
Merged
[ty] Handle configuration errors in LSP more gracefully#19262MichaReiser merged 2 commits intomainfrom
MichaReiser merged 2 commits intomainfrom
Conversation
Contributor
|
CodSpeed Instrumentation Performance ReportMerging #19262 will not alter performanceComparing Summary
|
Member
Yeah, I think we need to as this behavior has proven to be confusing to some users: astral-sh/ruff-vscode#711 |
dhruvmanila
approved these changes
Jul 14, 2025
e443d6c to
7e039f8
Compare
0de50c6 to
2e35bfd
Compare
7e039f8 to
f2bba75
Compare
dcreager
added a commit
that referenced
this pull request
Jul 14, 2025
* dcreager/merge-arguments: (223 commits) fix docs Combine CallArguments and CallArgumentTypes [ty] Sync vendored typeshed stubs (#19334) [`refurb`] Make example error out-of-the-box (`FURB122`) (#19297) [refurb] Make example error out-of-the-box (FURB177) (#19309) [ty] ignore errors when reformatting codemodded typeshed (#19332) [ty] Provide docstrings for stdlib APIs when hovering over them in an IDE (#19311) [ty] Add virtual files to the only project database (#19322) Add t-string fixtures for rules that do not need to be modified (#19146) [ty] Remove `FileLookupError` (#19323) [ty] Fix handling of metaclasses in `object.<CURSOR>` completions [ty] Use an interval map for scopes by expression (#19025) [ty] List all `enum` members (#19283) [ty] Handle configuration errors in LSP more gracefully (#19262) [ty] Use python version and path from Python extension (#19012) [`pep8_naming`] Avoid false positives on standard library functions with uppercase names (`N802`) (#18907) Update Rust crate toml to 0.9.0 (#19320) [ty] Fix server version (#19284) Update NPM Development dependencies (#19319) Update taiki-e/install-action action to v2.56.13 (#19317) ...
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
Up to now, ty crashed if the project configuration contained invalid syntax are was invalid otherwise.
This PR handles this case more gracefully by showing an error popup and falling back to the default settings.
We probably want to mark the database as "in an error state" in the future when the LSP offers more destructive operations
like formatting so that these can be disabled until the configuration errors are resolved.
Closes astral-sh/ty#76
Test Plan
Screen.Recording.2025-07-10.at.15.22.58.mov