Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
118a4a7
Initial walkthrough text
Colengms May 5, 2021
d4fd651
Update walkthrough to used json schema used by latest VS Code insiders
Colengms May 5, 2021
7d258ab
Fix typo
Colengms May 5, 2021
b4d26b3
Fix buttons
Colengms May 5, 2021
5d9b7bf
Add compiler check
Colengms May 5, 2021
384fd2b
Merge branch 'main' of https://github.com/microsoft/vscode-cpptools i…
Colengms May 6, 2021
c1ed0b7
Fix compile error
Colengms May 6, 2021
7ba1935
added newlines and starter markdown files
jureid May 6, 2021
0fcb815
added placeholder screenshots and updated markdown files
jureid May 6, 2021
27e20d7
Add check for workspaceFolderCount
Colengms May 6, 2021
68278a6
Merge branch 'coleng/walkthrough' of https://github.com/microsoft/vsc…
Colengms May 6, 2021
1b810d4
added screenshots for different color themes
jureid May 7, 2021
652056b
updated success message for checking compiler
jureid May 7, 2021
96da1ce
Add compiler name to no.compilers.found
Colengms May 7, 2021
3b56d3d
Add missing semicolon
Colengms May 7, 2021
1b8a25c
Merge branch 'main' of https://github.com/microsoft/vscode-cpptools i…
Colengms May 7, 2021
07eb6ef
Add an arg to config UI/JSON commands to accept ViewColumn
Colengms May 11, 2021
73c49de
Merge branch 'main' of https://github.com/microsoft/vscode-cpptools i…
Colengms May 11, 2021
5a0d0a6
Fix typo in package.json (#7508)
jogo- May 11, 2021
83a90c3
updated content for build and debug tasks. added command for installi…
jureid May 11, 2021
f8457c1
Merge branch 'coleng/walkthrough' of https://github.com/microsoft/vsc…
jureid May 11, 2021
ee364b8
fixed rendering issues
jureid May 11, 2021
c873bc0
Fix typo in install-compiler-windows.md (#7509)
jogo- May 11, 2021
a1ff74b
updated markdown files
jureid May 11, 2021
1cb5ba9
updated markdown files
jureid May 11, 2021
445c81d
fixed formatting for second note in install compiler on windows file
jureid May 11, 2021
e6b16eb
final edits to markdown files
jureid May 11, 2021
b96e527
removed ... from buttons in walkthrough
jureid May 11, 2021
f84412d
Add doneOn for walkthrough commands. Done for links is tracked by vs…
Colengms May 12, 2021
f9d8907
Address PR feedback
Colengms May 12, 2021
824fe36
Address PR feedback
Colengms May 12, 2021
94d0266
addressing PR feedback
jureid May 13, 2021
dff8d69
fixed capitalizaiton issue in two markdown files, fixed altText for c…
jureid May 13, 2021
379f2e5
Switch from using doneOn to completionEvents
Colengms May 13, 2021
96b9900
Fix slash directions in compiler check UI
Colengms May 13, 2021
0b51a9a
Fix lint issues
Colengms May 13, 2021
3c50562
updated screenshots and created subfolders
jureid May 14, 2021
5f1a3c1
Merge branch 'main' into coleng/walkthrough
Colengms May 17, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
153 changes: 152 additions & 1 deletion Extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,157 @@
],
"main": "./dist/main",
"contributes": {
"walkthroughs": [
{
"id": "cppWelcome",
"title": "Get Started with C++ Development",
Comment thread
sean-mcmanus marked this conversation as resolved.
Resolved
Comment thread
jureid marked this conversation as resolved.
Resolved
"description": "Dive into VS Code's rich C++ development experience.",
"steps": [
Comment thread
jureid marked this conversation as resolved.
Resolved
{
"id": "verify.compiler.mac",
"title": "Install a C++ compiler",
"description": "The C++ extension uses the C++ compiler on your system to configure IntelliSense for your project. \n[Check for C++ compilers](command:C_Cpp.CheckForCompiler)",
"when": "isMac",
"media": {
"altText": "A markdown file with instructions for installing Clang on macOS.",
"path": "walkthrough/installcompiler/install-clang-macos.md"
}
},
{
"id": "verify.compiler.linux",
"title": "Install a C++ compiler",
"description": "The C++ extension uses the C++ compiler on your system to configure IntelliSense for your project. \n[Check for C++ compilers](command:C_Cpp.CheckForCompiler)",
"when": "isLinux",
"media": {
"altText": "A markdown file with instructions for installing GCC on Linux.",
"path": "walkthrough/installcompiler/install-gcc-linux.md"
}
},
{
"id": "verify.compiler.windows",
"title": "Install a C++ compiler",
"description": "The C++ extension uses the C++ compiler on your system to configure IntelliSense for your project. \n[Check for C++ compilers](command:C_Cpp.CheckForCompiler)",
"when": "isWindows",
"media": {
"altText": "A markdown file with instructions for installing MSVC on Windows.",
"path": "walkthrough/installcompiler/install-compiler-windows.md"
}
},
{
"id": "open.project",
"title": "Open your project folder",
"description": "Open an existing folder that contains your C++ project, or create a new folder. \n[Pick a folder](command:workbench.action.files.openFolder)",
"when": "workspaceFolderCount == 0",
"media": {
"altText": "A screenshot that shows a C++ project opened in the file Explorer.",
"path": {
"light": "walkthrough/images/cpp-folder-explorer-light.png",
"dark": "walkthrough/images/cpp-folder-explorer-dark.png",
"hc": "walkthrough/images/cpp-folder-explorer-hc.png"
}
}
},
{
"id": "setup.intellisense",
"title": "Configure C++ IntelliSense",
"description": "Verify important IntelliSense settings like Compiler Path, Compiler Args, IntelliSense Mode, and Include Path. \n[Open IntelliSense Configuration](command:C_Cpp.ConfigurationEditUI?-2)",
"media": {
"altText": "A screenshot that shows the IntelliSense Configurations UI with important settings highlighted.",
"path": {
"light": "walkthrough/images/intellisense-config-light.png",
"dark": "walkthrough/images/intellisense-config-dark.png",
"hc": "walkthrough/images/intellisense-config-hc.png"
}
}
},
{
"id": "build.project.mac",
"title": "Build your C++ file",
"description": "Create a default build task for your project. \n[Learn more](https://code.visualstudio.com/docs/cpp/config-clang-mac#_build-helloworldcpp)",
"when": "isMac",
"media": {
Comment thread
jureid marked this conversation as resolved.
Resolved
"altText": "A markdown file with instructions for configuring the default build task on macOS with Clang.",
"path": "walkthrough/buildtask/build-project-mac.md"
}
},
{
"id": "build.project.linux",
"title": "Build your C++ file",
"description": "Create a default build task for your project. \n[Learn more](https://code.visualstudio.com/docs/cpp/config-linux#_build-helloworldcpp)",
"when": "isLinux",
"media": {
"altText": "A markdown file with instructions for configuring the default build task on Linux with GCC.",
"path": "walkthrough/buildtask/build-project-linux.md"
}
},
{
"id": "build.project.windows",
"title": "Build your C++ file",
"description": "Create a default build task for your project. \n[Learn more](https://code.visualstudio.com/docs/cpp/config-msvc#_build-helloworldcpp)",
"when": "isWindows",
"media": {
"altText": "A markdown file with instructions for configuring the default build task on Windows with MSVC.",
"path": "walkthrough/buildtask/build-project-windows.md"
}
},
{
"id": "run.project.mac",
"title": "Run and debug your C++ file",
"description": "Create a debug configuration for your project. \n[Learn more](https://code.visualstudio.com/docs/cpp/config-clang-mac#_debug-helloworldcpp)",
"when": "isMac",
"media": {
"altText": "A markdown file with instructions for starting a debugging session on macOS.",
"path": "walkthrough/debugconfig/run-and-debug-project-mac.md"
}
},
{
"id": "run.project.linux",
"title": "Run and debug your C++ file",
"description": "Create a debug configuration for your project. \n[Learn more](https://code.visualstudio.com/docs/cpp/config-linux#_debug-helloworldcpp)",
"when": "isLinux",
"media": {
"altText": "A markdown file with instructions for starting a debugging session on Linux.",
"path": "walkthrough/debugconfig/run-and-debug-project-linux.md"
}
},
{
"id": "run.project.windows",
"title": "Run and debug your C++ file",
"description": "Create a debug configuration for your project. \n[Learn more](https://code.visualstudio.com/docs/cpp/config-msvc#_debug-helloworldcpp)",
"when": "isWindows",
"media": {
"altText": "A markdown file with instructions for starting a debugging session on Windows.",
"path": "walkthrough/debugconfig/run-and-debug-project-windows.md"
}
},
{
"id": "install.cmake.tools",
"title": "Install CMake Tools",
Comment thread
jureid marked this conversation as resolved.
Resolved
"description": "Do you build your project with CMake? Install the CMake Tools extension to seamlessly build and debug your CMake project. \n[Install CMake Tools](command:workbench.extensions.installExtension?%22ms-vscode.cmake-tools%22)",
"completionEvents": [
"extensionInstalled:ms-vscode.cmake-tools"
],
"media": {
Comment thread
jureid marked this conversation as resolved.
Resolved
"altText": "A screenshot of the CMake Tools extension page in the Marketplace.",
"path": {
"light": "walkthrough/images/cmake-tools-light.png",
"dark": "walkthrough/images/cmake-tools-dark.png",
"hc": "walkthrough/images/cmake-tools-hc.png"
}
}
},
{
"id": "watch.tutorials",
"title": "Lean back and get started",
Comment thread
sean-mcmanus marked this conversation as resolved.
Resolved
"description": "Watch this series of short and practical videos about setting up C++ IntelliSense and building and debugging C++ projects. \n[Watch Tutorials](https://code.visualstudio.com/docs/cpp/introvideos-cpp)",
"media": {
"altText": "A screenshot with a preview of the video tutorial and a play button.",
"path": "walkthrough/images/getting-started-video.png"
}
}
]
}
],
"taskDefinitions": [
{
"type": "cppbuild",
Expand Down Expand Up @@ -2847,4 +2998,4 @@
"integrity": "E5046509D510086B99F171595114220AD8E9F820E7238B6A5199CD78B9AD2078"
}
]
}
}
51 changes: 39 additions & 12 deletions Extension/src/LanguageServer/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -596,11 +596,12 @@ export interface Client {
handleConfigurationProviderSelectCommand(): Promise<void>;
handleShowParsingCommands(): Promise<void>;
handleReferencesIcon(): void;
handleConfigurationEditCommand(): void;
handleConfigurationEditJSONCommand(): void;
handleConfigurationEditUICommand(): void;
handleConfigurationEditCommand(viewColumn?: vscode.ViewColumn): void;
handleConfigurationEditJSONCommand(viewColumn?: vscode.ViewColumn): void;
handleConfigurationEditUICommand(viewColumn?: vscode.ViewColumn): void;
handleAddToIncludePathCommand(path: string): void;
handleGoToDirectiveInGroup(next: boolean): Promise<void>;
handleCheckForCompiler(): Promise<void>;
onInterval(): void;
dispose(): void;
addFileAssociations(fileAssociations: string, languageId: string): void;
Expand Down Expand Up @@ -2620,16 +2621,16 @@ export class DefaultClient implements Client {
}
}

public handleConfigurationEditCommand(): void {
this.notifyWhenLanguageClientReady(() => this.configuration.handleConfigurationEditCommand(undefined, vscode.window.showTextDocument));
public handleConfigurationEditCommand(viewColumn: vscode.ViewColumn = vscode.ViewColumn.Active): void {
this.notifyWhenLanguageClientReady(() => this.configuration.handleConfigurationEditCommand(undefined, vscode.window.showTextDocument, viewColumn));
}

public handleConfigurationEditJSONCommand(): void {
this.notifyWhenLanguageClientReady(() => this.configuration.handleConfigurationEditJSONCommand(undefined, vscode.window.showTextDocument));
public handleConfigurationEditJSONCommand(viewColumn: vscode.ViewColumn = vscode.ViewColumn.Active): void {
this.notifyWhenLanguageClientReady(() => this.configuration.handleConfigurationEditJSONCommand(undefined, vscode.window.showTextDocument, viewColumn));
}

public handleConfigurationEditUICommand(): void {
this.notifyWhenLanguageClientReady(() => this.configuration.handleConfigurationEditUICommand(undefined, vscode.window.showTextDocument));
public handleConfigurationEditUICommand(viewColumn: vscode.ViewColumn = vscode.ViewColumn.Active): void {
this.notifyWhenLanguageClientReady(() => this.configuration.handleConfigurationEditUICommand(undefined, vscode.window.showTextDocument, viewColumn));
}

public handleAddToIncludePathCommand(path: string): void {
Expand Down Expand Up @@ -2660,6 +2661,31 @@ export class DefaultClient implements Client {
}
}

public async handleCheckForCompiler(): Promise<void> {
await this.awaitUntilLanguageClientReady();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated to this PR, but this naming seems odd since the method itself doesn't "await"...not sure what a better name would be though.

const compilers: configs.KnownCompiler[] | undefined = await this.getKnownCompilers();
Comment thread
Colengms marked this conversation as resolved.
Resolved
Comment thread
sean-mcmanus marked this conversation as resolved.
Resolved
if (!compilers || compilers.length === 0) {
const compilerName: string = process.platform === "win32" ? "MSVC" : (process.platform === "darwin" ? "Clang" : "GCC");
Comment thread
jureid marked this conversation as resolved.
Resolved
vscode.window.showInformationMessage(localize("no.compilers.found", "No C++ compilers were found on your system. For your platform, we recommend installing {0} using the instructions in the editor.", compilerName), { modal: true });
} else {
const header: string = localize("compilers.found", "We found the following C++ compiler(s) on your system:");
Comment thread
jureid marked this conversation as resolved.
Resolved
let message: string = header + "\n";
const settings: CppSettings = new CppSettings(this.RootUri);
const pathSeparator: string | undefined = settings.preferredPathSeparator;
compilers.forEach(compiler => {
if (pathSeparator !== "Forward Slash") {
message += "\n" + compiler.path.replace(/\//g, '\\');
} else {
message += "\n" + compiler.path.replace(/\\/g, '/');
}
});
if (compilers.length > 1) {
message += "\n\n" + localize("compilers.found.message", "You can specify which compiler to use in your project's IntelliSense Configuration.");
}
vscode.window.showInformationMessage(message, { modal: true });
}
}

public onInterval(): void {
// These events can be discarded until the language client is ready.
// Don't queue them up with this.notifyWhenLanguageClientReady calls.
Expand Down Expand Up @@ -2823,11 +2849,12 @@ class NullClient implements Client {
handleConfigurationProviderSelectCommand(): Promise<void> { return Promise.resolve(); }
handleShowParsingCommands(): Promise<void> { return Promise.resolve(); }
handleReferencesIcon(): void {}
handleConfigurationEditCommand(): void {}
handleConfigurationEditJSONCommand(): void {}
handleConfigurationEditUICommand(): void {}
handleConfigurationEditCommand(viewColumn?: vscode.ViewColumn): void {}
handleConfigurationEditJSONCommand(viewColumn?: vscode.ViewColumn): void {}
handleConfigurationEditUICommand(viewColumn?: vscode.ViewColumn): void {}
handleAddToIncludePathCommand(path: string): void { }
handleGoToDirectiveInGroup(next: boolean): Promise<void> { return Promise.resolve(); }
handleCheckForCompiler(): Promise<void> { return Promise.resolve(); }
onInterval(): void {}
dispose(): void {
this.booleanEvent.dispose();
Expand Down
17 changes: 9 additions & 8 deletions Extension/src/LanguageServer/configurations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -914,17 +914,17 @@ export class CppProperties {
}

// onBeforeOpen will be called after c_cpp_properties.json have been created (if it did not exist), but before the document is opened.
public handleConfigurationEditCommand(onBeforeOpen: (() => void) | undefined, showDocument: (document: vscode.TextDocument) => void): void {
public handleConfigurationEditCommand(onBeforeOpen: (() => void) | undefined, showDocument: (document: vscode.TextDocument, column?: vscode.ViewColumn) => void, viewColumn?: vscode.ViewColumn): void {
const otherSettings: OtherSettings = new OtherSettings(this.rootUri);
if (otherSettings.settingsEditor === "ui") {
this.handleConfigurationEditUICommand(onBeforeOpen, showDocument);
this.handleConfigurationEditUICommand(onBeforeOpen, showDocument, viewColumn);
} else {
this.handleConfigurationEditJSONCommand(onBeforeOpen, showDocument);
this.handleConfigurationEditJSONCommand(onBeforeOpen, showDocument, viewColumn);
}
}

// onBeforeOpen will be called after c_cpp_properties.json have been created (if it did not exist), but before the document is opened.
public async handleConfigurationEditJSONCommand(onBeforeOpen: (() => void) | undefined, showDocument: (document: vscode.TextDocument) => void): Promise<void> {
public async handleConfigurationEditJSONCommand(onBeforeOpen: (() => void) | undefined, showDocument: (document: vscode.TextDocument, column?: vscode.ViewColumn) => void, viewColumn?: vscode.ViewColumn): Promise<void> {
await this.ensurePropertiesFile();
console.assert(this.propertiesFile);
if (onBeforeOpen) {
Expand All @@ -934,7 +934,7 @@ export class CppProperties {
if (this.propertiesFile) {
const document: vscode.TextDocument = await vscode.workspace.openTextDocument(this.propertiesFile);
if (showDocument) {
showDocument(document);
showDocument(document, viewColumn);
}
}
}
Expand All @@ -953,7 +953,7 @@ export class CppProperties {
}

// onBeforeOpen will be called after c_cpp_properties.json have been created (if it did not exist), but before the document is opened.
public async handleConfigurationEditUICommand(onBeforeOpen: (() => void) | undefined, showDocument: (document: vscode.TextDocument) => void): Promise<void> {
public async handleConfigurationEditUICommand(onBeforeOpen: (() => void) | undefined, showDocument: (document: vscode.TextDocument, column?: vscode.ViewColumn) => void, viewColumn?: vscode.ViewColumn): Promise<void> {
await this.ensurePropertiesFile();
if (this.propertiesFile) {
if (onBeforeOpen) {
Expand All @@ -968,14 +968,15 @@ export class CppProperties {
this.settingsPanel.selectedConfigIndex = this.CurrentConfigurationIndex;
this.settingsPanel.createOrShow(configNames,
this.configurationJson.configurations[this.settingsPanel.selectedConfigIndex],
this.getErrorsForConfigUI(this.settingsPanel.selectedConfigIndex));
this.getErrorsForConfigUI(this.settingsPanel.selectedConfigIndex),
viewColumn);
}
}
} else {
// Parse failed, open json file
const document: vscode.TextDocument = await vscode.workspace.openTextDocument(this.propertiesFile);
if (showDocument) {
showDocument(document);
showDocument(document, viewColumn);
}
}
}
Expand Down
Loading