Skip to content

Commit b83344b

Browse files
committed
chore: do not convert boolean just to compare with null
1 parent 987d5bd commit b83344b

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

lib/adapters/code-action-adapter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export default class CodeActionAdapter {
4747

4848
const params = CodeActionAdapter.createCodeActionParams(linterAdapter, editor, range, diagnostics)
4949
const actions = await connection.codeAction(params)
50-
if (!actions) {
50+
if (actions === null) {
5151
return []
5252
}
5353
return actions.map((action) => CodeActionAdapter.createCodeAction(action, connection))

lib/adapters/code-highlight-adapter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default class CodeHighlightAdapter {
2727
): Promise<Range[]> {
2828
assert(serverCapabilities.documentHighlightProvider, "Must have the documentHighlight capability")
2929
const highlights = await connection.documentHighlight(Convert.editorToTextDocumentPositionParams(editor, position))
30-
if (!highlights) {
30+
if (highlights === null) {
3131
return []
3232
}
3333
return highlights.map((highlight) => {

lib/adapters/outline-view-adapter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export default class OutlineViewAdapter {
3838
connection.documentSymbol({ textDocument: Convert.editorToTextDocumentIdentifier(editor) }, cancellationToken)
3939
)
4040

41-
if (!results || results.length === 0) {
41+
if (results === null || results.length === 0) {
4242
return {
4343
outlineTrees: [],
4444
}

0 commit comments

Comments
 (0)