Skip to content

Commit 88f1193

Browse files
committed
chore: keep getCodeActions null-safe
1 parent ab4224e commit 88f1193

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/adapters/code-action-adapter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export default class CodeActionAdapter {
3939
editor: TextEditor,
4040
range: Range,
4141
diagnostics: atomIde.Diagnostic[]
42-
): Promise<atomIde.CodeAction[] | null> {
42+
): Promise<atomIde.CodeAction[]> {
4343
if (linterAdapter == null) {
4444
return []
4545
}
@@ -48,7 +48,7 @@ export default class CodeActionAdapter {
4848
const params = CodeActionAdapter.createCodeActionParams(linterAdapter, editor, range, diagnostics)
4949
const actions = await connection.codeAction(params)
5050
if (!actions) {
51-
return null
51+
return []
5252
}
5353
return actions.map((action) => CodeActionAdapter.createCodeAction(action, connection))
5454
}

0 commit comments

Comments
 (0)