From 2971674bc382f18a75be602125cc8ea39ff281ae Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Mon, 25 Oct 2021 18:45:51 -0500 Subject: [PATCH 1/5] Update baseURL for Rules docs on web --- src/features/CodeActions.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/features/CodeActions.ts b/src/features/CodeActions.ts index 73c8974312..dc09cb2cf0 100644 --- a/src/features/CodeActions.ts +++ b/src/features/CodeActions.ts @@ -34,7 +34,7 @@ export class CodeActionsFeature implements vscode.Disposable { } public showRuleDocumentation(ruleId: string) { - const pssaDocBaseURL = "https://github.com/PowerShell/PSScriptAnalyzer/blob/master/docs/Rules"; + const pssaDocBaseURL = "https://docs.microsoft.com/en-us/powershell/utility-modules/psscriptanalyzer/rules/"; if (!ruleId) { this.log.writeWarning("Cannot show documentation for code action, no ruleName was supplied."); @@ -45,6 +45,6 @@ export class CodeActionsFeature implements vscode.Disposable { ruleId = ruleId.substr(2); } - vscode.commands.executeCommand("vscode.open", vscode.Uri.parse(pssaDocBaseURL + `/${ruleId}.md`)); + vscode.commands.executeCommand("vscode.open", vscode.Uri.parse(pssaDocBaseURL + `/${ruleId}`)); } } From 2f85431ae7406a53406598c09cad4c73106f2744 Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Mon, 25 Oct 2021 18:47:49 -0500 Subject: [PATCH 2/5] Remove locale from URL --- src/features/CodeActions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/features/CodeActions.ts b/src/features/CodeActions.ts index dc09cb2cf0..d710f68591 100644 --- a/src/features/CodeActions.ts +++ b/src/features/CodeActions.ts @@ -34,7 +34,7 @@ export class CodeActionsFeature implements vscode.Disposable { } public showRuleDocumentation(ruleId: string) { - const pssaDocBaseURL = "https://docs.microsoft.com/en-us/powershell/utility-modules/psscriptanalyzer/rules/"; + const pssaDocBaseURL = "https://docs.microsoft.com/powershell/utility-modules/psscriptanalyzer/rules/"; if (!ruleId) { this.log.writeWarning("Cannot show documentation for code action, no ruleName was supplied."); From 109a9ec3e48fbddf4b3e9a809c0cf9f9f549abf1 Mon Sep 17 00:00:00 2001 From: Andy Schwartzmeyer Date: Tue, 26 Oct 2021 09:11:49 -0700 Subject: [PATCH 3/5] Update src/features/CodeActions.ts --- src/features/CodeActions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/features/CodeActions.ts b/src/features/CodeActions.ts index d710f68591..c1cc7646e1 100644 --- a/src/features/CodeActions.ts +++ b/src/features/CodeActions.ts @@ -45,6 +45,6 @@ export class CodeActionsFeature implements vscode.Disposable { ruleId = ruleId.substr(2); } - vscode.commands.executeCommand("vscode.open", vscode.Uri.parse(pssaDocBaseURL + `/${ruleId}`)); + vscode.commands.executeCommand("vscode.open", vscode.Uri.parse(pssaDocBaseURL + `${ruleId}`)); } } From e13137af7e196b4eaf4bb43cf8e1a94ff9ea1d88 Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Tue, 26 Oct 2021 12:10:58 -0500 Subject: [PATCH 4/5] Removed trailing slash --- src/features/CodeActions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/features/CodeActions.ts b/src/features/CodeActions.ts index c1cc7646e1..6c858e7337 100644 --- a/src/features/CodeActions.ts +++ b/src/features/CodeActions.ts @@ -34,7 +34,7 @@ export class CodeActionsFeature implements vscode.Disposable { } public showRuleDocumentation(ruleId: string) { - const pssaDocBaseURL = "https://docs.microsoft.com/powershell/utility-modules/psscriptanalyzer/rules/"; + const pssaDocBaseURL = "https://docs.microsoft.com/powershell/utility-modules/psscriptanalyzer/rules"; if (!ruleId) { this.log.writeWarning("Cannot show documentation for code action, no ruleName was supplied."); From 1683d31412d44f96ba201c1f52a6d9f2113fa1f7 Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Tue, 26 Oct 2021 12:13:49 -0500 Subject: [PATCH 5/5] Revert previous commit @andschwa I didn't look closely enough to see that you had already removed one of the slashes. --- src/features/CodeActions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/features/CodeActions.ts b/src/features/CodeActions.ts index 6c858e7337..c1cc7646e1 100644 --- a/src/features/CodeActions.ts +++ b/src/features/CodeActions.ts @@ -34,7 +34,7 @@ export class CodeActionsFeature implements vscode.Disposable { } public showRuleDocumentation(ruleId: string) { - const pssaDocBaseURL = "https://docs.microsoft.com/powershell/utility-modules/psscriptanalyzer/rules"; + const pssaDocBaseURL = "https://docs.microsoft.com/powershell/utility-modules/psscriptanalyzer/rules/"; if (!ruleId) { this.log.writeWarning("Cannot show documentation for code action, no ruleName was supplied.");