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 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) 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/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/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/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 4ce922d28..c9cf94954 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 { @@ -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; +} 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