Skip to content

Commit d786b0f

Browse files
authored
Merge pull request #2029 from Microsoft/seanmcm/0_17_3_release
Seanmcm/0 17 3 release
2 parents 5883747 + df7b77b commit d786b0f

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

Extension/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# C/C++ for Visual Studio Code Change Log
22

3-
## Version 0.17.2: May 21, 2018
3+
## Version 0.17.3: May 22, 2018
4+
* Add support for `${workspaceFolder:folderName}`. [#1774](https://github.com/Microsoft/vscode-cpptools/issues/1774)
45
* Fix infinite loop during initialization on Windows. [#1960](https://github.com/Microsoft/vscode-cpptools/issues/1960)
56
* Fix main process IntelliSense-related crashes. [#2006](https://github.com/Microsoft/vscode-cpptools/issues/2006)
67
* Fix deadlock after formatting large files. [#2007](https://github.com/Microsoft/vscode-cpptools/issues/2007)

Extension/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Extension/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "cpptools",
33
"displayName": "C/C++",
44
"description": "C/C++ IntelliSense, debugging, and code browsing.",
5-
"version": "0.17.2",
5+
"version": "0.17.3",
66
"publisher": "ms-vscode",
77
"preview": true,
88
"icon": "LanguageCCPP_color_128x.png",

Extension/src/common.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ export function resolveVariables(input: string, additionalEnvironment: {[key: st
152152
}
153153

154154
// Replace environment and configuration variables.
155-
let regexp: RegExp = /\$\{((env|config)(.|:))?(.*?)\}/g;
155+
let regexp: RegExp = /\$\{((env|config|workspaceFolder)(.|:))?(.*?)\}/g;
156156
let ret: string = input.replace(regexp, (match: string, ignored1: string, varType: string, ignored2: string, name: string) => {
157157
// Historically, if the variable didn't have anything before the "." or ":"
158158
// it was assumed to be an environment variable
@@ -180,6 +180,18 @@ export function resolveVariables(input: string, additionalEnvironment: {[key: st
180180
newValue = (config) ? config.toString() : undefined;
181181
break;
182182
}
183+
case "workspaceFolder": {
184+
// Only replace ${workspaceFolder:name} variables for now.
185+
// We may consider doing replacement of ${workspaceFolder} here later, but we would have to update the language server and also
186+
// intercept messages with paths in them and add the ${workspaceFolder} variable back in (e.g. for light bulb suggestions)
187+
if (name && vscode.workspace && vscode.workspace.workspaceFolders) {
188+
let folder: vscode.WorkspaceFolder = vscode.workspace.workspaceFolders.find(folder => folder.name.toLocaleLowerCase() === name.toLocaleLowerCase());
189+
if (folder) {
190+
newValue = folder.uri.fsPath;
191+
}
192+
}
193+
break;
194+
}
183195
default: { assert.fail("unknown varType matched"); }
184196
}
185197
return (newValue) ? newValue : match;

0 commit comments

Comments
 (0)