Skip to content

Commit d4e23a6

Browse files
committed
merge master for 0.17.0 insiders build
2 parents 1b218b2 + 80da21f commit d4e23a6

24 files changed

+854
-321
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ script:
3333
- npm install
3434
- npm run tslint
3535
- npm run compile
36+
# pr-check needs to run before test. test modifies package.json.
37+
- npm run pr-check
3638
- npm run test
3739

3840
after_failure:

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Contribution Steps
44

5-
* [Build and debug the extension](Documentation/Getting%20started.md#build-and-debug-the-cpptools-extension).
5+
* [Build and debug the extension](Documentation/Building%20the%20Extension.md).
66
* File an [issue](https://github.com/Microsoft/vscode-cpptools/issues) and a [pull request](https://github.com/Microsoft/vscode-cpptools/pulls) with the change and we will review it.
77
* If the change affects functionality, add a line describing the change to [**CHANGELOG.md**](Extension/CHANGELOG.md).
88
* Try and add a test in [**test/extension.test.ts**](Extension/test/unitTests/extension.test.ts).

Documentation/LanguageServer/MinGW.md

Lines changed: 43 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,49 @@
11
For developers using MinGW on Windows, we recommend you start with the following **c_cpp_properties.json** template. Select "C/Cpp: Edit Configurations" from the command palette to create this file if you haven't already.
22

3-
Note that you may have to change the MinGW version number to match what you have installed. Eg. `C:/MinGW/lib/gcc/mingw32/5.3.0/` instead of `C:/MinGW/lib/gcc/mingw32/6.3.0/`.
3+
## With extension version 0.16.1 and higher:
4+
5+
Starting with version 0.16.1, if you set the `compilerPath` property and change `intelliSenseMode` to `clang-x64`, you no longer need to copy the system include path or defines to `includePath` and `defines` to enable IntelliSense to work properly. However, `browse.path` still needs to be updated manually to add the system include paths to enable code browsing for system headers. For example:
6+
7+
```json
8+
{
9+
"configurations": [
10+
{
11+
"name": "MinGW",
12+
"intelliSenseMode": "clang-x64",
13+
"compilerPath": "C:/MinGW/bin/gcc.exe",
14+
"includePath": [
15+
"${workspaceRoot}",
16+
],
17+
"defines": [
18+
"_DEBUG"
19+
],
20+
"browse": {
21+
"path": [
22+
"C:/MinGW/lib/gcc/mingw32/6.3.0/include",
23+
"C:/MinGW/lib/gcc/mingw32/6.3.0/include-fixed",
24+
"C:/MinGW/include/*"
25+
"${workspaceRoot}",
26+
],
27+
"limitSymbolsToIncludedHeaders": true,
28+
"databaseFilename": ""
29+
}
30+
}
31+
],
32+
"version": 3
33+
}
34+
```
35+
36+
Note that the `browse.path` setting is not automatically updated at this time and you may have to change the MinGW version number to match what you have installed. If you are using a different MinGW distribution, the values for `compilerPath` and `browse.path` will likely be different than what is written here.
37+
38+
## With extension version 0.16.0 and earlier:
39+
40+
In earlier versions of the extension, the `includePath` and a some system defines need to be set in order for IntelliSense to work properly. Note that you may have to change the MinGW version number to match what you have installed. Eg. `C:/MinGW/lib/gcc/mingw32/5.3.0/` instead of `C:/MinGW/lib/gcc/mingw32/6.3.0/`.
441

542
```json
643
{
744
"configurations": [
845
{
9-
"name": "Win32",
46+
"name": "MinGW",
1047
"intelliSenseMode": "clang-x64",
1148
"includePath": [
1249
"${workspaceRoot}",
@@ -19,7 +56,6 @@ Note that you may have to change the MinGW version number to match what you have
1956
],
2057
"defines": [
2158
"_DEBUG",
22-
"UNICODE",
2359
"__GNUC__=6",
2460
"__cdecl=__attribute__((__cdecl__))"
2561
],
@@ -28,6 +64,7 @@ Note that you may have to change the MinGW version number to match what you have
2864
"C:/MinGW/lib/gcc/mingw32/6.3.0/include",
2965
"C:/MinGW/lib/gcc/mingw32/6.3.0/include-fixed",
3066
"C:/MinGW/include/*"
67+
"${workspaceRoot}",
3168
],
3269
"limitSymbolsToIncludedHeaders": true,
3370
"databaseFilename": ""
@@ -37,15 +74,15 @@ Note that you may have to change the MinGW version number to match what you have
3774
}
3875
```
3976

40-
The `includePath` above includes the system header paths that gcc uses in version 6.3.0 for C++ projects and matches the output of `gcc -v -E -x c++ -`. The `intelliSenseMode` should be set to **"clang-x64"** to get MinGW projects to work properly with IntelliSense. The `__GNUC__=#` define should match the major version of the toolchain in your installation (6 in this example).
77+
The `includePath` above includes the system header paths that gcc uses in version 6.3.0 for C++ projects and matches the output of `"gcc -v -E -x c++ nul"`. The `intelliSenseMode` should be set to **"clang-x64"** to get MinGW projects to work properly with IntelliSense. The `__GNUC__=#` define should match the major version of the toolchain in your installation (6 in this example).
4178

4279
For C projects, simply remove the C++ lines:
4380

4481
```json
4582
{
4683
"configurations": [
4784
{
48-
"name": "Win32",
85+
"name": "MinGW",
4986
"intelliSenseMode": "clang-x64",
5087
"includePath": [
5188
"${workspaceRoot}",
@@ -55,7 +92,6 @@ For C projects, simply remove the C++ lines:
5592
],
5693
"defines": [
5794
"_DEBUG",
58-
"UNICODE",
5995
"__GNUC__=6",
6096
"__cdecl=__attribute__((__cdecl__))"
6197
],
@@ -64,6 +100,7 @@ For C projects, simply remove the C++ lines:
64100
"C:/MinGW/lib/gcc/mingw32/6.3.0/include",
65101
"C:/MinGW/lib/gcc/mingw32/6.3.0/include-fixed",
66102
"C:/MinGW/include/*"
103+
"${workspaceRoot}",
67104
],
68105
"limitSymbolsToIncludedHeaders": true,
69106
"databaseFilename": ""
@@ -72,5 +109,3 @@ For C projects, simply remove the C++ lines:
72109
]
73110
}
74111
```
75-
76-
With these configurations, you should be all set up to use the new IntelliSense engine for linting, memberlist autocomplete, and quick info (tooltips). Add `"C_Cpp.intelliSenseEngine": "Default"` to your **settings.json** file to try out the new IntelliSense engine.

Documentation/LanguageServer/c_cpp_properties.json.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
This list of paths will be used by the Tag Parser to search for headers included by your source files. The Tag Parser will automatically search all subfolders in these paths unless the path ends with a `/*` or `\*`. For example, `/usr/include` directs the Tag Parser to search the `include` folder and its subfolders for headers while `/usr/include/*` directs the Tag Parser not to look in any subfolders of `/usr/include`.
7979

8080
* #### `limitSymbolsToIncludedHeaders`
81-
When true, the Tag Parser will only parse code files that have been directly or indirectly included by a source file in `${workspaceRoot}`. When false, the Tag Parser will parse all code files found in the paths specified in the **path** list.
81+
When true, the Tag Parser will only parse code files that have been directly or indirectly included by a source file in `${workspaceFolder}`. When false, the Tag Parser will parse all code files found in the paths specified in the **path** list.
8282

8383
* #### `databaseFilename`
84-
When set, this instructs the extension to save the Tag Parser's symbol database somewhere other than the workspace's default storage location. If a relative path is specified, it will be made relative to the workspace's default storage location, not the workspace folder itself. The `${workspaceRoot}` variable can be used to specify a path relative to the workspace folder (e.g. `$[workspaceRoot}/.vscode/browse.vc.db`)
84+
When set, this instructs the extension to save the Tag Parser's symbol database somewhere other than the workspace's default storage location. If a relative path is specified, it will be made relative to the workspace's default storage location, not the workspace folder itself. The `${workspaceFolder}` variable can be used to specify a path relative to the workspace folder (e.g. `${workspaceFolder}/.vscode/browse.vc.db`)

Extension/CHANGELOG.md

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

3-
## Version 0.16.0-insiders2: March 23, 2018
3+
## Version 0.17.0: May 7, 2018
4+
* Auto-complete for headers after typing `#include`. [#802](https://github.com/Microsoft/vscode-cpptools/issues/802)
5+
* Configuration improvements. [#1338](https://github.com/Microsoft/vscode-cpptools/issues/1338)
6+
* Potentially addresses: [#368](https://github.com/Microsoft/vscode-cpptools/issues/368), [#410](https://github.com/Microsoft/vscode-cpptools/issues/410), [#1229](https://github.com/Microsoft/vscode-cpptools/issues/1229), [#1270](https://github.com/Microsoft/vscode-cpptools/issues/), [#1404](https://github.com/Microsoft/vscode-cpptools/issues/1404)
7+
* Add support for querying system includes/defines from WSL and Cygwin compilers. [#1845](https://github.com/Microsoft/vscode-cpptools/issues/1845), [#1736](https://github.com/Microsoft/vscode-cpptools/issues/1736)
8+
* Stop automatically adding `/usr/include` to the `includePath`. [#1819](https://github.com/Microsoft/vscode-cpptools/issues/1819)
9+
* Fix wrong configuration being used if there are four or more. [#1599](https://github.com/Microsoft/vscode-cpptools/issues/1599)
10+
* Fix `c_cpp_properties.json` requiring write access. [#1790](https://github.com/Microsoft/vscode-cpptools/issues/1790)
11+
* Change file not found in `compile_commands.json` message from an error to a warning. [#1783](https://github.com/Microsoft/vscode-cpptools/issues/1783)
12+
* Fix an IntelliSense crash during completion requests. [#1782](https://github.com/Microsoft/vscode-cpptools/issues/1782)
13+
* Update the installed clang-format to 6.0.
14+
15+
## Version 0.16.1: March 30, 2018
16+
* Fix random deadlock caused by logging code on Linux/Mac. [#1759](https://github.com/Microsoft/vscode-cpptools/issues/1759)
17+
* Fix compiler from `compileCommands` not being queried for includes/defines if `compilerPath` isn't set on Windows. [#1754](https://github.com/Microsoft/vscode-cpptools/issues/1754)
18+
* Fix OSX `UseShellExecute` I/O bug. [#1756](https://github.com/Microsoft/vscode-cpptools/issues/1756)
19+
* Invalidate partially unzipped files from package manager. [#1757](https://github.com/Microsoft/vscode-cpptools/issues/1757)
20+
21+
## Version 0.16.0: March 28, 2018
422
* Enable autocomplete for local and global scopes. [#13](https://github.com/Microsoft/vscode-cpptools/issues/13)
523
* Add a setting to define multiline comment patterns: `C_Cpp.commentContinuationPatterns`. [#1100](https://github.com/Microsoft/vscode-cpptools/issues/1100), [#1539](https://github.com/Microsoft/vscode-cpptools/issues/1539)
624
* Add a setting to disable inactive region highlighting: `C_Cpp.dimInactiveRegions`. [#1592](https://github.com/Microsoft/vscode-cpptools/issues/1592)

Extension/c_cpp_properties.schema.json

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
],
1212
"properties": {
1313
"name": {
14-
"description": "Configuration identifier. Mac, Linux, or Win32 are special identifiers for configurations that will be auto-selected on those platforms, but the identifier can be anything.",
14+
"description": "Configuration identifier. Mac, Linux, and Win32 are special identifiers for configurations that will be auto-selected on those platforms, but the identifier can be anything.",
1515
"type": "string"
1616
},
1717
"compilerPath": {
@@ -24,7 +24,8 @@
2424
"enum": [
2525
"c89",
2626
"c99",
27-
"c11"
27+
"c11",
28+
"${default}"
2829
]
2930
},
3031
"cppStandard": {
@@ -35,7 +36,8 @@
3536
"c++03",
3637
"c++11",
3738
"c++14",
38-
"c++17"
39+
"c++17",
40+
"${default}"
3941
]
4042
},
4143
"compileCommands": {
@@ -64,12 +66,13 @@
6466
}
6567
},
6668
"intelliSenseMode": {
69+
"description": "If set, it overrides the default mode used by the IntelliSense engine. Windows defaults to msvc-x64 and Linux/Mac default to clang-x64.",
6770
"type": "string",
6871
"enum": [
6972
"msvc-x64",
70-
"clang-x64"
71-
],
72-
"description": "If set, it overrides the default mode used by the IntelliSense engine. Windows defaults to msvc-x64 and Linux/Mac default to clang-x64."
73+
"clang-x64",
74+
"${default}"
75+
]
7376
},
7477
"forcedInclude": {
7578
"description": "A list of files that should be included before any include file in a translation unit.",
@@ -83,7 +86,10 @@
8386
"properties": {
8487
"limitSymbolsToIncludedHeaders": {
8588
"description": "true to process only those files directly or indirectly included as headers, false to process all files under the specified include paths.",
86-
"type": "boolean"
89+
"type": [
90+
"boolean",
91+
"string"
92+
]
8793
},
8894
"databaseFilename": {
8995
"description": "Path to the generated symbol database. If a relative path is specified, it will be made relative to the workspace's default storage location.",

Extension/gulpfile.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const gulp = require('gulp');
99
const env = require('gulp-env')
1010
const tslint = require('gulp-tslint');
1111
const mocha = require('gulp-mocha');
12+
const fs = require('fs');
1213

1314
gulp.task('allTests', () => {
1415
gulp.start('unitTests');
@@ -73,4 +74,12 @@ gulp.task('tslint', () => {
7374
summarizeFailureOutput: false,
7475
emitError: false
7576
}))
77+
});
78+
79+
gulp.task('pr-check', () => {
80+
const packageJson = JSON.parse(fs.readFileSync('./package.json').toString());
81+
if (packageJson.activationEvents.length !== 1 && packageJson.activationEvents[0] !== '*') {
82+
console.log('Please make sure to not check in package.json that has been rewritten by the extension activation. If you intended to have changes in package.json, please only check-in your changes. If you did not, please run `git checkout -- package.json`.');
83+
process.exit(1);
84+
}
7685
});

Extension/package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)