diff --git a/package.json b/package.json index b9f36da..79ca39a 100644 --- a/package.json +++ b/package.json @@ -125,14 +125,14 @@ "key": "alt+insert", "mac": "cmd+n", "command": "editor.action.sourceAction", - "when": "editorTextFocus", + "when": "editorHasCodeActionsProvider && editorTextFocus && !editorReadonly", "intellij": "Generate code... (Getters, Setters, Constructors, hashCode/equals, toString)" }, { "key": "alt+insert", "mac": "cmd+n", "command": "workbench.action.files.newUntitledFile", - "when": "!editorTextFocus", + "when": "(!editorHasCodeActionsProvider && editorTextFocus) || !editorTextFocus", "intellij": "New..." }, { diff --git a/src/package-with-comment.json b/src/package-with-comment.json index 61e4842..4fdf4fa 100644 --- a/src/package-with-comment.json +++ b/src/package-with-comment.json @@ -162,14 +162,14 @@ "key": "alt+insert", "mac": "cmd+n", "command": "editor.action.sourceAction", - "when": "editorTextFocus", + "when": "editorHasCodeActionsProvider && editorTextFocus && !editorReadonly", "intellij": "Generate code... (Getters, Setters, Constructors, hashCode/equals, toString)" }, { "key": "alt+insert", "mac": "cmd+n", "command": "workbench.action.files.newUntitledFile", - "when": "!editorTextFocus", + "when": "(!editorHasCodeActionsProvider && editorTextFocus) || !editorTextFocus", "intellij": "New..." }, {