-
Notifications
You must be signed in to change notification settings - Fork 640
Expose bind diags in LSP, show dead/deprecated code #955
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 surfaces bind errors in the LSP diagnostic stream and tags diagnostics marked as unnecessary or deprecated.
- Always include bind diagnostics alongside semantic diagnostics in
GetDocumentDiagnostics
- Introduce
ReportsUnnecessary
/ReportsDeprecated
flags onast.Diagnostic
and emit LSP tags - Add
ptrToSliceIfNonEmpty
helper for optional slice pointers
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
internal/ls/diagnostics.go | Combined bind + semantic diagnostics, added diagnostic tags, and updated slice handling |
internal/ast/diagnostic.go | Added boolean flags & accessors to propagate unnecessary/deprecated diagnostics |
Comments suppressed due to low confidence (1)
internal/ls/diagnostics.go:90
- Add or update unit tests to verify that diagnostics with
ReportsUnnecessary
andReportsDeprecated
produce the correct LSP tags in the output.
Tags: ptrToSliceIfNonEmpty(tags),
@@ -452,6 +456,39 @@ func (p *Program) getSemanticDiagnosticsForFile(ctx context.Context, sourceFile | |||
return filtered | |||
} | |||
|
|||
func (p *Program) getSuggestionDiagnosticsForFile(ctx context.Context, sourceFile *ast.SourceFile) []*ast.Diagnostic { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This all is pretty duplicative but I'm not about to attempt to refactor it into some generic version, honestly.
Fixes #941