Conversation
- This change builds the building block to the linter to return violations whose fixes affect other files. - This is in preparation for the change where nomissingexternalmodels can add a fix that will add the model to the external models
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR extends the linter functionality to support fixes that can affect multiple files, not just the file being linted. This is a breaking change that adds a required path field to the TextEdit class and updates the LSP context to handle workspace edits across multiple files.
- Added
pathfield toTextEditclass to specify which file should be modified - Updated LSP context to group text edits by file URI and create workspace edits that can span multiple files
- Modified existing linter rule to include the model path when creating fixes
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| sqlmesh/core/linter/rule.py | Added required path field to TextEdit dataclass |
| sqlmesh/lsp/context.py | Updated code action creation to group edits by file and support multi-file workspace edits |
| sqlmesh/core/linter/rules/builtin.py | Added path extraction and validation when creating fixes for the SELECT * rule |
1 task
izeigerman
approved these changes
Jul 29, 2025
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.
fixes affect other files.
that will add the model to the external models