Skip to content

Commit e98c328

Browse files
mitsauceplsdaveshanley
authored andcommitted
fix: language server diagnostics return empty list instead of null
1 parent b37e7d2 commit e98c328

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

language-server/server.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func NewServer(version string, lintRequest *utils.LintFileRequest) *ServerState
4747
lintRequest: lintRequest,
4848
documentStore: newDocumentStore(),
4949
}
50-
handler.Initialize = func(context *glsp.Context, params *protocol.InitializeParams) (interface{}, error) {
50+
handler.Initialize = func(context *glsp.Context, params *protocol.InitializeParams) (any, error) {
5151
if params.Trace != nil {
5252
protocol.SetTraceValue(*params.Trace)
5353
}
@@ -153,7 +153,7 @@ func (s *ServerState) runDiagnostic(doc *Document, notify glsp.NotifyFunc) {
153153
}
154154

155155
func ConvertResultsIntoDiagnostics(result *motor.RuleSetExecutionResult) []protocol.Diagnostic {
156-
var diagnostics []protocol.Diagnostic
156+
diagnostics := []protocol.Diagnostic{}
157157

158158
for _, vacuumResult := range result.Results {
159159
diagnostics = append(diagnostics, ConvertResultIntoDiagnostic(&vacuumResult))

0 commit comments

Comments
 (0)