refactor(lsp): move references to internal types#5039
Merged
Conversation
46872a9 to
4485ca1
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the LSP module to use internal types instead of external LSP protocol types for Position and Range. This prepares the code for moving some functionality to internal modules without dependencies on LSP-specific libraries.
- Replaces
lsprotocol.types.Positionandlsprotocol.types.Rangewithsqlmesh.core.linter.rule.Positionandsqlmesh.core.linter.rule.Range - Adds conversion functions between LSP and internal types at LSP boundaries
- Updates test files to use internal types
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
tests/lsp/test_reference_model_column_prefix.py |
Updates import to use internal Position type |
tests/lsp/test_reference_external_model.py |
Updates imports and removes LSP-specific helper usage |
tests/lsp/test_reference.py |
Updates import to use internal Position type |
sqlmesh/lsp/rename.py |
Adds conversion between LSP and internal types at function boundaries |
sqlmesh/lsp/reference.py |
Removes LSP type imports and conversion calls, uses internal types throughout |
sqlmesh/lsp/main.py |
Adds conversion between LSP and internal types at LSP protocol boundaries |
sqlmesh/core/linter/rule.py |
Adds comparison methods to internal Position class |
sqlmesh/core/linter/helpers.py |
Minor import reordering |
georgesittas
approved these changes
Jul 28, 2025
4485ca1 to
79bfd58
Compare
- in the hope of moving some of this code to internal without any dependencies on lsp code
79bfd58 to
ccc8725
Compare
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.
dependencies on lsp code