Skip to content

refactor(lsp): move references to internal types#5039

Merged
benfdking merged 1 commit intomainfrom
working_on_moving_reference
Jul 28, 2025
Merged

refactor(lsp): move references to internal types#5039
benfdking merged 1 commit intomainfrom
working_on_moving_reference

Conversation

@benfdking
Copy link
Contributor

@benfdking benfdking commented Jul 28, 2025

  • in the hope of moving some of this code to internal without any
    dependencies on lsp code

@benfdking benfdking force-pushed the working_on_moving_reference branch 2 times, most recently from 46872a9 to 4485ca1 Compare July 28, 2025 10:00
@benfdking benfdking marked this pull request as ready for review July 28, 2025 10:00
@benfdking benfdking requested a review from Copilot July 28, 2025 10:02
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.Position and lsprotocol.types.Range with sqlmesh.core.linter.rule.Position and sqlmesh.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

@benfdking benfdking force-pushed the working_on_moving_reference branch from 4485ca1 to 79bfd58 Compare July 28, 2025 10:04
- in the hope of moving some of this code to internal without any
  dependencies on lsp code
@benfdking benfdking force-pushed the working_on_moving_reference branch from 79bfd58 to ccc8725 Compare July 28, 2025 10:05
@benfdking benfdking enabled auto-merge (squash) July 28, 2025 10:18
@benfdking benfdking merged commit 00a0c50 into main Jul 28, 2025
26 of 27 checks passed
@benfdking benfdking deleted the working_on_moving_reference branch July 28, 2025 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants