Skip to content

Commit a80e4d9

Browse files
committed
fix: make highlight null-safe
1 parent 88f1193 commit a80e4d9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/adapters/code-highlight-adapter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ export default class CodeHighlightAdapter {
2424
serverCapabilities: ServerCapabilities,
2525
editor: TextEditor,
2626
position: Point
27-
): Promise<Range[] | null> {
27+
): Promise<Range[]> {
2828
assert(serverCapabilities.documentHighlightProvider, "Must have the documentHighlight capability")
2929
const highlights = await connection.documentHighlight(Convert.editorToTextDocumentPositionParams(editor, position))
3030
if (!highlights) {
31-
return null
31+
return []
3232
}
3333
return highlights.map((highlight) => {
3434
return Convert.lsRangeToAtomRange(highlight.range)

0 commit comments

Comments
 (0)