Skip to content

Commit

Permalink
Use Safety.let instead of null check
Browse files Browse the repository at this point in the history
  • Loading branch information
kLabz committed Jan 8, 2025
1 parent 2af526d commit e9902fa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/haxeLanguageServer/features/haxe/DiagnosticsFeature.hx
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,10 @@ class DiagnosticsFeature {
message: hxDiag.kind.getMessage(doc, hxDiag.args, range),
data: {kind: hxDiag.kind},
relatedInformation: hxDiag.relatedInformation?.map(rel -> {
location: rel.location == null ? null : {
uri: rel.location.file.toUri(),
range: rel.location.range,
},
location: Safety.let(rel.location, location -> {
uri: location.file.toUri(),
range: location.range,
}),
message: convertIndentation(rel.message, rel.depth)
})
}
Expand Down

0 comments on commit e9902fa

Please sign in to comment.