Skip to content

Commit 879d880

Browse files
authored
Seanmcm/windows sdk version (#2241)
* Add windowsSDKVersion.
1 parent 16c4def commit 879d880

File tree

5 files changed

+26
-1
lines changed

5 files changed

+26
-1
lines changed

Extension/CHANGELOG.md

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

33
## Version 0.17.7: July 16, 2018
4+
* Add `windowsSdkVersion` to `c_cpp_properties.json`. [#1585](https://github.com/Microsoft/vscode-cpptools/issues/1585)
45
* Add `${vcpkgRoot}` variable. [#1817](https://github.com/Microsoft/vscode-cpptools/issues/1817)
56
* Skip automatic parsing of source files in Mac system framework paths. [#2156](https://github.com/Microsoft/vscode-cpptools/issues/2156)
67
* Fix `Edit Configurations...` not working after `c_cpp_properties.json` is deleted. [#2214](https://github.com/Microsoft/vscode-cpptools/issues/2214)

Extension/c_cpp_properties.schema.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@
5858
"type": "string"
5959
}
6060
},
61+
"windowsSdkVersion": {
62+
"description": "Version of the Windows SDK include path to use on Windows, e.g. '10.0.17134.0'.",
63+
"type": "string",
64+
"pattern": "^\\d{2}\\.\\d{1}\\.\\d{5}\\.\\d{1}$|^8\\.1$"
65+
},
6166
"defines": {
6267
"description": "A list of preprocessor definitions for the IntelliSense engine to use while parsing files. Optionally, use = to set a value, e.g. VERSION=1.",
6368
"type": "array",

Extension/package.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,16 @@
286286
"description": "The value to use in a configuration if \"macFrameworkPath\" is not specified, or the values to insert if \"${default}\" is present in \"macFrameworkPath\".",
287287
"scope": "resource"
288288
},
289+
"C_Cpp.default.windowsSdkVersion": {
290+
"type": [
291+
"string",
292+
"null"
293+
],
294+
"default": null,
295+
"description": "Version of the Windows SDK include path to use on Windows, e.g. '10.0.17134.0'.",
296+
"pattern": "^\\d{2}\\.\\d{1}\\.\\d{5}\\.\\d{1}$|^8\\.1$",
297+
"scope": "resource"
298+
},
289299
"C_Cpp.default.compileCommands": {
290300
"type": [
291301
"string",
@@ -1518,4 +1528,4 @@
15181528
"binaries": []
15191529
}
15201530
]
1521-
}
1531+
}

Extension/src/LanguageServer/configurations.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ export interface Configuration {
4848
cppStandard?: string;
4949
includePath?: string[];
5050
macFrameworkPath?: string[];
51+
windowsSdkVersion?: string;
5152
defines?: string[];
5253
intelliSenseMode?: string;
5354
compileCommands?: string;
@@ -68,6 +69,7 @@ export interface CompilerDefaults {
6869
cppStandard: string;
6970
includes: string[];
7071
frameworks: string[];
72+
windowsSdkVersion: string;
7173
intelliSenseMode: string;
7274
}
7375

@@ -85,6 +87,7 @@ export class CppProperties {
8587
private defaultCppStandard: string = null;
8688
private defaultIncludes: string[] = null;
8789
private defaultFrameworks: string[] = null;
90+
private defaultWindowsSdkVersion: string = null;
8891
private vcpkgIncludes: string[] = [];
8992
private vcpkgPathReady: boolean = false;
9093
private defaultIntelliSenseMode: string = null;
@@ -162,6 +165,7 @@ export class CppProperties {
162165
this.defaultCppStandard = compilerDefaults.cppStandard;
163166
this.defaultIncludes = compilerDefaults.includes;
164167
this.defaultFrameworks = compilerDefaults.frameworks;
168+
this.defaultWindowsSdkVersion = compilerDefaults.windowsSdkVersion;
165169
this.defaultIntelliSenseMode = compilerDefaults.intelliSenseMode;
166170

167171
// defaultPaths is only used when there isn't a c_cpp_properties.json, but we don't send the configuration changed event
@@ -229,6 +233,9 @@ export class CppProperties {
229233
if (!settings.defaultMacFrameworkPath && process.platform === 'darwin') {
230234
configuration.macFrameworkPath = this.defaultFrameworks;
231235
}
236+
if (!settings.defaultWindowsSdkVersion && process.platform === 'win32') {
237+
configuration.windowsSdkVersion = this.defaultWindowsSdkVersion;
238+
}
232239
if (!settings.defaultCompilerPath && this.defaultCompilerPath) {
233240
configuration.compilerPath = this.defaultCompilerPath;
234241
}
@@ -426,6 +433,7 @@ export class CppProperties {
426433
configuration.includePath = this.updateConfiguration(configuration.includePath, settings.defaultIncludePath);
427434
configuration.defines = this.updateConfiguration(configuration.defines, settings.defaultDefines);
428435
configuration.macFrameworkPath = this.updateConfiguration(configuration.macFrameworkPath, settings.defaultMacFrameworkPath);
436+
configuration.windowsSdkVersion = this.updateConfiguration(configuration.windowsSdkVersion, settings.defaultWindowsSdkVersion);
429437
configuration.forcedInclude = this.updateConfiguration(configuration.forcedInclude, settings.defaultForcedInclude);
430438
configuration.compileCommands = this.updateConfiguration(configuration.compileCommands, settings.defaultCompileCommands);
431439
configuration.compilerPath = this.updateConfiguration(configuration.compilerPath, settings.defaultCompilerPath);

Extension/src/LanguageServer/settings.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ export class CppSettings extends Settings {
5252
public get defaultIncludePath(): string[] { return super.Section.get<string[]>("default.includePath"); }
5353
public get defaultDefines(): string[] { return super.Section.get<string[]>("default.defines"); }
5454
public get defaultMacFrameworkPath(): string[] { return super.Section.get<string[]>("default.macFrameworkPath"); }
55+
public get defaultWindowsSdkVersion(): string { return super.Section.get<string>("default.windowsSdkVersion"); }
5556
public get defaultCompileCommands(): string { return super.Section.get<string>("default.compileCommands"); }
5657
public get defaultForcedInclude(): string[] { return super.Section.get<string[]>("default.forcedInclude"); }
5758
public get defaultIntelliSenseMode(): string { return super.Section.get<string>("default.intelliSenseMode"); }

0 commit comments

Comments
 (0)