Skip to content

Commit

Permalink
Remove the 'Extract to function' experimentalFeatures requirement. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
sean-mcmanus authored Nov 8, 2023
1 parent 468149a commit 7d05139
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
10 changes: 8 additions & 2 deletions Extension/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
# C/C++ for Visual Studio Code Changelog

## Version 1.18.2: November 7, 2023
## Version 1.18.2: November 8, 2023
### Enhancement
* 'Extract to function' is enabled without `C_Cpp.experimentalFeatures` being set to `"enabled"`.

### Bug Fixes
* Fix 'Extract to function' for functions in a header file . [#11466](https://github.com/microsoft/vscode-cpptools/issues/11466)
* Fix 'Extract to function' for functions in an anonymous namespace. [#11474](https://github.com/microsoft/vscode-cpptools/issues/11474)
* Fix 'Extract to function' for C code with typedefs or structs. [#11475](https://github.com/microsoft/vscode-cpptools/issues/11475)
* Fix an IntelliSense crash when hovering over an invalid array index expression. [#11510](https://github.com/microsoft/vscode-cpptools/issues/11510)
* Fix 'Add #include' code actions not appearing for "is not a template" errors. [#11543](https://github.com/microsoft/vscode-cpptools/issues/11543)
* Fix 'Extract to function' bugs with formatting and selection. [#11614](https://github.com/microsoft/vscode-cpptools/issues/11614), [#11619](https://github.com/microsoft/vscode-cpptools/issues/11619)
* Fix 'Add #include' code actions being available for system headers that are already included. [#11618](https://github.com/microsoft/vscode-cpptools/issues/11618)
* Fix an IntelliSense crash when selecting code.

## Version 1.18.1: November 2, 2023
### New Feature
Expand All @@ -20,7 +27,6 @@
### Bug Fixes
* Fix no error message getting shown if 'Extract to Function' creation fails. [#11567](https://github.com/microsoft/vscode-cpptools/issues/11567)
* Fix an autocomplete crash bug (primarily on Mac).
* Fix an IntelliSense crash when selecting code.

## Version 1.18.0: October 12, 2023
### New Features
Expand Down
7 changes: 0 additions & 7 deletions Extension/src/LanguageServer/Providers/codeActionProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ export class CodeActionProvider implements vscode.CodeActionProvider {
this.client.configuration.CurrentConfiguration?.compilerPathInCppPropertiesJson !== undefined ||
!!this.client.configuration.CurrentConfiguration?.compileCommandsInCppPropertiesJson ||
!!this.client.configuration.CurrentConfiguration?.configurationProviderInCppPropertiesJson;
const hasExperimentalFeatures: boolean = new CppSettings().experimentalFeatures ?? false;

// Convert to vscode.CodeAction array
let hasInlineMacro: boolean = false;
Expand Down Expand Up @@ -216,17 +215,11 @@ export class CodeActionProvider implements vscode.CodeActionProvider {
}
} else if (command.command === "C_Cpp.ExtractToFunction" ||
command.command === "C_Cpp.ExtractToMemberFunction") {
if (!hasExperimentalFeatures) {
return;
}
codeActionKind = CodeActionProvider.extractToFunctionKind;
} else if (command.command === "C_Cpp.ExtractToFreeFunction") {
// TODO: https://github.com/microsoft/vscode-cpptools/issues/11473 needs to be fixed.
return;
} else if (command.command === "C_Cpp.ExpandSelection") {
if (!hasExperimentalFeatures) {
return;
}
codeActionKind = CodeActionProvider.expandSelectionKind;
}
const vscodeCodeAction: vscode.CodeAction = {
Expand Down

0 comments on commit 7d05139

Please sign in to comment.