diff --git a/src/snyk/snykCode/codeActions/codeIssuesActionsProvider.ts b/src/snyk/snykCode/codeActions/codeIssuesActionsProvider.ts index 8a9ba081c..a47f924ea 100644 --- a/src/snyk/snykCode/codeActions/codeIssuesActionsProvider.ts +++ b/src/snyk/snykCode/codeActions/codeIssuesActionsProvider.ts @@ -29,9 +29,10 @@ export class SnykCodeActionsProvider extends CodeActionsProvider const ignoreIssueAction = this.createIgnoreIssueAction(document, issue, range, false); const fileIgnoreIssueAction = this.createIgnoreIssueAction(document, issue, range, true); - const actions = [openIssueAction, fileIgnoreIssueAction]; + const actions = [openIssueAction]; if (this.configuration.getFeatureFlag(FEATURE_FLAGS.snykCodeInlineIgnore)) { + actions.push(fileIgnoreIssueAction); actions.push(ignoreIssueAction); } diff --git a/src/test/unit/snykCode/codeActions/codeIssuesActionsProvider.test.ts b/src/test/unit/snykCode/codeActions/codeIssuesActionsProvider.test.ts index b0d11dbe2..18c5a9ad3 100644 --- a/src/test/unit/snykCode/codeActions/codeIssuesActionsProvider.test.ts +++ b/src/test/unit/snykCode/codeActions/codeIssuesActionsProvider.test.ts @@ -88,9 +88,8 @@ suite('Snyk Code actions provider', () => { const codeActions = issuesActionsProvider.provideCodeActions(document, {} as Range, {} as CodeActionContext); // verify - strictEqual(codeActions?.length, 2); + strictEqual(codeActions?.length, 1); strictEqual(codeActions[0].command?.command, SNYK_OPEN_ISSUE_COMMAND); - strictEqual(codeActions[1].command?.command, SNYK_IGNORE_ISSUE_COMMAND); }); test('Provides code actions, inline ignores enabled', () => {