Skip to content

Commit

Permalink
fix: Bind status bar text with respective manifest path (#479)
Browse files Browse the repository at this point in the history
  • Loading branch information
arajkumar authored Jan 6, 2021
1 parent 4b67d03 commit 69ac2e8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/caStatusBarProvider.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

import { StatusBarItem, window, StatusBarAlignment } from "vscode";
import { StatusBarItem, window, StatusBarAlignment, Uri } from "vscode";
import { Disposable } from "vscode-languageclient";
import { StatusMessages } from "./statusMessages";
import { Commands } from "./commands";
Expand All @@ -12,11 +12,12 @@ class CAStatusBarProvider implements Disposable {
this.statusBarItem = window.createStatusBarItem(StatusBarAlignment.Left, 0);
}

public showSummary(text: string): void {
public showSummary(text: string, uri: string): void {
this.statusBarItem.text = text;
this.statusBarItem.command = {
title: StatusMessages.FULL_STACK_PROMPT_TEXT,
command: Commands.TRIGGER_FULL_STACK_ANALYSIS,
arguments: [Uri.parse(uri)]
};
this.statusBarItem.tooltip = StatusMessages.FULL_STACK_PROMPT_TEXT;
this.statusBarItem.show();
Expand Down
2 changes: 1 addition & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export function activate(context: vscode.ExtensionContext) {

lspClient.onNotification('caNotification', respData => {
const notification = new CANotification(respData);
caStatusBarProvider.showSummary(notification.statusText());
caStatusBarProvider.showSummary(notification.statusText(), notification.origin());
if (canShowPopup(notification)) {
showVulnerabilityFoundPrompt(notification.popupText());
// prevent further popups.
Expand Down

0 comments on commit 69ac2e8

Please sign in to comment.