Skip to content

Commit

Permalink
Merge pull request #12900 from microsoft/main
Browse files Browse the repository at this point in the history
Merge for 1.23.0 (2nd time)
  • Loading branch information
sean-mcmanus authored Oct 29, 2024
2 parents bfa36bc + d56740e commit 381d696
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Extension/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# C/C++ for Visual Studio Code Changelog

## Version 1.23.0: October 24, 2024
## Version 1.23.0: October 29, 2024
### Enhancements
* Update to clang-format and clang-tidy 19.1.2. [#12824](https://github.com/microsoft/vscode-cpptools/issues/12824)
* Enable `#cpp` with GitHub Copilot chat without `C_Cpp.experimentalFeatures` enabled. [PR #12898](https://github.com/microsoft/vscode-cpptools/pull/12898)

### Bug Fixes
* Fix some translation issues. [#7824](https://github.com/microsoft/vscode-cpptools/issues/7824), [#12439](https://github.com/microsoft/vscode-cpptools/issues/12439), [#12440](https://github.com/microsoft/vscode-cpptools/issues/12440), [#12441](https://github.com/microsoft/vscode-cpptools/issues/12441)
Expand Down
2 changes: 1 addition & 1 deletion Extension/src/Debugger/configurationProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv

// Run deploy steps
if (config.deploySteps && config.deploySteps.length !== 0) {
const codeVersion: number[] = vscode.version.split('.').map(num => parseInt(num, undefined));
const codeVersion: number[] = util.getVsCodeVersion();
if ((util.isNumber(codeVersion[0]) && codeVersion[0] < 1) || (util.isNumber(codeVersion[0]) && codeVersion[0] === 1 && util.isNumber(codeVersion[1]) && codeVersion[1] < 69)) {
void logger.getOutputChannelLogger().showErrorMessage(localize("vs.code.1.69+.required", "'deploySteps' require VS Code 1.69+."));
return undefined;
Expand Down
12 changes: 9 additions & 3 deletions Extension/src/LanguageServer/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,15 @@ export async function activate(): Promise<void> {
activeDocument = activeEditor.document;
}

if (util.extensionContext && new CppSettings().experimentalFeatures) {
const tool = vscode.lm.registerTool('cpptools-lmtool-configuration', new CppConfigurationLanguageModelTool());
disposables.push(tool);
if (util.extensionContext) {
// lmTools wasn't stabilized until 1.95, but (as of October 2024)
// cpptools can be installed on older versions of VS Code. See
// https://github.com/microsoft/vscode-cpptools/blob/main/Extension/package.json#L14
const version = util.getVsCodeVersion();
if (version[0] > 1 || (version[0] === 1 && version[1] >= 95)) {
const tool = vscode.lm.registerTool('cpptools-lmtool-configuration', new CppConfigurationLanguageModelTool());
disposables.push(tool);
}
}

await registerRelatedFilesProvider();
Expand Down
4 changes: 4 additions & 0 deletions Extension/src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1814,3 +1814,7 @@ export function findExePathInArgs(args: CommandString[]): string | undefined {

return undefined;
}

export function getVsCodeVersion(): number[] {
return vscode.version.split('.').map(num => parseInt(num, undefined));
}

0 comments on commit 381d696

Please sign in to comment.