Skip to content

Commit

Permalink
feat: hide ignore action if feature flag is off (#494)
Browse files Browse the repository at this point in the history
  • Loading branch information
bastiandoetsch committed Jul 23, 2024
1 parent fcea0e8 commit bfc5472
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/snyk/snykCode/codeActions/codeIssuesActionsProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ export class SnykCodeActionsProvider extends CodeActionsProvider<CodeIssueData>
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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down

0 comments on commit bfc5472

Please sign in to comment.