Skip to content

Commit f58217f

Browse files
authored
Recursive includePath changes. (#1896)
* Recursive includePath changes. * Keep config/icons visible with settings json files.
1 parent f2d3281 commit f58217f

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

Extension/CHANGELOG.md

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

33
## Version 0.17.0: May 7, 2018
44
* Auto-complete for headers after typing `#include`. [#802](https://github.com/Microsoft/vscode-cpptools/issues/802)
5+
* Add support for recursive `includePath`, e.g. `${workspaceFolder}/**`. [#897](https://github.com/Microsoft/vscode-cpptools/issues/897)
56
* Configuration improvements. [#1338](https://github.com/Microsoft/vscode-cpptools/issues/1338)
67
* 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)
78
* 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)

Extension/src/LanguageServer/configurations.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ export class CppProperties {
201201

202202
if (!settings.defaultIncludePath) {
203203
// We don't add system includes to the includePath anymore. The language server has this information.
204-
configuration.includePath = ["${workspaceFolder}"].concat(this.vcpkgIncludes);
204+
configuration.includePath = ["${workspaceFolder}/**"].concat(this.vcpkgIncludes);
205205
}
206206
if (!settings.defaultBrowsePath) {
207207
// We don't add system includes to the includePath anymore. The language server has this information.

Extension/src/LanguageServer/ui.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,15 @@ export class UI {
110110

111111
public activeDocumentChanged(): void {
112112
let activeEditor: vscode.TextEditor = vscode.window.activeTextEditor;
113-
let show: boolean = (activeEditor && (activeEditor.document.languageId === "cpp" || activeEditor.document.languageId === "c"));
113+
let isCpp: boolean = (activeEditor && (activeEditor.document.languageId === "cpp" || activeEditor.document.languageId === "c"));
114114

115-
this.ShowConfiguration = show;
116-
this.ShowDBIcon = show;
117-
this.ShowFlameIcon = show;
118-
this.ShowNavigation = show;
115+
// It's sometimes desirable to see the config and icons when making settings changes.
116+
let isSettingsJson: boolean = (activeEditor && (activeEditor.document.fileName.endsWith("c_cpp_properties.json") || activeEditor.document.fileName.endsWith("settings.json")));
117+
118+
this.ShowConfiguration = isCpp || isSettingsJson;
119+
this.ShowDBIcon = isCpp || isSettingsJson;
120+
this.ShowFlameIcon = isCpp || isSettingsJson;
121+
this.ShowNavigation = isCpp;
119122
}
120123

121124
public bind(client: Client): void {

0 commit comments

Comments
 (0)