Skip to content

Commit 5355244

Browse files
committed
Merge branch 'elrashed/dynamicLaunchNew' of https://github.com/microsoft/vscode-cpptools into elrashed/dynamicLaunchNew
2 parents 094a9d0 + 1b5dd98 commit 5355244

File tree

2 files changed

+21
-9
lines changed

2 files changed

+21
-9
lines changed

Documentation/Building the Extension.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ Prerequisite steps:
1010
* From a command line, run the following commands from the **Extension** folder in the root of the repository:
1111
* `yarn install` will install the dependencies needed to build the extension.
1212
* **(optional)** `yarn global add vsce` will install `vsce` globally to create a VSIX package that you can install.
13-
* **(optional)** Set an environment variable `CPPTOOLS_DEV=1`.
14-
* This enables the local developer workflow when testing the debugger, copying dependencies from the **node_modules** folder. Testing the language server does not require this step.
1513
* Open the **Extension** folder in Visual Studio Code and press F5. This will launch a VS Code Extension Host window and activate the TypeScript debugger. You can set breakpoints on the extension source code and debug your scenario.
14+
* If, after pressing F5, you see the following error in the `[Extension Development Host]` window,
15+
> Unable to start the C/C++ language server. IntelliSense features will be disabled. Error: Missing binary at .../vscode-cpptools/Extension/bin/cpptools
16+
* Then, you can follow the instructions in this [comment in a discussion about building this extension locally](https://github.com/microsoft/vscode-cpptools/discussions/8745#discussioncomment-2091563).
17+
> get the <package.version.number> binaries from installing the extension and then copying the binaries
18+
1. To do this, install this extension from the Visual Studio Marketplace and find its location on your device. It might be in a directory like `\\wsl$\Ubuntu\home\hamir\.vscode-server\extensions\ms-vscode.cpptools-<package.version.number>`, for example.
19+
2. Next, go to the `bin/` directory of the aforementioned directory, and drag-and-drop, or copy-and-paste, `cpptools` and `cpptools-srv` from `...\extensions\ms-vscode.cpptools-<package.version.number>\bin\` to this repository's `Extension\bin\` directory on your local device, so that `.../vscode-cpptools/Extension/bin/cpptools` and `.../vscode-cpptools/Extension/bin/cpptools-srv` both exist in your workspace.
20+
3. The aforementioned warning should be gone, and Intellisense, which gives those squiggly red error lines, should now be present.
21+
4. The `insiders` branch has binaries compatible with the latest Pre-Release version of the extension, and the `release` branch has binaries compatible with the latest Release version, but the `main` branch may have TypeScript changes that are incompatible with the published binaries, in which case, you'll need to create a branch off the `insiders` or `release` branches.
22+
23+
* Feel free to use [the Discussions tab of this repository](https://github.com/microsoft/vscode-cpptools/discussions) if you have any further questions on building this extension locally.

Extension/src/LanguageServer/extension.ts

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -485,14 +485,18 @@ async function onSwitchHeaderSource(): Promise<void> {
485485
}
486486
});
487487
const document: vscode.TextDocument = await vscode.workspace.openTextDocument(targetFileName);
488+
const workbenchConfig: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration("workbench");
488489
let foundEditor: boolean = false;
489-
// If the document is already visible in another column, open it there.
490-
vscode.window.visibleTextEditors.forEach((editor, index, array) => {
491-
if (editor.document === document && !foundEditor) {
492-
foundEditor = true;
493-
vscode.window.showTextDocument(document, editor.viewColumn);
494-
}
495-
});
490+
if (workbenchConfig.get("editor.revealIfOpen")) {
491+
// If the document is already visible in another column, open it there.
492+
vscode.window.visibleTextEditors.forEach(editor => {
493+
if (editor.document === document && !foundEditor) {
494+
foundEditor = true;
495+
vscode.window.showTextDocument(document, editor.viewColumn);
496+
}
497+
});
498+
}
499+
496500
if (!foundEditor) {
497501
vscode.window.showTextDocument(document);
498502
}

0 commit comments

Comments
 (0)