Skip to content

feat(lsp): references function now detects non registered external models#5023

Merged
benfdking merged 1 commit intomainfrom
add_unregistered_external_models_to_lsp
Jul 25, 2025
Merged

feat(lsp): references function now detects non registered external models#5023
benfdking merged 1 commit intomainfrom
add_unregistered_external_models_to_lsp

Conversation

@benfdking
Copy link
Contributor

No description provided.

@benfdking benfdking force-pushed the add_unregistered_external_models_to_lsp branch from 0a989a2 to 15e226f Compare July 25, 2025 14:40
@benfdking benfdking requested a review from Copilot July 25, 2025 14:40
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 enhances the LSP references function to detect and handle unregistered external models that are not defined in the configuration files. Previously, the system would ignore references to external models that weren't registered, but now it creates specific reference objects for these unregistered models.

  • Added support for detecting unregistered external models as LSP references
  • Made the uri field optional in LSPExternalModelReference to accommodate unregistered models
  • Updated LSP handlers to handle references with null URIs appropriately

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
sqlmesh/lsp/reference.py Made uri field optional in LSPExternalModelReference and added logic to create references for unregistered external models
sqlmesh/lsp/main.py Updated goto_definition and find_references handlers to check for null URIs before processing
tests/lsp/test_reference_external_model.py Added test for unregistered external model detection and updated existing test to handle optional URI
tests/lsp/test_reference.py Updated test assertions to handle optional URI field
Comments suppressed due to low confidence (1)

tests/lsp/test_reference_external_model.py:50

  • The function name 'test' is too generic and doesn't describe what it tests. Consider renaming it to 'test_reference_unregistered_external_model' to be more descriptive.
def test(tmp_path: Path):

@benfdking benfdking force-pushed the add_unregistered_external_models_to_lsp branch from 15e226f to 9949faf Compare July 25, 2025 14:44
@benfdking benfdking merged commit 51481b2 into main Jul 25, 2025
27 checks passed
@benfdking benfdking deleted the add_unregistered_external_models_to_lsp branch July 25, 2025 15:16
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