Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update C++ properties to for intellisense #594

Merged
merged 2 commits into from
Nov 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
32 changes: 23 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.6.9",
"publisher": "ms-iot",
"engines": {
"vscode": "^1.56.0"
"vscode": "^1.62.0"
},
"author": {
"name": "Microsoft Corporation"
Expand Down Expand Up @@ -364,15 +364,15 @@
"xmlrpc": "^1.3.2"
},
"devDependencies": {
"@types/glob": "^7.1.4",
"@types/glob": "^7.2.0",
"@types/js-yaml": "^4.0.4",
"@types/mocha": "^9.0.0",
"@types/node": "^16.11.6",
"@types/shell-quote": "^1.7.1",
"@types/tmp": "^0.2.2",
"@types/vscode": "^1.56.0",
"@types/vscode": "^1.62.0",
"@types/xmlrpc": "^1.3.7",
"glob": "^7.1.7",
"glob": "^7.2.0",
"mocha": "^9.1.3",
"tslint": "^6.1.3",
"typescript": "^4.4.4",
Expand Down
4 changes: 2 additions & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,10 @@ function activateEnvironment(context: vscode.ExtensionContext, buildToolDetected
else {
subscriptions.push(
vscode.commands.registerCommand(Commands.CreateCatkinPackage, () => {
vscode.window.showErrorMessage(`${Commands.CreateCatkinPackage} requires a catkin workspace to be opened`);
vscode.window.showErrorMessage(`${Commands.CreateCatkinPackage} requires a ROS workspace to be opened`);
}),
vscode.commands.registerCommand(Commands.Rosdep, () => {
vscode.window.showErrorMessage(`${Commands.Rosdep} requires a catkin workspace to be opened`);
vscode.window.showErrorMessage(`${Commands.Rosdep} requires a ROS workspace to be opened`);
}),
);
}
Expand Down
13 changes: 10 additions & 3 deletions src/ros/build-env-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ async function updateCppPropertiesInternal(): Promise<void> {
const workspaceIncludes = await rosApi.getWorkspaceIncludeDirs(extension.baseDir);
includes = includes.concat(workspaceIncludes);

if (process.platform !== "win32") {
if (process.platform === "linux") {
includes.push(path.join("/", "usr", "include"));
}

Expand All @@ -61,8 +61,8 @@ async function updateCppPropertiesInternal(): Promise<void> {
configurations: [
{
browse: {
databaseFilename: "",
limitSymbolsToIncludedHeaders: true,
databaseFilename: "${workspaceFolder}/.vscode/browse.vc.db",
limitSymbolsToIncludedHeaders: false,
},
includePath: includes,
name: "ROS",
Expand All @@ -71,6 +71,13 @@ async function updateCppPropertiesInternal(): Promise<void> {
version: 4,
};

if (process.platform === "linux") {
cppProperties.configurations[0].intelliSenseMode = "gcc-" + process.arch
cppProperties.configurations[0].compilerPath = "/usr/bin/gcc"
cppProperties.configurations[0].cStandard = "gnu11"
cppProperties.configurations[0].cppStandard = "c++14"
}

// Ensure the ".vscode" directory exists then update the C++ path.
const dir = path.join(vscode.workspace.rootPath, ".vscode");

Expand Down