From f71ca43d3d3163771286c187aaeffad820b16498 Mon Sep 17 00:00:00 2001 From: Richard Moulton Date: Tue, 31 Oct 2023 19:59:39 +0000 Subject: [PATCH 1/3] Renamed &HOME variable to &WORKDIR and added new &FILEDIR variable --- package-lock.json | 4 ++-- src/api/CompileTools.ts | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9424bdfef..f49e1fd9e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "code-for-ibmi", - "version": "2.3.1", + "version": "2.4.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "code-for-ibmi", - "version": "2.3.1", + "version": "2.4.0", "license": "MIT", "dependencies": { "@bendera/vscode-webview-elements": "^0.12.0", diff --git a/src/api/CompileTools.ts b/src/api/CompileTools.ts index da5f61b51..e9f74d146 100644 --- a/src/api/CompileTools.ts +++ b/src/api/CompileTools.ts @@ -61,7 +61,7 @@ export namespace CompileTools { variables.set(`{usrprf}`, connection.currentUser); variables.set(`&HOST`, connection.currentHost); variables.set(`{host}`, connection.currentHost); - variables.set(`&HOME`, config.homeDirectory); + variables.set(`&WORKDIR`, config.homeDirectory); const libraryList = buildLibraryList(librarySettings); variables.set(`&LIBLS`, libraryList.join(` `)); @@ -232,6 +232,7 @@ export namespace CompileTools { fullPath = path.posix.join(config.homeDirectory, relativePath).split(path.sep).join(path.posix.sep); variables.set(`&FULLPATH`, fullPath); variables.set(`{path}`, fullPath); + variables.set(`&FILEDIR`, path.posix.parse(fullPath).dir); try { const gitApi = Tools.getGitAPI(); @@ -251,11 +252,12 @@ export namespace CompileTools { break; case `streamfile`: - relativePath = path.posix.relative(config.homeDirectory, uri.fsPath).split(path.sep).join(path.posix.sep); + relativePath = path.posix.relative(config.homeDirectory, uri.path).split(path.sep).join(path.posix.sep); variables.set(`&RELATIVEPATH`, relativePath); const fullName = uri.path; variables.set(`&FULLPATH`, fullName); + variables.set(`&FILEDIR`, path.parse(fullName).dir); break; } From 43b86a4233e74549df95561f00dd736cdaa6c9bf Mon Sep 17 00:00:00 2001 From: Richard Moulton Date: Tue, 31 Oct 2023 20:13:29 +0000 Subject: [PATCH 2/3] Updated action variable descriptions --- src/locale/ids/da.ts | 5 +++-- src/locale/ids/en.ts | 5 +++-- src/locale/ids/fr.ts | 5 +++-- src/webviews/actions/varinfo.ts | 3 ++- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/locale/ids/da.ts b/src/locale/ids/da.ts index d3e3aa565..950749157 100644 --- a/src/locale/ids/da.ts +++ b/src/locale/ids/da.ts @@ -209,7 +209,7 @@ export const da: Locale = { //Actions 'actions.CURLIB': 'Aktuelle bibliotek (sættes i Library List)', 'actions.USERNAME': `Brugernavn for forbindelsen`, - 'actions.HOME': `Aktuelle mappe (sættes i IFS Browser)`, + 'actions.WORKDIR': `Aktuel arbejdsmappe, kan ændres i IFS Browser`, 'actions.HOST': `Host navn eller IP adresse fra den aktuelle forbindelse`, 'actions.BUILDLIB': `Det samme som &CURLIB`, 'actions.LIBLC': `Liste af biblioteker adskilt af komma`, @@ -219,7 +219,8 @@ export const da: Locale = { 'actions.OPENMBR': `Navn på source member (&OPENMBRL for små bogstaver)`, 'actions.member.EXT': `Type af source member (&EXTL for små bogstaver)`, 'actions.FULLPATH': `Fulde sti på filen på fjernsystemet`, - 'actions.RELATIVEPATH': `Relative sti for filen fra aktuelle mappe eller workspace`, + 'actions.FILEDIR': `Katalog over filen på fjernsystemet`, + 'actions.RELATIVEPATH': `Relativ sti til streamfilen fra arbejdsbiblioteket eller arbejdsområdet`, 'actions.PARENT': `Navn på forrige mappe eller source fil`, 'actions.BASENAME': `Navn på filen, inklusive filtypen`, 'actions.streamfile.NAME': `Navn på filen (&NAMEL for små bogstaver)`, diff --git a/src/locale/ids/en.ts b/src/locale/ids/en.ts index c579b53ab..5d8eb2580 100644 --- a/src/locale/ids/en.ts +++ b/src/locale/ids/en.ts @@ -209,7 +209,7 @@ export const en: Locale = { //Actions 'actions.CURLIB': 'Current library, changeable in Library List', 'actions.USERNAME': `Username for connection`, - 'actions.HOME': `Current home/working directory, changable in IFS Browser`, + 'actions.WORKDIR': `Current working directory, changeable in IFS Browser`, 'actions.HOST': `Hostname or IP address from the current connection`, 'actions.BUILDLIB': `The same as &CURLIB`, 'actions.LIBLC': `Library list delimited by comma`, @@ -219,7 +219,8 @@ export const en: Locale = { 'actions.OPENMBR': `Name of the source member (&OPENMBRL for lowercase)`, 'actions.member.EXT': `Extension of the source member (&EXTL for lowercase)`, 'actions.FULLPATH': `Full path of the file on the remote system`, - 'actions.RELATIVEPATH': `Relative path of the streamfile from the home directory or workspace`, + 'actions.FILEDIR': `Directory of the file on the remote system`, + 'actions.RELATIVEPATH': `Relative path of the streamfile from the working directory or workspace`, 'actions.PARENT': `Name of the parent directory or source file`, 'actions.BASENAME': `Name of the file, including the extension`, 'actions.streamfile.NAME': `Name of the file (&NAMEL for lowercase)`, diff --git a/src/locale/ids/fr.ts b/src/locale/ids/fr.ts index 6e5e65c25..d10229d2a 100644 --- a/src/locale/ids/fr.ts +++ b/src/locale/ids/fr.ts @@ -209,7 +209,7 @@ export const fr: Locale = { //Actions 'actions.CURLIB': 'Bibliothèque en cours, modifiable depuis la Liste des Bibliothèques', 'actions.USERNAME': `Nom d'utilisateur de la connexion`, - 'actions.HOME': `Home/répertoire de travail en cours, modifiable depuis l'Exporateur IFS`, + 'actions.WORKDIR': `Répertoire de travail actuel, modifiable dans le navigateur IFS`, 'actions.HOST': `Nom d'hôte ou adresse IP de la connexion`, 'actions.BUILDLIB': `Voir &CURLIB`, 'actions.LIBLC': `Liste des bilbiothèques, séparée par des virgules`, @@ -219,7 +219,8 @@ export const fr: Locale = { 'actions.OPENMBR': `Nom du membre source (&OPENMBRL pour le nom en minuscule)`, 'actions.member.EXT': `Extension du membre source (&EXTL pour le nom en minuscule)`, 'actions.FULLPATH': `Chemin absolu du fichier sur le système distant`, - 'actions.RELATIVEPATH': `Chemin relatif du fichier depuis le répertoire home ou de travail`, + 'actions.FILEDIR': `Répertoire du fichier sur le système distant`, + 'actions.RELATIVEPATH': `Chemin relatif du fichier de flux à partir du répertoire de travail ou de l'espace de travail`, 'actions.PARENT': `Nom du répertoire parent du fichier`, 'actions.BASENAME': `Nom du fichier avec son extension`, 'actions.streamfile.NAME': `Nom du fichier (&NAMEL pour le nom en minuscule)`, diff --git a/src/webviews/actions/varinfo.ts b/src/webviews/actions/varinfo.ts index caaaeb62c..6f3379efd 100644 --- a/src/webviews/actions/varinfo.ts +++ b/src/webviews/actions/varinfo.ts @@ -15,7 +15,7 @@ type VariableInfoList = { const generic: () => VariableInfo[] = () => [ { name: `&CURLIB`, text: t(`actions.CURLIB`) }, { name: `&USERNAME`, text: t("actions.USERNAME")}, - { name: `&HOME`, text: t("actions.HOME")}, + { name: `&WORKDIR`, text: t("actions.WORKDIR")}, { name: `&HOST`, text: t("actions.HOST")}, { name: `&BUILDLIB`, text: t("actions.BUILDLIB")}, { name: `&LIBLC`, text: t("actions.LIBLC")}, @@ -33,6 +33,7 @@ export function getVariablesInfo(): VariableInfoList { ], streamFile: [ { name: `&FULLPATH`, text: t("actions.FULLPATH")}, + { name: `&FILEDIR`, text: t("actions.FILEDIR")}, { name: `&RELATIVEPATH`, text: t("actions.RELATIVEPATH")}, { name: `&PARENT`, text: t("actions.PARENT")}, { name: `&BASENAME`, text: t("actions.BASENAME")}, From 1aef6681e99769445cb25df7c3b4077e9a499408 Mon Sep 17 00:00:00 2001 From: Richard Moulton Date: Sat, 11 Nov 2023 17:27:29 +0000 Subject: [PATCH 3/3] reinstate &HOMEdefault variable --- src/api/CompileTools.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/api/CompileTools.ts b/src/api/CompileTools.ts index e9f74d146..abf09639c 100644 --- a/src/api/CompileTools.ts +++ b/src/api/CompileTools.ts @@ -61,6 +61,7 @@ export namespace CompileTools { variables.set(`{usrprf}`, connection.currentUser); variables.set(`&HOST`, connection.currentHost); variables.set(`{host}`, connection.currentHost); + variables.set(`&HOME`, config.homeDirectory); variables.set(`&WORKDIR`, config.homeDirectory); const libraryList = buildLibraryList(librarySettings);