File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change 47
47
"invalidselectstarexpansion" ,
48
48
"noselectstar" ,
49
49
"nomissingaudits" ,
50
+ "nomissingowner" ,
50
51
],
51
52
),
52
53
)
Original file line number Diff line number Diff line change @@ -421,12 +421,24 @@ def _diagnostic_to_lsp_diagnostic(
421
421
def _diagnostics_to_lsp_diagnostics (
422
422
diagnostics : t .List [AnnotatedRuleViolation ],
423
423
) -> t .List [types .Diagnostic ]:
424
- lsp_diagnostics : t .List [types .Diagnostic ] = []
424
+ """
425
+ Converts a list of AnnotatedRuleViolations to a list of LSP diagnostics. It will remove duplicates based on the message and range.
426
+ """
427
+ lsp_diagnostics = {}
425
428
for diagnostic in diagnostics :
426
429
lsp_diagnostic = SQLMeshLanguageServer ._diagnostic_to_lsp_diagnostic (diagnostic )
427
430
if lsp_diagnostic is not None :
428
- lsp_diagnostics .append (lsp_diagnostic )
429
- return lsp_diagnostics
431
+ # Create a unique key combining message and range
432
+ diagnostic_key = (
433
+ lsp_diagnostic .message ,
434
+ lsp_diagnostic .range .start .line ,
435
+ lsp_diagnostic .range .start .character ,
436
+ lsp_diagnostic .range .end .line ,
437
+ lsp_diagnostic .range .end .character ,
438
+ )
439
+ if diagnostic_key not in lsp_diagnostics :
440
+ lsp_diagnostics [diagnostic_key ] = lsp_diagnostic
441
+ return list (lsp_diagnostics .values ())
430
442
431
443
@staticmethod
432
444
def _uri_to_path (uri : str ) -> Path :
You can’t perform that action at this time.
0 commit comments