From 57ff84df5eddb089653923385f93315c42ba88a9 Mon Sep 17 00:00:00 2001 From: kasecato Date: Mon, 19 Sep 2022 15:01:24 +0900 Subject: [PATCH] Fixed #265 that is the notice 'No source actions available' --- package.json | 4 ++-- src/package-with-comment.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index a4a25de..ae286a5 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 36c485d..8638fe8 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..." }, {