Skip to content

Commit 296bee8

Browse files
authored
Switch to Select IntelliSense Configuration (#10771)
* Switch to Select IntelliSense Configuration * Update version and changelog for 1.15.2
1 parent ec49779 commit 296bee8

File tree

11 files changed

+506
-199
lines changed

11 files changed

+506
-199
lines changed

Extension/CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
11
# C/C++ for Visual Studio Code Changelog
22

3+
## Version 1.15.2: March 12, 2023
4+
### Enhancements
5+
* Add a "Configure IntelliSense" status bar warning. [#10685](https://github.com/microsoft/vscode-cpptools/issues/10685)
6+
* Update to clang-format/tidy 16. [#10725](https://github.com/microsoft/vscode-cpptools/issues/10725)
7+
* Move the configuration status bar item out of the language status UI. [#10755](https://github.com/microsoft/vscode-cpptools/issues/10755)
8+
* Change `Select Default Compiler` to `Select IntelliSense Configuration` with configuration providers and compile commands added. [#10756](https://github.com/microsoft/vscode-cpptools/issues/10756)
9+
10+
### Bug Fixes
11+
* Support use of `ccache` in `compilerPath` and `compile_commands.json` command lines. [#7616](https://github.com/microsoft/vscode-cpptools/issues/7616)
12+
* Fix two vcFormat settings being inverted. [#10262](https://github.com/microsoft/vscode-cpptools/issues/10262), [#10263](https://github.com/microsoft/vscode-cpptools/issues/10263)
13+
* Fix the browse configuration provider cache not getting cleared. [#10692](https://github.com/microsoft/vscode-cpptools/issues/10692)
14+
* Fix a crash with recursive environment variables on Windows. [#10704](https://github.com/microsoft/vscode-cpptools/issues/10704)
15+
* Fix `#import` of `.tlb` files failing due to `/Fo` arguments to `cl.exe` not being processed. [#10710](https://github.com/microsoft/vscode-cpptools/issues/10710)
16+
* Fix `cppbuild` tasks not using the workspace folder as the `cwd` by default. [#10742](https://github.com/microsoft/vscode-cpptools/issues/10742)
17+
* Fix lots of IntelliSense processes getting launched after a Find/Replace operation (potentially freezing the OS). [#10743](https://github.com/microsoft/vscode-cpptools/issues/10743)
18+
* Fix workspace folder variable resolution with `clang_format_style`. [#10752](https://github.com/microsoft/vscode-cpptools/issues/10752)
19+
* For remote attach, use an absolute `/bin/sh` path on Linux. [PR #10765](https://github.com/microsoft/vscode-cpptools/pull/10765)
20+
* Fix the first registered configuration provider still being automatically used after a second registers. [PR #10772](https://github.com/microsoft/vscode-cpptools/pull/10772)
21+
* Fix `C_Cpp.default.compilerPath` in the settings UI showing a string editor when it shouldn't. [#10795](https://github.com/microsoft/vscode-cpptools/issues/10795)
22+
* Fix some issues due to usage of the spread operator not doing a deep copy. [PR #10803](https://github.com/microsoft/vscode-cpptools/pull/10803)
23+
324
## Version 1.15.1: March 22, 2023
425
### Bug Fixes
526
* Fix crashes with a multiroot workspace. [#10636](https://github.com/microsoft/vscode-cpptools/issues/10636)

Extension/package.json

Lines changed: 11 additions & 2 deletions
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": "1.15.1-main",
5+
"version": "1.15.2-main",
66
"publisher": "ms-vscode",
77
"icon": "LanguageCCPP_color_128x.png",
88
"readme": "README.md",
@@ -3006,6 +3006,11 @@
30063006
"title": "%c_cpp.command.selectDefaultCompiler.title%",
30073007
"category": "C/C++"
30083008
},
3009+
{
3010+
"command": "C_Cpp.SelectIntelliSenseConfiguration",
3011+
"title": "%c_cpp.command.selectIntelliSenseConfiguration.title%",
3012+
"category": "C/C++"
3013+
},
30093014
{
30103015
"command": "C_Cpp.RescanCompilers",
30113016
"title": "%c_cpp.command.rescanCompilers.title%",
@@ -5501,6 +5506,10 @@
55015506
"command": "C_Cpp.referencesViewUngroupByType",
55025507
"when": "cpptools.hasReferencesResults"
55035508
},
5509+
{
5510+
"command": "C_Cpp.SelectDefaultCompiler",
5511+
"when": "never"
5512+
},
55045513
{
55055514
"command": "C_Cpp.RescanCompilers",
55065515
"when": "never"
@@ -5990,7 +5999,7 @@
59905999
"generateOptionsSchema": "node ./tools/prepublish.js && node ./out/tools/generateOptionsSchema.js",
59916000
"generate-native-strings": "node ./tools/prepublish.js && gulp generate-native-strings",
59926001
"translations-export": "node ./tools/prepublish.js && gulp generate-native-strings && gulp translations-export",
5993-
"translations-generate": "node ./tools/prepublish.js && gulp translations-generate",
6002+
"translations-generate": "node ./tools/prepublish.js && set NODE_OPTIONS=--no-experimental-fetch && gulp translations-generate",
59946003
"translations-import": "node ./tools/prepublish.js && gulp translations-import",
59956004
"copy-walkthrough-media": "node ./tools/prepublish.js && gulp copy-walkthrough-media",
59966005
"prepublishjs": "node ./tools/prepublish.js",

Extension/package.nls.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"c_cpp.command.configurationProviderSelect.title": "Change Configuration Provider...",
1212
"c_cpp.command.configurationEditJSON.title": "Edit Configurations (JSON)",
1313
"c_cpp.command.configurationEditUI.title": "Edit Configurations (UI)",
14-
"c_cpp.command.selectDefaultCompiler.title": "Select Default Compiler",
14+
"c_cpp.command.selectDefaultCompiler.title": "Select Default Compiler...",
15+
"c_cpp.command.selectIntelliSenseConfiguration.title": "Select IntelliSense Configuration...",
1516
"c_cpp.command.rescanCompilers.title": "Rescan for Compilers",
1617
"c_cpp.command.switchHeaderSource.title": "Switch Header/Source",
1718
"c_cpp.command.enableErrorSquiggles.title": "Enable Error Squiggles",

Extension/src/LanguageServer/Providers/codeActionProvider.ts

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,16 @@ export class CodeActionProvider implements vscode.CodeActionProvider {
6767
throw new vscode.CancellationError();
6868
}
6969

70-
let hasSelectDefaultCompiler: boolean = false;
71-
let hasConfigurationCompilerPath: boolean = false;
70+
let hasSelectIntelliSenseConfiguration: boolean = false;
71+
const settings: CppSettings = new CppSettings(this.client.RootUri);
72+
const hasConfigurationSet: boolean = settings.defaultCompilerPath !== undefined ||
73+
!!settings.defaultCompileCommands || !!settings.defaultConfigurationProvider ||
74+
this.client.configuration.CurrentConfiguration?.compilerPath !== undefined ||
75+
!!this.client.configuration.CurrentConfiguration?.compileCommands ||
76+
!!this.client.configuration.CurrentConfiguration?.configurationProvider ||
77+
this.client.configuration.CurrentConfiguration?.compilerPathInCppPropertiesJson !== undefined ||
78+
!!this.client.configuration.CurrentConfiguration?.compileCommandsInCppPropertiesJson ||
79+
!!this.client.configuration.CurrentConfiguration?.configurationProviderInCppPropertiesJson;
7280

7381
// Convert to vscode.CodeAction array
7482
response.commands.forEach((command) => {
@@ -173,15 +181,14 @@ export class CodeActionProvider implements vscode.CodeActionProvider {
173181
return;
174182
} else if (command.command === 'C_Cpp.CreateDeclarationOrDefinition' && (command.arguments ?? []).length === 0) {
175183
command.arguments = ['codeAction']; // We report the sender of the command
176-
} else if (command.command === "C_Cpp.SelectDefaultCompiler") {
184+
} else if (command.command === "C_Cpp.SelectIntelliSenseConfiguration") {
177185
command.arguments = ['codeAction'];
178-
hasSelectDefaultCompiler = true;
179-
if (this.client.configuration.CurrentConfiguration?.rawCompilerPath !== undefined) {
180-
hasConfigurationCompilerPath = true;
186+
hasSelectIntelliSenseConfiguration = true;
187+
if (hasConfigurationSet) {
181188
return;
182189
}
183-
} else if (command.command === "C_Cpp.ConfigurationEdit" && hasSelectDefaultCompiler) {
184-
if (hasConfigurationCompilerPath) {
190+
} else if (command.command === "C_Cpp.ConfigurationEdit" && hasSelectIntelliSenseConfiguration) {
191+
if (hasConfigurationSet) {
185192
title = title.replace("includePath", "compilerPath");
186193
} else {
187194
return;

0 commit comments

Comments
 (0)