Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 22 additions & 21 deletions src/ecl/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { createDirectory, exists, writeFile } from "../util/fs";
import { ECLR_EN_US, matchTopics, SLR_EN_US } from "./docs";
import { SaveData } from "./saveData";
import { credentialManager } from "../util/credentialManager";
import { registerCommand, registerTextEditorCommand } from "../telemetry";

const IMPORT_MARKER = "//Import:";
const SKIP = localize("Skip");
Expand All @@ -26,27 +27,27 @@ export class ECLCommands {

private constructor(ctx: vscode.ExtensionContext) {
this._ctx = ctx;
ctx.subscriptions.push(vscode.commands.registerCommand("ecl.checkSyntax", this.checkSyntax, this));
ctx.subscriptions.push(vscode.commands.registerCommand("ecl.checkSyntaxAll", this.checkSyntaxAll, this));
ctx.subscriptions.push(vscode.commands.registerCommand("ecl.checkSyntaxClear", this.checkSyntaxClear, this));
ctx.subscriptions.push(vscode.commands.registerCommand("ecl.submit", this.submit, this));
ctx.subscriptions.push(vscode.commands.registerCommand("ecl.submitNoArchive", this.submitNoArchive, this));
ctx.subscriptions.push(vscode.commands.registerCommand("ecl.compile", this.compile, this));
ctx.subscriptions.push(vscode.commands.registerCommand("ecl.showLanguageReference", this.showLanguageReference, this));
ctx.subscriptions.push(vscode.commands.registerCommand("ecl.showStandardLibraryReference", this.showStandardLibraryReference, this));
ctx.subscriptions.push(vscode.commands.registerTextEditorCommand("ecl.searchTerm", this.searchTerm, this));
ctx.subscriptions.push(vscode.commands.registerCommand("ecl.showWUDetails", this.showWUDetails, this));
ctx.subscriptions.push(vscode.commands.registerCommand("ecl.selectCTVersion", selectCTVersion));
ctx.subscriptions.push(vscode.commands.registerCommand("ecl.openECLWatchExternal", this.openECLWatchExternal, this));
ctx.subscriptions.push(vscode.commands.registerCommand("ecl.saveResultAs", this.saveResultAs, this));
ctx.subscriptions.push(vscode.commands.registerCommand("ecl.openResult", this.openResult, this));
ctx.subscriptions.push(vscode.commands.registerCommand("ecl.browseResult", this.browseResult, this));
ctx.subscriptions.push(vscode.commands.registerCommand("ecl.insertRecordDef", this.insertRecordDef, this));
ctx.subscriptions.push(vscode.commands.registerCommand("ecl.sign", this.sign, this));
ctx.subscriptions.push(vscode.commands.registerCommand("ecl.verify", this.verify, this));
ctx.subscriptions.push(vscode.commands.registerCommand("ecl.importModFile", this.importModFile, this));
ctx.subscriptions.push(vscode.commands.registerCommand("ecl.copyAsEclID", this.copyAsEclID, this));
ctx.subscriptions.push(vscode.commands.registerCommand("ecl.clearStoredPasswords", this.clearStoredPasswords, this));
registerCommand(ctx, "ecl.checkSyntax", this.checkSyntax, this);
registerCommand(ctx, "ecl.checkSyntaxAll", this.checkSyntaxAll, this);
registerCommand(ctx, "ecl.checkSyntaxClear", this.checkSyntaxClear, this);
registerCommand(ctx, "ecl.submit", this.submit, this);
registerCommand(ctx, "ecl.submitNoArchive", this.submitNoArchive, this);
registerCommand(ctx, "ecl.compile", this.compile, this);
registerCommand(ctx, "ecl.showLanguageReference", this.showLanguageReference, this);
registerCommand(ctx, "ecl.showStandardLibraryReference", this.showStandardLibraryReference, this);
registerTextEditorCommand(ctx, "ecl.searchTerm", this.searchTerm, this);
registerCommand(ctx, "ecl.showWUDetails", this.showWUDetails, this);
registerCommand(ctx, "ecl.selectCTVersion", selectCTVersion);
registerCommand(ctx, "ecl.openECLWatchExternal", this.openECLWatchExternal, this);
registerCommand(ctx, "ecl.saveResultAs", this.saveResultAs, this);
registerCommand(ctx, "ecl.openResult", this.openResult, this);
registerCommand(ctx, "ecl.browseResult", this.browseResult, this);
registerCommand(ctx, "ecl.insertRecordDef", this.insertRecordDef, this);
registerCommand(ctx, "ecl.sign", this.sign, this);
registerCommand(ctx, "ecl.verify", this.verify, this);
registerCommand(ctx, "ecl.importModFile", this.importModFile, this);
registerCommand(ctx, "ecl.copyAsEclID", this.copyAsEclID, this);
registerCommand(ctx, "ecl.clearStoredPasswords", this.clearStoredPasswords, this);
}

static attach(ctx: vscode.ExtensionContext): ECLCommands {
Expand Down
3 changes: 2 additions & 1 deletion src/ecl/eclWatchPanelView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { wuDetailsUrl, wuResultUrl } from "../hpccplatform/launchConfig";
import { sessionManager } from "../hpccplatform/session";
import type { Messages } from "../eclwatch/messages";
import { credentialManager } from "../util/credentialManager";
import { registerCommand } from "../telemetry";

interface NavigateParams extends LaunchRequestArguments {
wuid: string;
Expand Down Expand Up @@ -37,7 +38,7 @@ export class ECLWatchPanelView implements vscode.WebviewViewProvider {
this.navigateTo(launchRequestArgs, undefined, undefined, false);
});

vscode.commands.registerCommand("ecl.watch.lite.openECLWatchExternal", async () => {
registerCommand(ctx, "ecl.watch.lite.openECLWatchExternal", async () => {
if (this._currParams) {
if (this._currParams.resultName === undefined) {
vscode.env.openExternal(vscode.Uri.parse(wuDetailsUrl(this._currParams, this._currParams.wuid)));
Expand Down
65 changes: 33 additions & 32 deletions src/ecl/eclWatchTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Item, Tree } from "./tree";
import { eclWatchPanelView } from "./eclWatchPanelView";
import { SaveData } from "./saveData";
import { formatWorkunitURL, formatResultURL, formatResultsURL, formatMetricsURL } from "./util";
import { registerCommand } from "../telemetry";

const PrevWeeks: string[] = [localize("Last Week"), localize("Two Weeks Ago"), localize("Three Weeks Ago"), localize("Four Weeks Ago"), localize("Five Weeks Ago"), localize("Six Weeks Ago"), localize("Seven Weeks Ago")];

Expand Down Expand Up @@ -48,132 +49,132 @@ export class ECLWatchTree extends Tree {
}
});

vscode.commands.registerCommand("hpccPlatform.myWorkunits", async () => {
registerCommand(ctx, "hpccPlatform.myWorkunits", async () => {
this._myWorkunits = false;
this.refresh();
});

vscode.commands.registerCommand("hpccPlatform.allWorkunits", async () => {
registerCommand(ctx, "hpccPlatform.allWorkunits", async () => {
this._myWorkunits = true;
this.refresh();
});

vscode.commands.registerCommand("hpccPlatform.userRefresh", () => {
registerCommand(ctx, "hpccPlatform.userRefresh", () => {
this.refresh();
});

vscode.commands.registerCommand("hpccPlatform.refresh", (element?: Item) => {
registerCommand(ctx, "hpccPlatform.refresh", (element?: Item) => {
this.refresh(element);
});

vscode.commands.registerCommand("hpccPlatform.openResults", (wuNode: ECLWUNode) => {
registerCommand(ctx, "hpccPlatform.openResults", (wuNode: ECLWUNode) => {
wuNode.openResults();
});

vscode.commands.registerCommand("hpccPlatform.browseResults", (wuNode: ECLWUNode) => {
registerCommand(ctx, "hpccPlatform.browseResults", (wuNode: ECLWUNode) => {
wuNode.browseResults();
});

vscode.commands.registerCommand("hpccPlatform.browseMetrics", (wuNode: ECLWUNode) => {
registerCommand(ctx, "hpccPlatform.browseMetrics", (wuNode: ECLWUNode) => {
wuNode.browseMetrics();
});

vscode.commands.registerCommand("hpccPlatform.browseWUDetails", (wuNode: ECLWUNode) => {
registerCommand(ctx, "hpccPlatform.browseWUDetails", (wuNode: ECLWUNode) => {
wuNode.browseWUDetails();
});

vscode.commands.registerCommand("hpccPlatform.openECL", (wuNode: ECLWUNode) => {
registerCommand(ctx, "hpccPlatform.openECL", (wuNode: ECLWUNode) => {
wuNode.openECL();
});

vscode.commands.registerCommand("hpccPlatform.copyWUID", (wuNode: ECLWUNode) => {
registerCommand(ctx, "hpccPlatform.copyWUID", (wuNode: ECLWUNode) => {
wuNode.copyWuid();
});

vscode.commands.registerCommand("hpccPlatform.saveWUResults", (wuNode: ECLWUNode) => {
registerCommand(ctx, "hpccPlatform.saveWUResults", (wuNode: ECLWUNode) => {
wuNode.saveWUResults();
});

vscode.commands.registerCommand("hpccPlatform.abortWU", (wuNode: ECLWUNode) => {
registerCommand(ctx, "hpccPlatform.abortWU", (wuNode: ECLWUNode) => {
wuNode.abort();
});

vscode.commands.registerCommand("hpccPlatform.resubmitWU", (wuNode: ECLWUNode) => {
registerCommand(ctx, "hpccPlatform.resubmitWU", (wuNode: ECLWUNode) => {
wuNode.resubmit();
});

vscode.commands.registerCommand("hpccPlatform.deleteWU", (wuNode: ECLWUNode) => {
registerCommand(ctx, "hpccPlatform.deleteWU", (wuNode: ECLWUNode) => {
wuNode.delete();
});

vscode.commands.registerCommand("hpccPlatform.protectWU", (wuNode: ECLWUNode) => {
registerCommand(ctx, "hpccPlatform.protectWU", (wuNode: ECLWUNode) => {
wuNode.protect();
});

vscode.commands.registerCommand("hpccPlatform.unprotectWU", (wuNode: ECLWUNode) => {
registerCommand(ctx, "hpccPlatform.unprotectWU", (wuNode: ECLWUNode) => {
wuNode.unprotect();
});

vscode.commands.registerCommand("hpccPlatform.moveJobUp", (wuNode: ECLWUNode) => {
registerCommand(ctx, "hpccPlatform.moveJobUp", (wuNode: ECLWUNode) => {
wuNode.moveJobUp();
});

vscode.commands.registerCommand("hpccPlatform.moveJobDown", (wuNode: ECLWUNode) => {
registerCommand(ctx, "hpccPlatform.moveJobDown", (wuNode: ECLWUNode) => {
wuNode.moveJobDown();
});

vscode.commands.registerCommand("hpccPlatform.moveJobBack", (wuNode: ECLWUNode) => {
registerCommand(ctx, "hpccPlatform.moveJobBack", (wuNode: ECLWUNode) => {
wuNode.moveJobBack();
});

vscode.commands.registerCommand("hpccPlatform.moveJobFront", (wuNode: ECLWUNode) => {
registerCommand(ctx, "hpccPlatform.moveJobFront", (wuNode: ECLWUNode) => {
wuNode.moveJobFront();
});
vscode.commands.registerCommand("hpccPlatform.setStateCompiled", (wuNode: ECLWUNode) => {
registerCommand(ctx, "hpccPlatform.setStateCompiled", (wuNode: ECLWUNode) => {
wuNode.setStateCompiled();
});

vscode.commands.registerCommand("hpccPlatform.setStateRunning", (wuNode: ECLWUNode) => {
registerCommand(ctx, "hpccPlatform.setStateRunning", (wuNode: ECLWUNode) => {
wuNode.setStateRunning();
});

vscode.commands.registerCommand("hpccPlatform.setStateCompleted", (wuNode: ECLWUNode) => {
registerCommand(ctx, "hpccPlatform.setStateCompleted", (wuNode: ECLWUNode) => {
wuNode.setStateCompleted();
});

vscode.commands.registerCommand("hpccPlatform.setStateFailed", (wuNode: ECLWUNode) => {
registerCommand(ctx, "hpccPlatform.setStateFailed", (wuNode: ECLWUNode) => {
wuNode.setStateFailed();
});

vscode.commands.registerCommand("hpccPlatform.setStateArchived", (wuNode: ECLWUNode) => {
registerCommand(ctx, "hpccPlatform.setStateArchived", (wuNode: ECLWUNode) => {
wuNode.setStateArchived();
});

vscode.commands.registerCommand("hpccPlatform.setStateAborting", (wuNode: ECLWUNode) => {
registerCommand(ctx, "hpccPlatform.setStateAborting", (wuNode: ECLWUNode) => {
wuNode.setStateAborting();
});

vscode.commands.registerCommand("hpccPlatform.setStateAborted", (wuNode: ECLWUNode) => {
registerCommand(ctx, "hpccPlatform.setStateAborted", (wuNode: ECLWUNode) => {
wuNode.setStateAborted();
});

vscode.commands.registerCommand("hpccPlatform.setStateBlocked", (wuNode: ECLWUNode) => {
registerCommand(ctx, "hpccPlatform.setStateBlocked", (wuNode: ECLWUNode) => {
wuNode.setStateBlocked();
});

vscode.commands.registerCommand("hpccPlatform.setStateSubmitted", (wuNode: ECLWUNode) => {
registerCommand(ctx, "hpccPlatform.setStateSubmitted", (wuNode: ECLWUNode) => {
wuNode.setStateSubmitted();
});

vscode.commands.registerCommand("hpccPlatform.setStateScheduled", (wuNode: ECLWUNode) => {
registerCommand(ctx, "hpccPlatform.setStateScheduled", (wuNode: ECLWUNode) => {
wuNode.setStateScheduled();
});

vscode.commands.registerCommand("hpccPlatform.setStateCompiling", (wuNode: ECLWUNode) => {
registerCommand(ctx, "hpccPlatform.setStateCompiling", (wuNode: ECLWUNode) => {
wuNode.setStateCompiling();
});

vscode.commands.registerCommand("hpccPlatform.setStateWait", (wuNode: ECLWUNode) => {
registerCommand(ctx, "hpccPlatform.setStateWait", (wuNode: ECLWUNode) => {
wuNode.setStateWait();
});

Expand Down
19 changes: 10 additions & 9 deletions src/ecl/hpccResources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { onDidClientToolsChange, switchClientTools } from "./clientTools";
import { Circle } from "./eclWatchTree";
import { eclTerminal } from "./terminal";
import { Tree, Item } from "./tree";
import { registerCommand } from "../telemetry";

let hpccResources: HPCCResources;

Expand All @@ -29,19 +30,19 @@ class Bundles extends Tree {
protected constructor(ctx: vscode.ExtensionContext) {
super(ctx, "hpccResources.bundles", false);

vscode.commands.registerCommand("hpccResources.bundles.homepage", (item: Item) => {
registerCommand(ctx, "hpccResources.bundles.homepage", (item: Item) => {
if (item instanceof BundlesItem) {
vscode.env.openExternal(vscode.Uri.parse(item.url()));
} else {
vscode.env.openExternal(vscode.Uri.parse("https://github.com/hpcc-systems/ecl-bundles"));
}
});

vscode.commands.registerCommand("hpccResources.bundles.refresh", () => {
registerCommand(ctx, "hpccResources.bundles.refresh", () => {
this.refresh();
});

vscode.commands.registerCommand("hpccResources.bundles.install", (item: Item) => {
registerCommand(ctx, "hpccResources.bundles.install", (item: Item) => {
if (item instanceof BundlesItem) {
this._treeView.title = `${localize("Installing")}...`;
item.install().then(response => {
Expand All @@ -54,7 +55,7 @@ class Bundles extends Tree {
}
});

vscode.commands.registerCommand("hpccResources.bundles.uninstall", (item: Item) => {
registerCommand(ctx, "hpccResources.bundles.uninstall", (item: Item) => {
if (item instanceof BundlesItem) {
this._treeView.title = `${localize("Uninstalling")}...`;
item.uninstall().then(response => {
Expand Down Expand Up @@ -134,28 +135,28 @@ class ClientToolsTree extends Tree {
this.refresh();
});

vscode.commands.registerCommand("hpccResources.clientTools.homepage", () => {
registerCommand(ctx, "hpccResources.clientTools.homepage", () => {
vscode.env.openExternal(vscode.Uri.parse("https://hpccsystems.com/download"));
});

vscode.commands.registerCommand("hpccResources.clientTools.refresh", () => {
registerCommand(ctx, "hpccResources.clientTools.refresh", () => {
clearAllClientToolsCache();
this.refresh();
});

vscode.commands.registerCommand("hpccResources.clientTools.activate", (item: Item) => {
registerCommand(ctx, "hpccResources.clientTools.activate", (item: Item) => {
if (item instanceof ClientToolsItem) {
switchClientTools(item.clientTools);
}
});

vscode.commands.registerCommand("hpccResources.clientTools.deactivate", (item: Item) => {
registerCommand(ctx, "hpccResources.clientTools.deactivate", (item: Item) => {
if (item instanceof ClientToolsItem) {
switchClientTools();
}
});

vscode.commands.registerCommand("hpccResources.clientTools.terminal", (item: Item) => {
registerCommand(ctx, "hpccResources.clientTools.terminal", (item: Item) => {
if (item instanceof ClientToolsItem) {
eclTerminal(item.clientTools);
}
Expand Down
26 changes: 14 additions & 12 deletions src/ecl/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { HPCCResources } from "./hpccResources";
import { ECLChat } from "./lm/chat";
import { ECLLMTools } from "./lm/tools";
import { SessionManager } from "../hpccplatform/session";
import { logActivation, logEvent } from "../telemetry";

const eclConfig = vscode.workspace.getConfiguration("ecl");
initLogger(eclConfig.get<boolean>("debugLogging") ? Level.debug : Level.info);
Expand All @@ -21,27 +22,28 @@ const logger = scopedLogger("ecl/main.ts");

export function activate(ctx: vscode.ExtensionContext): void {
logger.debug("Activating SessionManager");
SessionManager.attach(ctx);
logActivation("ecl.SessionManager", () => SessionManager.attach(ctx));
logger.debug("Activating ECLDiagnostic");
ECLDiagnostic.attach(ctx);
logActivation("ecl.ECLDiagnostic", () => ECLDiagnostic.attach(ctx));
logger.debug("Activating ECLCommands");
ECLCommands.attach(ctx);
logActivation("ecl.ECLCommands", () => ECLCommands.attach(ctx));
logger.debug("Activating ECLEditor");
ECLEditor.attach(ctx);
logActivation("ecl.ECLEditor", () => ECLEditor.attach(ctx));
logger.debug("Activating ECLStatusBar");
ECLStatusBar.attach(ctx);
logActivation("ecl.ECLStatusBar", () => ECLStatusBar.attach(ctx));
logger.debug("Activating ECLDocumentSymbolProvider");
ECLDocumentSymbolProvider.attach(ctx);
logActivation("ecl.ECLDocumentSymbolProvider", () => ECLDocumentSymbolProvider.attach(ctx));
logger.debug("Activating ECLWatchTree");
ECLWatchTree.attach(ctx);
logActivation("ecl.ECLWatchTree", () => ECLWatchTree.attach(ctx));
logger.debug("Activating ECLWatchPanelView");
ECLWatchPanelView.attach(ctx);
logActivation("ecl.ECLWatchPanelView", () => ECLWatchPanelView.attach(ctx));
logger.debug("Activating ECLTerminal");
ECLTerminal.attach(ctx);
logActivation("ecl.ECLTerminal", () => ECLTerminal.attach(ctx));
logger.debug("Activating HPCCResources");
HPCCResources.attach(ctx);
logActivation("ecl.HPCCResources", () => HPCCResources.attach(ctx));
logger.debug("Activating Chat");
ECLChat.attach(ctx);
logActivation("ecl.Chat", () => ECLChat.attach(ctx));
logger.debug("Activating LM Tools");
ECLLMTools.attach(ctx);
logActivation("ecl.LMTools", () => ECLLMTools.attach(ctx));
logEvent("ecl.activated");
}
5 changes: 3 additions & 2 deletions src/ecl/terminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { ClientTools } from "@hpcc-js/comms";
import * as vscode from "vscode";
import * as os from "os";
import { sessionManager } from "../hpccplatform/session";
import { registerCommand } from "../telemetry";

const PATH_SEP = os.platform() === "win32" ? ";" : ":";

Expand All @@ -22,13 +23,13 @@ export class ECLTerminal {

private constructor(ctx: vscode.ExtensionContext) {
this._ctx = ctx;
ctx.subscriptions.push(vscode.commands.registerCommand("ecl.createTerminal", () => {
registerCommand(ctx, "ecl.createTerminal", () => {
sessionManager.bestClientTools().then(clientTools => {
return clientTools.version().then(() => clientTools);
}).then((clientTools) => {
eclTerminal(clientTools);
});
}));
});
}

static attach(ctx: vscode.ExtensionContext): ECLTerminal {
Expand Down
Loading
Loading