From 7ed8096e2833695e561df627651c6050ecd3798b Mon Sep 17 00:00:00 2001 From: worksofliam Date: Mon, 29 Apr 2024 09:38:45 -0400 Subject: [PATCH] Fix missing lint config filter option Signed-off-by: worksofliam --- extension/client/src/linter.ts | 8 +++++++- package.json | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/extension/client/src/linter.ts b/extension/client/src/linter.ts index 277979a..030c8e4 100644 --- a/extension/client/src/linter.ts +++ b/extension/client/src/linter.ts @@ -55,7 +55,13 @@ export function initialise(context: ExtensionContext) { if (filter && filter.description) { // Bad way to get the library for the filter .. - const library = (filter.description.split(`/`)[0]).toLocaleUpperCase(); + const library: string = (filter.description.split(`/`)[0]).toLocaleUpperCase(); + + if (library.includes(`*`)) { + window.showErrorMessage(`Cannot show lint config for a library filter.`); + return; + } + configPath = `${library}/VSCODE/RPGLINT.JSON`; exists = (await connection.runCommand({ diff --git a/package.json b/package.json index f49850b..9d095e2 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ "view/item/context": [ { "command": "vscode-rpgle.openLintConfig", - "when": "view == objectBrowser && viewItem == filter", + "when": "view == objectBrowser && viewItem =~ /^filter.*$/", "group": "1_LibActions@2" } ]