Skip to content

Commit 4652ef1

Browse files
committed
fix: update tooltip and group names for HPCC platform commands and improve session management
Signed-off-by: Gordon Smith <GordonJSmith@gmail.com>
1 parent 819e38d commit 4652ef1

7 files changed

Lines changed: 50 additions & 40 deletions

File tree

package.json

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,7 @@
632632
"category": "ECL",
633633
"title": "%Switch HPCC Platform%",
634634
"description": "%Switch to different HPCC Platform instance%",
635+
"tooltip": "%Switch HPCC Platform (shows current)%",
635636
"icon": {
636637
"light": "resources/light/server-process.svg",
637638
"dark": "resources/dark/server-process.svg"
@@ -656,6 +657,8 @@
656657
"category": "ECL",
657658
"title": "%Switch Target Cluster%",
658659
"description": "%Switch Target Cluster%",
660+
"tooltip": "%Switch Target Cluster (shows current)%",
661+
"icon": "$(server-environment)",
659662
"enablement": "ecl.connected"
660663
},
661664
{
@@ -964,27 +967,27 @@
964967
{
965968
"when": "resourceLangId == ecl && resourceExtname == .ecl",
966969
"command": "ecl.submit",
967-
"group": "navigation@900"
970+
"group": "ecl@1"
968971
},
969972
{
970973
"when": "resourceLangId == ecl && resourceExtname == .ecl",
971974
"command": "ecl.submitNoArchive",
972-
"group": "navigation@900"
975+
"group": "ecl@2"
973976
},
974977
{
975978
"when": "resourceLangId == ecl && resourceExtname == .ecl",
976979
"command": "ecl.compile",
977-
"group": "navigation@910"
980+
"group": "ecl@3"
978981
},
979982
{
980983
"when": "resourceLangId == ecl && resourceExtname == .ecl",
981984
"command": "ecl.checkSyntax",
982-
"group": "navigation@920"
985+
"group": "ecl@4"
983986
},
984987
{
985988
"when": "resourceLangId == ecl && resourceExtname == .ecl",
986989
"command": "ecl.insertRecordDef",
987-
"group": "navigation@930"
990+
"group": "ecl@5"
988991
},
989992
{
990993
"when": "resourceLangId == kel && resourceExtname == .kel",
@@ -1020,18 +1023,28 @@
10201023
},
10211024
{
10221025
"when": "resourceLangId == ecl",
1023-
"command": "ecl.checkSyntax",
1026+
"command": "ecl.submit",
10241027
"group": "navigation@900"
10251028
},
10261029
{
10271030
"when": "resourceLangId == ecl",
1028-
"command": "ecl.submit",
1031+
"command": "ecl.compile",
10291032
"group": "navigation@910"
10301033
},
10311034
{
10321035
"when": "resourceLangId == ecl",
1033-
"command": "ecl.compile",
1036+
"command": "ecl.checkSyntax",
10341037
"group": "navigation@920"
1038+
},
1039+
{
1040+
"when": "resourceLangId == ecl",
1041+
"command": "hpccPlatform.switch",
1042+
"group": "navigation@930"
1043+
},
1044+
{
1045+
"when": "resourceLangId == ecl && ecl.connected",
1046+
"command": "hpccPlatform.switchTargetCluster",
1047+
"group": "navigation@940"
10351048
}
10361049
],
10371050
"editor/title/context": [

package.nls.es.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
"Homepage": "Página principal",
8383
"HPCC Platform": "Plataforma HPCC",
8484
"HPCC Platform Launch Configuration": "Configuración de lanzamiento de la plataforma HPCC",
85-
"HPCC Platform TargetCluster": "Sistemas de destino de la plataforma HPCC",
85+
"HPCC Platform Target Cluster": "Sistemas de destino de la plataforma HPCC",
8686
"Import '.mod' file": "Importar archivo '.mod'",
8787
"Import ECL '.mod' file": "Importar archivo ECL '.mod'",
8888
"Insert logical file record definition": "Insertar definición de registro de archivo lógico",

package.nls.fr.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
"Homepage": "Page d'accueil",
8383
"HPCC Platform": "HPCC Platform",
8484
"HPCC Platform Launch Configuration": "Configuration de lancement de la plateforme HPCC",
85-
"HPCC Platform TargetCluster": "Plateforme HPCC TargetCluster",
85+
"HPCC Platform Target Cluster": "Plateforme HPCC TargetCluster",
8686
"Import '.mod' file": "Importez le fichier '.mod'",
8787
"Import ECL '.mod' file": "Importez le fichier ECL '.mod'",
8888
"Insert logical file record definition": "Insérez une définition d'enregistrement de fichier logique",

package.nls.pt-br.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
"Homepage": "Pagina inicial",
8383
"HPCC Platform": "Plataforma HPCC",
8484
"HPCC Platform Launch Configuration": "Configuração de inicialização da plataforma HPCC",
85-
"HPCC Platform TargetCluster": "Cluster de destino da plataforma HPCC",
85+
"HPCC Platform Target Cluster": "Cluster de destino da plataforma HPCC",
8686
"Import '.mod' file": "Importar arquivo '.mod'",
8787
"Import ECL '.mod' file": "Importar arquivo ECL '.mod'",
8888
"Insert logical file record definition": "Inserir definição de registro de arquivo lógico",

package.nls.zh.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
"Homepage": "主页",
8383
"HPCC Platform": "高性能计算平台",
8484
"HPCC Platform Launch Configuration": "HPCC平台的启动配置",
85-
"HPCC Platform TargetCluster": "HPCC平台的目标群",
85+
"HPCC Platform Target Cluster": "HPCC平台的目标群",
8686
"Import '.mod' file": "导入 '.mod'文件",
8787
"Import ECL '.mod' file": "导入ECL '.mod'文件",
8888
"Insert logical file record definition": "插入logical file record定义",

src/hpccplatform/launchConfig.ts

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ import { reporter } from "../telemetry";
1111
import { formatWorkunitURL, formatResultURL } from "../ecl/util";
1212
import { LaunchConfigState, credentialManager, Credentials } from "../util/credentialManager";
1313

14-
const NO_SELECTION = "no selection";
15-
const NOT_FOUND = "not found";
14+
export const NO_SELECTION = "no selection";
1615
const MAX_LOGIN_ATTEMPTS = 3;
1716

1817
export interface IExecFile {
@@ -77,26 +76,7 @@ export function launchConfigurations(refresh = false): LaunchRequestArguments[]
7776
gatherServers();
7877
}
7978
}
80-
const retVal = Object.values(g_launchConfigurations);
81-
if (retVal.length === 0) {
82-
vscode.window.showErrorMessage(localize("No ECL Launch configurations."), localize("Create ECL Launch")).then(response => {
83-
vscode.commands.executeCommand("workbench.action.debug.configure");
84-
});
85-
const notFound: LaunchRequestArguments = {
86-
name: NOT_FOUND,
87-
type: "ecl",
88-
89-
// Required
90-
protocol: "http",
91-
serverAddress: "localhost",
92-
port: 8010,
93-
path: "",
94-
targetCluster: "unknown"
95-
};
96-
g_launchConfigurations[NOT_FOUND] = notFound;
97-
retVal.push(notFound);
98-
}
99-
return retVal;
79+
return Object.values(g_launchConfigurations);
10080
}
10181

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

382362
protected async _checkCredentials(): Promise<Credentials> {
383-
if (this.name === NOT_FOUND) {
384-
vscode.commands.executeCommand("setContext", "ecl.connected", false);
385-
throw new Error(localize("No ECL Launch configurations."));
386-
}
387-
if (this.name === NO_SELECTION) {
363+
if (!this.name || this.name === NO_SELECTION) {
388364
vscode.commands.executeCommand("setContext", "ecl.connected", false);
389365
throw new Error(localize("No Selected ECL Launch configuration."));
390366
}

src/hpccplatform/session.ts

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,15 @@ class SessionManager {
463463
};
464464
});
465465

466+
// Set current launch config as active item
467+
const currentId = this.session?.id;
468+
if (currentId) {
469+
const currentItem = input.items.find(item => item.id === currentId);
470+
if (currentItem) {
471+
input.activeItems = [currentItem];
472+
}
473+
}
474+
466475
input.onDidChangeSelection(async items => {
467476
const item = items[0];
468477
if (item) {
@@ -483,6 +492,18 @@ class SessionManager {
483492
};
484493
})];
485494

495+
// Set current target cluster as active item
496+
const currentCluster = this.session.overriddenTargetCluster || this.session.targetCluster;
497+
if (currentCluster) {
498+
const currentItem = input.items.find(item => item.label === currentCluster);
499+
if (currentItem) {
500+
input.activeItems = [currentItem];
501+
}
502+
} else {
503+
// If no override, select Auto Detect
504+
input.activeItems = [input.items[0]];
505+
}
506+
486507
input.onDidChangeSelection(async items => {
487508
const item = items[0];
488509
if (item) {
@@ -572,7 +593,7 @@ class SessionManager {
572593

573594
refreshTCStatusBar() {
574595
this._statusBarTargetCluster.text = this.session.targetCluster;
575-
this._statusBarTargetCluster.tooltip = localize("HPCC Platform TargetCluster");
596+
this._statusBarTargetCluster.tooltip = localize("HPCC Platform Target Cluster");
576597
if (this.isActiveECL) {
577598
this._statusBarTargetCluster.show();
578599
} else {

0 commit comments

Comments
 (0)