Skip to content

Commit

Permalink
Some clients don't send RelatedInformation inside `Capabilities.Tex…
Browse files Browse the repository at this point in the history
…tDocument.PublishDiagnostics`. Check for nil to avoid crashing on those.
  • Loading branch information
pherrymason committed Dec 3, 2024
1 parent 7cde89b commit 16d9818
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/internal/lsp/server/Initialize.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (s *Server) Initialize(serverName string, serverVersion string, capabilitie
s.RunDiagnostics(s.state, context.Notify, false)
}

if *params.Capabilities.TextDocument.PublishDiagnostics.RelatedInformation == false {
if params.Capabilities.TextDocument.PublishDiagnostics.RelatedInformation == nil || *params.Capabilities.TextDocument.PublishDiagnostics.RelatedInformation == false {
s.options.Diagnostics.Enabled = false
}

Expand Down

0 comments on commit 16d9818

Please sign in to comment.