Skip to content
Merged
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
29 changes: 21 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,7 @@
"category": "ECL",
"title": "%Switch HPCC Platform%",
"description": "%Switch to different HPCC Platform instance%",
"tooltip": "%Switch HPCC Platform (shows current)%",
"icon": {
"light": "resources/light/server-process.svg",
"dark": "resources/dark/server-process.svg"
Expand All @@ -656,6 +657,8 @@
"category": "ECL",
"title": "%Switch Target Cluster%",
"description": "%Switch Target Cluster%",
"tooltip": "%Switch Target Cluster (shows current)%",
"icon": "$(server-environment)",
"enablement": "ecl.connected"
},
{
Expand Down Expand Up @@ -964,27 +967,27 @@
{
"when": "resourceLangId == ecl && resourceExtname == .ecl",
"command": "ecl.submit",
"group": "navigation@900"
"group": "ecl@1"
},
{
"when": "resourceLangId == ecl && resourceExtname == .ecl",
"command": "ecl.submitNoArchive",
"group": "navigation@900"
"group": "ecl@2"
},
{
"when": "resourceLangId == ecl && resourceExtname == .ecl",
"command": "ecl.compile",
"group": "navigation@910"
"group": "ecl@3"
},
{
"when": "resourceLangId == ecl && resourceExtname == .ecl",
"command": "ecl.checkSyntax",
"group": "navigation@920"
"group": "ecl@4"
},
{
"when": "resourceLangId == ecl && resourceExtname == .ecl",
"command": "ecl.insertRecordDef",
"group": "navigation@930"
"group": "ecl@5"
},
{
"when": "resourceLangId == kel && resourceExtname == .kel",
Expand Down Expand Up @@ -1020,18 +1023,28 @@
},
{
"when": "resourceLangId == ecl",
"command": "ecl.checkSyntax",
"command": "ecl.submit",
"group": "navigation@900"
},
{
"when": "resourceLangId == ecl",
"command": "ecl.submit",
"command": "ecl.compile",
"group": "navigation@910"
},
{
"when": "resourceLangId == ecl",
"command": "ecl.compile",
"command": "ecl.checkSyntax",
"group": "navigation@920"
},
{
"when": "resourceLangId == ecl",
"command": "hpccPlatform.switch",
"group": "navigation@930"
},
{
"when": "resourceLangId == ecl && ecl.connected",
"command": "hpccPlatform.switchTargetCluster",
"group": "navigation@940"
}
],
"editor/title/context": [
Expand Down
2 changes: 1 addition & 1 deletion package.nls.es.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"Homepage": "Página principal",
"HPCC Platform": "Plataforma HPCC",
"HPCC Platform Launch Configuration": "Configuración de lanzamiento de la plataforma HPCC",
"HPCC Platform TargetCluster": "Sistemas de destino de la plataforma HPCC",
"HPCC Platform Target Cluster": "Sistemas de destino de la plataforma HPCC",
"Import '.mod' file": "Importar archivo '.mod'",
"Import ECL '.mod' file": "Importar archivo ECL '.mod'",
"Insert logical file record definition": "Insertar definición de registro de archivo lógico",
Expand Down
2 changes: 1 addition & 1 deletion package.nls.fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"Homepage": "Page d'accueil",
"HPCC Platform": "HPCC Platform",
"HPCC Platform Launch Configuration": "Configuration de lancement de la plateforme HPCC",
"HPCC Platform TargetCluster": "Plateforme HPCC TargetCluster",
"HPCC Platform Target Cluster": "Plateforme HPCC TargetCluster",
"Import '.mod' file": "Importez le fichier '.mod'",
"Import ECL '.mod' file": "Importez le fichier ECL '.mod'",
"Insert logical file record definition": "Insérez une définition d'enregistrement de fichier logique",
Expand Down
2 changes: 2 additions & 0 deletions package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@
"Submit small ECL snippet and return WUID": "Submit small ECL snippet and return WUID",
"Submitted": "Submitted",
"Switch HPCC Platform": "Switch HPCC Platform",
"Switch HPCC Platform (shows current)": "Switch HPCC Platform (shows current)",
"Switch Target Cluster": "Switch Target Cluster",
"Switch Target Cluster (shows current)": "Switch Target Cluster (shows current)",
"Switch to different HPCC Platform instance": "Switch to different HPCC Platform instance",
"Syntax Check": "Syntax Check",
"Syntax Check all files": "Syntax Check all files",
Expand Down
2 changes: 1 addition & 1 deletion package.nls.pt-br.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"Homepage": "Pagina inicial",
"HPCC Platform": "Plataforma HPCC",
"HPCC Platform Launch Configuration": "Configuração de inicialização da plataforma HPCC",
"HPCC Platform TargetCluster": "Cluster de destino da plataforma HPCC",
"HPCC Platform Target Cluster": "Cluster de destino da plataforma HPCC",
"Import '.mod' file": "Importar arquivo '.mod'",
"Import ECL '.mod' file": "Importar arquivo ECL '.mod'",
"Insert logical file record definition": "Inserir definição de registro de arquivo lógico",
Expand Down
2 changes: 1 addition & 1 deletion package.nls.zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"Homepage": "主页",
"HPCC Platform": "高性能计算平台",
"HPCC Platform Launch Configuration": "HPCC平台的启动配置",
"HPCC Platform TargetCluster": "HPCC平台的目标群",
"HPCC Platform Target Cluster": "HPCC平台的目标群",
"Import '.mod' file": "导入 '.mod'文件",
"Import ECL '.mod' file": "导入ECL '.mod'文件",
"Insert logical file record definition": "插入logical file record定义",
Expand Down
30 changes: 3 additions & 27 deletions src/hpccplatform/launchConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ import { reporter } from "../telemetry";
import { formatWorkunitURL, formatResultURL } from "../ecl/util";
import { LaunchConfigState, credentialManager, Credentials } from "../util/credentialManager";

const NO_SELECTION = "no selection";
const NOT_FOUND = "not found";
export const NO_SELECTION = "no selection";
const MAX_LOGIN_ATTEMPTS = 3;

export interface IExecFile {
Expand Down Expand Up @@ -77,26 +76,7 @@ export function launchConfigurations(refresh = false): LaunchRequestArguments[]
gatherServers();
}
}
const retVal = Object.values(g_launchConfigurations);
if (retVal.length === 0) {
vscode.window.showErrorMessage(localize("No ECL Launch configurations."), localize("Create ECL Launch")).then(response => {
vscode.commands.executeCommand("workbench.action.debug.configure");
});
const notFound: LaunchRequestArguments = {
name: NOT_FOUND,
type: "ecl",

// Required
protocol: "http",
serverAddress: "localhost",
port: 8010,
path: "",
targetCluster: "unknown"
};
g_launchConfigurations[NOT_FOUND] = notFound;
retVal.push(notFound);
}
return retVal;
return Object.values(g_launchConfigurations);
}

export function launchConfiguration(name: string): LaunchRequestArguments | undefined {
Expand Down Expand Up @@ -380,11 +360,7 @@ export class LaunchConfig implements LaunchRequestArguments {
}

protected async _checkCredentials(): Promise<Credentials> {
if (this.name === NOT_FOUND) {
vscode.commands.executeCommand("setContext", "ecl.connected", false);
throw new Error(localize("No ECL Launch configurations."));
}
if (this.name === NO_SELECTION) {
if (!this.name || this.name === NO_SELECTION) {
vscode.commands.executeCommand("setContext", "ecl.connected", false);
throw new Error(localize("No Selected ECL Launch configuration."));
}
Expand Down
23 changes: 22 additions & 1 deletion src/hpccplatform/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,15 @@ class SessionManager {
};
});

// Set current launch config as active item
const currentId = this.session?.id;
if (currentId) {
const currentItem = input.items.find(item => item.id === currentId);
if (currentItem) {
input.activeItems = [currentItem];
}
}

input.onDidChangeSelection(async items => {
const item = items[0];
if (item) {
Expand All @@ -483,6 +492,18 @@ class SessionManager {
};
})];

// Set current target cluster as active item
const currentCluster = this.session.overriddenTargetCluster || this.session.targetCluster;
if (currentCluster) {
const currentItem = input.items.find(item => item.label === currentCluster);
if (currentItem) {
input.activeItems = [currentItem];
}
} else {
// If no override, select Auto Detect
input.activeItems = [input.items[0]];
}

input.onDidChangeSelection(async items => {
const item = items[0];
if (item) {
Expand Down Expand Up @@ -572,7 +593,7 @@ class SessionManager {

refreshTCStatusBar() {
this._statusBarTargetCluster.text = this.session.targetCluster;
this._statusBarTargetCluster.tooltip = localize("HPCC Platform TargetCluster");
this._statusBarTargetCluster.tooltip = localize("HPCC Platform Target Cluster");
if (this.isActiveECL) {
this._statusBarTargetCluster.show();
} else {
Expand Down