From 84abc3ad32004de303c619a2cc4229dbdf407cb6 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Tue, 5 Aug 2025 10:58:50 -0700 Subject: [PATCH 1/6] Handle .txx/tpp headers. (#13811) * Handle .txx headers. * Add tpp too. --- Extension/src/LanguageServer/client.ts | 2 +- Extension/src/common.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index b0bd3ea76..7345b0c78 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -2655,7 +2655,7 @@ export class DefaultClient implements Client { }); // TODO: Handle new associations without a reload. - this.associations_for_did_change = new Set(["cu", "cuh", "c", "i", "cpp", "cc", "cxx", "c++", "cp", "hpp", "hh", "hxx", "h++", "hp", "h", "ii", "ino", "inl", "ipp", "tcc", "idl"]); + this.associations_for_did_change = new Set(["cu", "cuh", "c", "i", "cpp", "cc", "cxx", "c++", "cp", "hpp", "hh", "hxx", "h++", "hp", "h", "ii", "ino", "inl", "ipp", "tcc", "txx", "tpp", "idl"]); const assocs: any = new OtherSettings().filesAssociations; for (const assoc in assocs) { const dotIndex: number = assoc.lastIndexOf('.'); diff --git a/Extension/src/common.ts b/Extension/src/common.ts index 4ce922d28..44b492678 100644 --- a/Extension/src/common.ts +++ b/Extension/src/common.ts @@ -165,7 +165,7 @@ export function getVcpkgRoot(): string { export function isHeaderFile(uri: vscode.Uri): boolean { const fileExt: string = path.extname(uri.fsPath); const fileExtLower: string = fileExt.toLowerCase(); - return !fileExt || [".cuh", ".hpp", ".hh", ".hxx", ".h++", ".hp", ".h", ".inl", ".ipp", ".tcc", ".tlh", ".tli", ""].some(ext => fileExtLower === ext); + return !fileExt || [".cuh", ".hpp", ".hh", ".hxx", ".h++", ".hp", ".h", ".inl", ".ipp", ".tcc", ".txx", ".tpp", ".tlh", ".tli", ""].some(ext => fileExtLower === ext); } export function isCppFile(uri: vscode.Uri): boolean { From 43a786ea6c7cec6301370d51040b52f58c156ef5 Mon Sep 17 00:00:00 2001 From: Luca <681992+lukka@users.noreply.github.com> Date: Wed, 6 Aug 2025 10:31:01 -0700 Subject: [PATCH 2/6] fix #13818 (#13824) --- .../Providers/CopilotHoverProvider.ts | 3 ++- Extension/src/LanguageServer/extension.ts | 4 ++-- Extension/src/common.ts | 13 +++++++++++++ 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Extension/src/LanguageServer/Providers/CopilotHoverProvider.ts b/Extension/src/LanguageServer/Providers/CopilotHoverProvider.ts index 2efb36106..b04b8e302 100644 --- a/Extension/src/LanguageServer/Providers/CopilotHoverProvider.ts +++ b/Extension/src/LanguageServer/Providers/CopilotHoverProvider.ts @@ -5,6 +5,7 @@ import * as vscode from 'vscode'; import { Position, ResponseError } from 'vscode-languageclient'; import * as nls from 'vscode-nls'; +import { getVSCodeLanguageModel } from '../../common'; import { modelSelector } from '../../constants'; import * as telemetry from '../../telemetry'; import { DefaultClient, GetCopilotHoverInfoParams, GetCopilotHoverInfoRequest, GetCopilotHoverInfoResult } from '../client'; @@ -42,7 +43,7 @@ export class CopilotHoverProvider implements vscode.HoverProvider { } // Ensure the user has access to Copilot. - const vscodelm = (vscode as any).lm; + const vscodelm = getVSCodeLanguageModel(); if (vscodelm) { const [model] = await vscodelm.selectChatModels(modelSelector); if (!model) { diff --git a/Extension/src/LanguageServer/extension.ts b/Extension/src/LanguageServer/extension.ts index 826c18814..445edc009 100644 --- a/Extension/src/LanguageServer/extension.ts +++ b/Extension/src/LanguageServer/extension.ts @@ -1413,8 +1413,7 @@ export async function preReleaseCheck(): Promise { async function onCopilotHover(): Promise { telemetry.logLanguageServerEvent("CopilotHover"); - // Check if the user has access to vscode language model. - const vscodelm = (vscode as any).lm; + const vscodelm = util.getVSCodeLanguageModel(); if (!vscodelm) { return; } @@ -1477,6 +1476,7 @@ async function onCopilotHover(): Promise { let chatResponse: vscode.LanguageModelChatResponse | undefined; try { + // Select the chat model. const [model] = await vscodelm.selectChatModels(modelSelector); chatResponse = await model.sendRequest( diff --git a/Extension/src/common.ts b/Extension/src/common.ts index 44b492678..c9cf94954 100644 --- a/Extension/src/common.ts +++ b/Extension/src/common.ts @@ -1828,3 +1828,16 @@ export function equals(array1: string[] | undefined, array2: string[] | undefine } return true; } + +export function getVSCodeLanguageModel(): any | undefined { + // Check if the user has access to vscode language model. + const vscodelm = (vscode as any).lm; + if (!vscodelm) { + return undefined; + } + // Check that vscodelm has a method called 'selectChatModels' + if (!vscodelm.selectChatModels || typeof vscodelm.selectChatModels !== 'function') { + return undefined; + } + return vscodelm; +} From a32255425d3e546342c1d65444751d00a7d871dd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 10:38:19 -0700 Subject: [PATCH 3/6] Bump tmp from 0.2.3 to 0.2.4 in /Extension (#13825) Bumps [tmp](https://github.com/raszi/node-tmp) from 0.2.3 to 0.2.4. - [Changelog](https://github.com/raszi/node-tmp/blob/master/CHANGELOG.md) - [Commits](https://github.com/raszi/node-tmp/compare/v0.2.3...v0.2.4) --- updated-dependencies: - dependency-name: tmp dependency-version: 0.2.4 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Sean McManus --- Extension/package.json | 2 +- Extension/yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index 182dffaf1..6b1c0812b 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -6614,7 +6614,7 @@ "posix-getopt": "^1.2.1", "shell-quote": "^1.8.1", "ssh-config": "^4.4.4", - "tmp": "^0.2.3", + "tmp": "^0.2.4", "vscode-cpptools": "^7.1.1", "vscode-languageclient": "^8.1.0", "vscode-nls": "^5.2.0", diff --git a/Extension/yarn.lock b/Extension/yarn.lock index 9885e92db..41a964ea5 100644 --- a/Extension/yarn.lock +++ b/Extension/yarn.lock @@ -4712,10 +4712,10 @@ timers-ext@^0.1.7: es5-ext "^0.10.64" next-tick "^1.1.0" -tmp@^0.2.3: - version "0.2.3" - resolved "https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/npm/registry/tmp/-/tmp-0.2.3.tgz#eb783cc22bc1e8bebd0671476d46ea4eb32a79ae" - integrity sha1-63g8wivB6L69BnFHbUbqTrMqea4= +tmp@^0.2.4: + version "0.2.4" + resolved "https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/npm/registry/tmp/-/tmp-0.2.4.tgz#c6db987a2ccc97f812f17137b36af2b6521b0d13" + integrity sha1-xtuYeizMl/gS8XE3s2rytlIbDRM= to-absolute-glob@^2.0.0, to-absolute-glob@^2.0.2: version "2.0.2" From c4aac33c13f10dfb18191d2c70b687a70f4f6fde Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Wed, 6 Aug 2025 17:11:46 -0700 Subject: [PATCH 4/6] Fix activation failure when c_cpp_properties.json can't be opened. (#13832) * Fix activation failure when c_cpp_properties.json can't be opened. --- Extension/src/main.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Extension/src/main.ts b/Extension/src/main.ts index 2f47e0ef3..be5f02274 100644 --- a/Extension/src/main.ts +++ b/Extension/src/main.ts @@ -125,9 +125,15 @@ export async function activate(context: vscode.ExtensionContext): Promise Date: Wed, 6 Aug 2025 17:12:35 -0700 Subject: [PATCH 5/6] Update changelog again. (#13831) * Update changelog again. --- Extension/CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Extension/CHANGELOG.md b/Extension/CHANGELOG.md index 399904f93..03d6b2783 100644 --- a/Extension/CHANGELOG.md +++ b/Extension/CHANGELOG.md @@ -1,6 +1,6 @@ # C/C++ for Visual Studio Code Changelog -## Version 1.27.0: August 4, 2025 +## Version 1.27.0: August 7, 2025 ### Bug Fixes * Fix an IntelliSense crash in `add_cached_tokens_to_string`. [#11900](https://github.com/microsoft/vscode-cpptools/issues/11900) * Fix an IntelliSense crash in `find_subobject_for_interpreter_address`. [#12464](https://github.com/microsoft/vscode-cpptools/issues/12464) @@ -15,6 +15,9 @@ * Fix `-imacro` not configuring IntelliSense correctly. [#13785](https://github.com/microsoft/vscode-cpptools/issues/13785) * Fix `pipeTransport.quoteArgs` not being handled correctly. [#13791](https://github.com/microsoft/vscode-cpptools/issues/13791) * Thank you for the contribution. [@mrjist (Matt)](https://github.com/mrjist) [PR #13794](https://github.com/microsoft/vscode-cpptools/pull/13794) +* Fix `.txx` and `.tpp` not being handled as C++ header files. [#13808](https://github.com/microsoft/vscode-cpptools/issues/13808) +* Fix an error when using GitHub Copilot with VS Code older than 1.90.0. [#13818](https://github.com/microsoft/vscode-cpptools/issues/13818) +* Fix activation failing if the `c_cpp_properties.json` exists but fails to be opened. [#13829](https://github.com/microsoft/vscode-cpptools/issues/13829) * Fix an IntelliSense bug that could cause incorrect string lengths to be reported for string literals in files that use certain file encodings. ## Version 1.26.3: June 24, 2025 From c6c2208c0e921391593a1d654de96fedf986023a Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Wed, 6 Aug 2025 18:42:41 -0700 Subject: [PATCH 6/6] Minor TPN updates. (#13834) --- Extension/ThirdPartyNotices.txt | 49 ++++++++++++++++----------------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/Extension/ThirdPartyNotices.txt b/Extension/ThirdPartyNotices.txt index ff3ce1c01..a8b0f75bf 100644 --- a/Extension/ThirdPartyNotices.txt +++ b/Extension/ThirdPartyNotices.txt @@ -1063,6 +1063,29 @@ the licensed code: DEALINGS IN THE SOFTWARE. +--------------------------------------------------------- + +--------------------------------------------------------- + +vscode-cpptools 7.1.1 - LicenseRef-scancode-generic-cla AND MIT +https://github.com/Microsoft/vscode-cpptools-api#readme + +Copyright (c) Microsoft Corporation + +vscode-cpptools-api + +Copyright (c) Microsoft Corporation +All rights reserved. + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the Software), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + --------------------------------------------------------- --------------------------------------------------------- @@ -2658,7 +2681,7 @@ SOFTWARE. --------------------------------------------------------- -tmp 0.2.3 - MIT +tmp 0.2.4 - MIT http://github.com/raszi/node-tmp Copyright (c) 2014 KARASZI Istvan @@ -2738,29 +2761,6 @@ The above copyright notice and this permission notice shall be included in all c THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ---------------------------------------------------------- - ---------------------------------------------------------- - -vscode-cpptools 7.1.1 - MIT -https://github.com/Microsoft/vscode-cpptools-api#readme - -Copyright (c) Microsoft Corporation - -vscode-cpptools-api - -Copyright (c) Microsoft Corporation -All rights reserved. - -MIT License - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the Software), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - --------------------------------------------------------- --------------------------------------------------------- @@ -2952,7 +2952,6 @@ OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWA whatwg-url 5.0.0 - MIT https://github.com/jsdom/whatwg-url#readme -(c) extraPathPercentEncodeSet.has Copyright (c) 2015-2016 Sebastian Mayr The MIT License (MIT)