Skip to content

Conversation

@MichaReiser
Copy link
Member

Summary

  • Add logging when the LSP ignores request
  • Return an error response when the method isn't supported (instead of silently ignoring the message). r-a does the same
  • Make db the first argument for request handlers
  • Pass db by reference. This avoids the annoying &db in request handlers

Test Plan

cargo build

@MichaReiser MichaReiser added server Related to the LSP server ty Multi-file analysis & type inference internal An internal refactor or improvement labels May 19, 2025
@MichaReiser MichaReiser enabled auto-merge (squash) May 19, 2025 17:06
@github-actions
Copy link
Contributor

mypy_primer results

No ecosystem changes detected ✅

@MichaReiser MichaReiser merged commit ac5df56 into main May 19, 2025
31 checks passed
@MichaReiser MichaReiser deleted the micha/lsp-refactor branch May 19, 2025 17:09
@AlexWaygood AlexWaygood removed their request for review May 19, 2025 17:09
dcreager added a commit that referenced this pull request May 19, 2025
…rals

* origin/main:
  [ty] Add hint that PEP 604 union syntax is only available in 3.10+ (#18192)
  Unify `Message` variants (#18051)
  [`airflow`] Update `AIR301` and `AIR311` with the latest Airflow implementations (#17985)
  [`airflow`] Move rules from `AIR312` to `AIR302` (#17940)
  [ty] Small LSP cleanups (#18201)
  [ty] Show related information in diagnostic (#17359)
  Default `src.root` to `['.', '<project_name>']` if the directory exists (#18141)
@MichaReiser
Copy link
Member Author

Using a db ref is also more correct. We otherwise allow request handlers to call mutable db methods which we don't want to

dcreager added a commit that referenced this pull request May 19, 2025
* main:
  [ty] Use first matching constructor overload when inferring specializations (#18204)
  [ty] Add hint that PEP 604 union syntax is only available in 3.10+ (#18192)
  Unify `Message` variants (#18051)
  [`airflow`] Update `AIR301` and `AIR311` with the latest Airflow implementations (#17985)
  [`airflow`] Move rules from `AIR312` to `AIR302` (#17940)
  [ty] Small LSP cleanups (#18201)
  [ty] Show related information in diagnostic (#17359)
  Default `src.root` to `['.', '<project_name>']` if the directory exists (#18141)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal An internal refactor or improvement server Related to the LSP server ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants