Skip to content

Commit

Permalink
Hide openapi code action if it is not applicable
Browse files Browse the repository at this point in the history
Fixes redhat-developer#280

signed-off-by: bensonn@ca.ibm.com
  • Loading branch information
benson-ning authored and angelozerr committed Mar 30, 2020
1 parent ee7c5b0 commit eed5a4b
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,9 @@ public List<? extends CodeAction> getCodeActions(JavaCodeActionContext context,
(TypeDeclaration) type, MicroProfileOpenAPIConstants.OPERATION_ANNOTATION, 0);
// Convert the proposal to LSP4J CodeAction
CodeAction codeAction = context.convertToCodeAction(proposal);
if (codeAction == null) { // Always show the code action
codeAction = new CodeAction(proposal.getName());
codeAction.setKind(proposal.getKind());
if (codeAction != null) {
codeActions.add(codeAction);
}
codeActions.add(codeAction);
}
}
return codeActions;
Expand Down

0 comments on commit eed5a4b

Please sign in to comment.