Skip to content

Commit dc1432d

Browse files
authored
feat: link to dashboard from status bar (#255)
1 parent 4541bb8 commit dc1432d

File tree

3 files changed

+3
-69
lines changed

3 files changed

+3
-69
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@
156156
},
157157
{
158158
"command": "sourcery.hub.start",
159-
"title": "Open Sourcery Hub",
159+
"title": "Manage Sourcery account",
160160
"category": "Sourcery"
161161
},
162162
{

src/extension.ts

+2-32
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import {
2929
ServerOptions,
3030
URI,
3131
} from "vscode-languageclient/node";
32-
import { getHubSrc } from "./hub";
3332
import { RuleInputProvider } from "./rule-search";
3433
import { ScanResultProvider } from "./rule-search-results";
3534
import { ChatProvider } from "./chat";
@@ -94,7 +93,7 @@ function showSourceryStatusBarItem(context: ExtensionContext) {
9493
const myStatusBarItem = window.createStatusBarItem(StatusBarAlignment.Left);
9594
myStatusBarItem.command = "sourcery.hub.start";
9695
myStatusBarItem.text = "Sourcery";
97-
myStatusBarItem.tooltip = "Manage Sourcery settings";
96+
myStatusBarItem.tooltip = "Manage Sourcery account";
9897
context.subscriptions.push(myStatusBarItem);
9998
myStatusBarItem.show();
10099
}
@@ -471,39 +470,10 @@ function registerCommands(
471470
// This is activated from the status bar (see below)
472471
context.subscriptions.push(
473472
commands.registerCommand("sourcery.hub.start", async () => {
474-
// Instruct the language server to start the hub server
475-
// See `core/hub/app` and `core/binary/lsp/sourcery_ls`
476-
477473
languageClient.sendRequest(ExecuteCommandRequest.type, {
478-
command: "sourcery.startHub",
474+
command: "sourcery.openHub",
479475
arguments: [],
480476
});
481-
482-
// reopen the hub panel if it exists
483-
// otherwise create it
484-
if (hubWebviewPanel) {
485-
hubWebviewPanel.reveal();
486-
} else {
487-
// Open a webview panel and fill it with a static empty page
488-
// The iframe handles loading the actual content
489-
hubWebviewPanel = window.createWebviewPanel(
490-
"sourceryhub",
491-
"Sourcery Hub",
492-
ViewColumn.Active,
493-
{
494-
enableScripts: true,
495-
}
496-
);
497-
498-
hubWebviewPanel.webview.html = getHubSrc();
499-
hubWebviewPanel.onDidDispose(
500-
() => {
501-
hubWebviewPanel = undefined;
502-
},
503-
null,
504-
context.subscriptions
505-
);
506-
}
507477
})
508478
);
509479
}

src/hub.ts

-36
This file was deleted.

0 commit comments

Comments
 (0)