Skip to content

Commit

Permalink
fix: Snyk Code fix not opening up in editor (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
michelkaporin authored Dec 1, 2021
1 parent 4281a72 commit 9ec1ba6
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/snyk/snykCode/codeActions/issuesActionsProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/* eslint-disable no-param-reassign */
/* eslint-disable @typescript-eslint/ban-types */
import { IAnalytics } from '../../common/analytics/itly';
import { OpenCommandIssueType, OpenIssueCommandArg } from '../../common/commands/types';
import { SNYK_IGNORE_ISSUE_COMMAND, SNYK_OPEN_ISSUE_COMMAND } from '../../common/constants/commands';
import { IDE_NAME } from '../../common/constants/general';
import { ICodeActionAdapter, ICodeActionKindAdapter } from '../../common/vscode/codeAction';
Expand All @@ -16,6 +17,7 @@ import {
} from '../../common/vscode/types';
import { FILE_IGNORE_ACTION_NAME, IGNORE_ISSUE_ACTION_NAME, SHOW_ISSUE_ACTION_NAME } from '../constants/analysis';
import { IssueUtils } from '../utils/issueUtils';
import { CodeIssueCommandArg } from '../views/interfaces';

export class SnykIssuesActionProvider implements CodeActionProvider {
private readonly providedCodeActionKinds = [this.codeActionKindProvider.getQuickFix()];
Expand Down Expand Up @@ -79,7 +81,16 @@ export class SnykIssuesActionProvider implements CodeActionProvider {
showIssueAction.command = {
command: SNYK_OPEN_ISSUE_COMMAND,
title: SNYK_OPEN_ISSUE_COMMAND,
arguments: [matchedIssue.message, document.uri, matchedIssue.range, null],
arguments: [
{
issueType: OpenCommandIssueType.CodeIssue,
issue: {
message: matchedIssue.message,
uri: document.uri,
range: matchedIssue.range,
} as CodeIssueCommandArg,
} as OpenIssueCommandArg,
],
};

return showIssueAction;
Expand Down

0 comments on commit 9ec1ba6

Please sign in to comment.