Skip to content

Commit

Permalink
pw_ide: Fix VSC troubleshooting links
Browse files Browse the repository at this point in the history
Change-Id: I4dc82200517d52bd4de59ecde37f3f67ff6c3c2c
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/223576
Lint: Lint 🤖 <[email protected]>
Presubmit-Verified: CQ Bot Account <[email protected]>
Reviewed-by: Asad Memon <[email protected]>
Commit-Queue: Chad Norvell <[email protected]>
  • Loading branch information
chadnorvell authored and CQ Bot Account committed Jul 17, 2024
1 parent 1e6e5c5 commit 2971574
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
16 changes: 11 additions & 5 deletions pw_ide/ts/pigweed-vscode/src/clangd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion pw_ide/ts/pigweed-vscode/src/links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
Expand Down

0 comments on commit 2971574

Please sign in to comment.