From 29715742befb0a64e825efab02cb71dfb476c232 Mon Sep 17 00:00:00 2001 From: Chad Norvell Date: Wed, 17 Jul 2024 06:42:46 +0000 Subject: [PATCH] pw_ide: Fix VSC troubleshooting links MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I4dc82200517d52bd4de59ecde37f3f67ff6c3c2c Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/223576 Lint: Lint 🤖 Presubmit-Verified: CQ Bot Account Reviewed-by: Asad Memon Commit-Queue: Chad Norvell --- pw_ide/ts/pigweed-vscode/src/clangd.ts | 16 +++++++++++----- pw_ide/ts/pigweed-vscode/src/links.ts | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/pw_ide/ts/pigweed-vscode/src/clangd.ts b/pw_ide/ts/pigweed-vscode/src/clangd.ts index 584b3d657e..31b0dd8952 100644 --- a/pw_ide/ts/pigweed-vscode/src/clangd.ts +++ b/pw_ide/ts/pigweed-vscode/src/clangd.ts @@ -20,7 +20,7 @@ import { basename, dirname, join } from 'path'; import { refreshCompileCommands } from './bazelWatcher'; import { refreshManager } from './refreshManager'; import { settingFor, settings, stringSettingFor, workingDir } from './settings'; -import { troubleshootingLink } from './links'; +import { launchTroubleshootingLink } from './links'; const CDB_FILE_NAME = 'compile_commands.json' as const; const CDB_FILE_DIR = '.compile_commands' as const; @@ -104,10 +104,16 @@ export async function setCompileCommandsTarget() { const targets = await availableTargets(); if (targets.length === 0) { - vscode.window.showErrorMessage( - "Couldn't find any targets! Get help at " + - troubleshootingLink('bazel-no-targets'), - ); + vscode.window + .showErrorMessage("Couldn't find any targets!", 'Get Help') + .then((selection) => { + switch (selection) { + case 'Get Help': { + launchTroubleshootingLink('bazel-no-targets'); + break; + } + } + }); return; } diff --git a/pw_ide/ts/pigweed-vscode/src/links.ts b/pw_ide/ts/pigweed-vscode/src/links.ts index 440776464a..d5eb83a397 100644 --- a/pw_ide/ts/pigweed-vscode/src/links.ts +++ b/pw_ide/ts/pigweed-vscode/src/links.ts @@ -25,7 +25,7 @@ export function fileBug() { } export const troubleshootingLink = (anchor: string) => - `https://pigweed.dev/pw_ide/guide/troubleshooting.html#${anchor}`; + `https://pigweed.dev/pw_ide/guide/vscode/troubleshooting.html#${anchor}`; export function launchTroubleshootingLink(anchor: string) { vscode.env.openExternal(vscode.Uri.parse(troubleshootingLink(anchor)));