Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Extension/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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
Expand Down
49 changes: 24 additions & 25 deletions Extension/ThirdPartyNotices.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.


---------------------------------------------------------

---------------------------------------------------------
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.


---------------------------------------------------------

---------------------------------------------------------
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion Extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion Extension/src/LanguageServer/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2655,7 +2655,7 @@ export class DefaultClient implements Client {
});

// TODO: Handle new associations without a reload.
this.associations_for_did_change = new Set<string>(["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<string>(["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('.');
Expand Down
4 changes: 2 additions & 2 deletions Extension/src/LanguageServer/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1413,8 +1413,7 @@ export async function preReleaseCheck(): Promise<void> {
async function onCopilotHover(): Promise<void> {
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;
}
Expand Down Expand Up @@ -1477,6 +1476,7 @@ async function onCopilotHover(): Promise<void> {

let chatResponse: vscode.LanguageModelChatResponse | undefined;
try {
// Select the chat model.
const [model] = await vscodelm.selectChatModels(modelSelector);

chatResponse = await model.sendRequest(
Expand Down
15 changes: 14 additions & 1 deletion Extension/src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
}
12 changes: 9 additions & 3 deletions Extension/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,15 @@ export async function activate(context: vscode.ExtensionContext): Promise<CppToo
for (let i: number = 0; i < vscode.workspace.workspaceFolders.length; ++i) {
const config: string = path.join(vscode.workspace.workspaceFolders[i].uri.fsPath, ".vscode/c_cpp_properties.json");
if (await util.checkFileExists(config)) {
const doc: vscode.TextDocument = await vscode.workspace.openTextDocument(config);
void vscode.languages.setTextDocumentLanguage(doc, "jsonc");
util.setWorkspaceIsCpp();
try {
const doc: vscode.TextDocument = await vscode.workspace.openTextDocument(config);
void vscode.languages.setTextDocumentLanguage(doc, "jsonc");
util.setWorkspaceIsCpp();
} catch (err) {
// The c_cpp_properties.json might not be openable (e.g. an executable).
// Catching the exception prevents our extension activation from failing.
// VS Code itself will report an error message.
}
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions Extension/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down