Skip to content

Commit c8b7f13

Browse files
authored
Merge pull request #12791 from microsoft/main
Merge for 1.22.7
2 parents 8d0d360 + 911c04b commit c8b7f13

13 files changed

+4112
-4282
lines changed

.github/actions/.npmrc

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
registry=https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/npm/registry/
2+
always-auth=true

.github/actions/package-lock.json

+2,547-2,621
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Build/signing/SignVsix.proj

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="SignFiles" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="packages\Microsoft.VisualStudioEng.MicroBuild.Core.0.4.1\build\Microsoft.VisualStudioEng.MicroBuild.Core.props" />
4+
5+
<PropertyGroup>
6+
<BaseOutputDirectory>$(BUILD_STAGINGDIRECTORY)</BaseOutputDirectory>
7+
<!-- These properties are required by MicroBuild, which only signs files that are under these paths -->
8+
<IntermediateOutputPath>$(BaseOutputDirectory)</IntermediateOutputPath>
9+
<OutDir>$(BaseOutputDirectory)</OutDir>
10+
</PropertyGroup>
11+
12+
<ItemGroup>
13+
<FilesToSign Include="$(OutDir)\vsix\cpptools-*.signature.p7s">
14+
<Authenticode>VSCodePublisher</Authenticode>
15+
</FilesToSign>
16+
</ItemGroup>
17+
18+
<Import Project="packages\Microsoft.VisualStudioEng.MicroBuild.Core.0.4.1\build\Microsoft.VisualStudioEng.MicroBuild.Core.targets" />
19+
</Project>

CONTRIBUTING.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,10 @@ instructions provided by the bot. You will only need to do this once across all
4747

4848
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
4949
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
50-
or contact [[email protected]](mailto:[email protected]) with any additional questions or comments.
50+
or contact [[email protected]](mailto:[email protected]) with any additional questions or comments.
51+
52+
### Adding/Updating package.json dependencies
53+
54+
We maintain a public Azure Artifacts feed that we point the package manager to in .npmrc files. If you want to add a dependency or update a version in package.json, you may need to contact us so we can add it to our feed. Please ping our team in a PR or new issue if you experience this issue.
55+
56+
For local development, you can delete the .npmrc file and the matching `yarn.lock` file while you wait for us to update the feed. However, these changes will need to be reverted in your branch before we will accept a PR.

Extension/.npmrc

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
registry=https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/npm/registry/
2+
always-auth=true

Extension/CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# C/C++ for Visual Studio Code Changelog
22

3+
## Version 1.22.7: September 30, 2024
4+
### Enhancement
5+
* The .vsix and .js files are now signed. [#12725](https://github.com/microsoft/vscode-cpptools/issues/12725), [#12744](https://github.com/microsoft/vscode-cpptools/issues/12744)
6+
7+
### Bug Fixes
8+
* Fix some Copilot-related issues. [PR #12773](https://github.com/microsoft/vscode-cpptools/pull/12773)
9+
* Fix an issue preventing use of a full command line in `compilerPath`. [PR #12774](https://github.com/microsoft/vscode-cpptools/pull/12774)
10+
* Fix an infinite loop on shutdown after changing the selected settings.
11+
* Fix a crash (from `insert_lines`).
12+
313
## Version 1.22.6: September 25, 2024
414
### Bug Fixes
515
* Fix an issue with usage of `#cpp` with Copilot chat. [vscode-copilot-release#1634](https://github.com/microsoft/vscode-copilot-release/issues/1634)

Extension/ThirdPartyNotices.txt

+3-143
Original file line numberDiff line numberDiff line change
@@ -736,10 +736,9 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
736736

737737
---------------------------------------------------------
738738

739-
@microsoft/1ds-core-js 4.3.1 - MIT
739+
@microsoft/applicationinsights-channel-js 3.3.3 - MIT
740740
https://github.com/microsoft/ApplicationInsights-JS#readme
741741

742-
copyright Microsoft 2018
743742
Copyright (c) Microsoft Corporation
744743
Copyright (c) Microsoft and contributors
745744
Copyright (c) NevWare21 Solutions LLC and contributors
@@ -766,48 +765,12 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
766765
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
767766
SOFTWARE.
768767

769-
---------------------------------------------------------
770768

771769
---------------------------------------------------------
772770

773-
@microsoft/1ds-post-js 4.3.1 - MIT
774-
https://github.com/microsoft/ApplicationInsights-JS#readme
775-
776-
copyright Microsoft 2018
777-
copyright Microsoft 2020
778-
copyright Microsoft 2018-2020
779-
copyright Microsoft 2022 Simple
780-
Copyright (c) Microsoft Corporation
781-
Copyright (c) Microsoft and contributors
782-
Copyright (c) NevWare21 Solutions LLC and contributors
783-
784-
The MIT License (MIT)
785-
786-
Copyright (c) Microsoft Corporation
787-
788-
Permission is hereby granted, free of charge, to any person obtaining a copy
789-
of this software and associated documentation files (the "Software"), to deal
790-
in the Software without restriction, including without limitation the rights
791-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
792-
copies of the Software, and to permit persons to whom the Software is
793-
furnished to do so, subject to the following conditions:
794-
795-
The above copyright notice and this permission notice shall be included in all
796-
copies or substantial portions of the Software.
797-
798-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
799-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
800-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
801-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
802-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
803-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
804-
SOFTWARE.
805-
806771
---------------------------------------------------------
807772

808-
---------------------------------------------------------
809-
810-
@microsoft/applicationinsights-channel-js 3.3.1 - MIT
773+
@microsoft/applicationinsights-common 3.3.3 - MIT
811774
https://github.com/microsoft/ApplicationInsights-JS#readme
812775

813776
Copyright (c) Microsoft Corporation
@@ -841,41 +804,7 @@ SOFTWARE.
841804

842805
---------------------------------------------------------
843806

844-
@microsoft/applicationinsights-common 3.3.1 - MIT
845-
https://github.com/microsoft/ApplicationInsights-JS#readme
846-
847-
Copyright (c) Microsoft Corporation
848-
Copyright (c) Microsoft and contributors
849-
Copyright (c) NevWare21 Solutions LLC and contributors
850-
851-
The MIT License (MIT)
852-
853-
Copyright (c) Microsoft Corporation
854-
855-
Permission is hereby granted, free of charge, to any person obtaining a copy
856-
of this software and associated documentation files (the "Software"), to deal
857-
in the Software without restriction, including without limitation the rights
858-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
859-
copies of the Software, and to permit persons to whom the Software is
860-
furnished to do so, subject to the following conditions:
861-
862-
The above copyright notice and this permission notice shall be included in all
863-
copies or substantial portions of the Software.
864-
865-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
866-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
867-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
868-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
869-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
870-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
871-
SOFTWARE.
872-
873-
874-
---------------------------------------------------------
875-
876-
---------------------------------------------------------
877-
878-
@microsoft/applicationinsights-core-js 3.3.1 - MIT
807+
@microsoft/applicationinsights-core-js 3.3.3 - MIT
879808
https://github.com/microsoft/ApplicationInsights-JS#readme
880809

881810
Copyright (c) Microsoft Corporation
@@ -938,40 +867,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
938867
SOFTWARE.
939868

940869

941-
---------------------------------------------------------
942-
943-
---------------------------------------------------------
944-
945-
@microsoft/applicationinsights-web-basic 3.3.1 - MIT
946-
https://github.com/microsoft/ApplicationInsights-JS#readme
947-
948-
Copyright (c) Microsoft Corporation
949-
Copyright (c) Microsoft and contributors
950-
Copyright (c) NevWare21 Solutions LLC and contributors
951-
952-
The MIT License (MIT)
953-
954-
Copyright (c) Microsoft Corporation
955-
956-
Permission is hereby granted, free of charge, to any person obtaining a copy
957-
of this software and associated documentation files (the "Software"), to deal
958-
in the Software without restriction, including without limitation the rights
959-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
960-
copies of the Software, and to permit persons to whom the Software is
961-
furnished to do so, subject to the following conditions:
962-
963-
The above copyright notice and this permission notice shall be included in all
964-
copies or substantial portions of the Software.
965-
966-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
967-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
968-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
969-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
970-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
971-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
972-
SOFTWARE.
973-
974-
975870
---------------------------------------------------------
976871

977872
---------------------------------------------------------
@@ -1041,41 +936,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1041936
SOFTWARE.
1042937

1043938

1044-
---------------------------------------------------------
1045-
1046-
---------------------------------------------------------
1047-
1048-
@nevware21/ts-utils 0.11.3 - MIT
1049-
https://github.com/nevware21/ts-utils
1050-
1051-
Copyright (c) 2022 NevWare21 Solutions LLC
1052-
Copyright (c) 2023 NevWare21 Solutions LLC
1053-
Copyright (c) 2024 NevWare21 Solutions LLC
1054-
Copyright (c) NevWare21 Solutions LLC and contributors
1055-
1056-
MIT License
1057-
1058-
Copyright (c) 2022 NevWare21 Solutions LLC
1059-
1060-
Permission is hereby granted, free of charge, to any person obtaining a copy
1061-
of this software and associated documentation files (the "Software"), to deal
1062-
in the Software without restriction, including without limitation the rights
1063-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1064-
copies of the Software, and to permit persons to whom the Software is
1065-
furnished to do so, subject to the following conditions:
1066-
1067-
The above copyright notice and this permission notice shall be included in all
1068-
copies or substantial portions of the Software.
1069-
1070-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1071-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1072-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1073-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1074-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1075-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1076-
SOFTWARE.
1077-
1078-
1079939
---------------------------------------------------------
1080940

1081941
---------------------------------------------------------

Extension/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "cpptools",
33
"displayName": "C/C++",
44
"description": "C/C++ IntelliSense, debugging, and code browsing.",
5-
"version": "1.22.6-main",
5+
"version": "1.22.7-main",
66
"publisher": "ms-vscode",
77
"icon": "LanguageCCPP_color_128x.png",
88
"readme": "README.md",

Extension/src/LanguageServer/Providers/codeActionProvider.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ export class CodeActionProvider implements vscode.CodeActionProvider {
144144
if (codeActionCodeInfo !== undefined) {
145145
if (codeActionCodeInfo.fixAllTypeCodeAction !== undefined &&
146146
(codeActionCodeInfo.uriToInfo.size > 1 ||
147-
codeActionCodeInfo.uriToInfo.values().next().value.numValidWorkspaceEdits > 1)) {
147+
(codeActionCodeInfo.uriToInfo.values().next().value?.numValidWorkspaceEdits ?? 0) > 1)) {
148148
// Only show the "fix all type" if there is more than one fix for the type.
149149
fixCodeActions.push(codeActionCodeInfo.fixAllTypeCodeAction);
150150
}
@@ -161,7 +161,7 @@ export class CodeActionProvider implements vscode.CodeActionProvider {
161161
if (codeActionCodeInfo.removeAllTypeCodeAction !== undefined &&
162162
codeActionCodeInfo.uriToInfo.size > 0 &&
163163
(codeActionCodeInfo.uriToInfo.size > 1 ||
164-
codeActionCodeInfo.uriToInfo.values().next().value.identifiers.length > 1)) {
164+
(codeActionCodeInfo.uriToInfo.values().next().value?.identifiers?.length ?? 0) > 1)) {
165165
// Only show the "clear all type" if there is more than one fix for the type.
166166
removeAllTypeAvailable = true;
167167
}

Extension/src/LanguageServer/client.ts

+27-19
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ export interface Client {
790790
getShowConfigureIntelliSenseButton(): boolean;
791791
setShowConfigureIntelliSenseButton(show: boolean): void;
792792
addTrustedCompiler(path: string): Promise<void>;
793-
getIncludes(maxDepth: number): Promise<GetIncludesResult>;
793+
getIncludes(maxDepth: number, token: vscode.CancellationToken): Promise<GetIncludesResult>;
794794
getChatContext(token: vscode.CancellationToken): Promise<ChatContextResult>;
795795
}
796796

@@ -2206,29 +2206,17 @@ export class DefaultClient implements Client {
22062206
await this.languageClient.sendNotification(DidOpenNotification, params);
22072207
}
22082208

2209-
public async getIncludes(maxDepth: number): Promise<GetIncludesResult> {
2209+
public async getIncludes(maxDepth: number, token: vscode.CancellationToken): Promise<GetIncludesResult> {
22102210
const params: GetIncludesParams = { maxDepth: maxDepth };
22112211
await this.ready;
2212-
return this.languageClient.sendRequest(IncludesRequest, params);
2212+
return DefaultClient.withLspCancellationHandling(
2213+
() => this.languageClient.sendRequest(IncludesRequest, params, token), token);
22132214
}
22142215

22152216
public async getChatContext(token: vscode.CancellationToken): Promise<ChatContextResult> {
22162217
await withCancellation(this.ready, token);
2217-
let result: ChatContextResult;
2218-
try {
2219-
result = await this.languageClient.sendRequest(CppContextRequest, null, token);
2220-
} catch (e: any) {
2221-
if (e instanceof ResponseError && (e.code === RequestCancelled || e.code === ServerCancelled)) {
2222-
throw new vscode.CancellationError();
2223-
}
2224-
2225-
throw e;
2226-
}
2227-
if (token.isCancellationRequested) {
2228-
throw new vscode.CancellationError();
2229-
}
2230-
2231-
return result;
2218+
return DefaultClient.withLspCancellationHandling(
2219+
() => this.languageClient.sendRequest(CppContextRequest, null, token), token);
22322220
}
22332221

22342222
/**
@@ -2310,6 +2298,26 @@ export class DefaultClient implements Client {
23102298
this.dispatching.resolve();
23112299
}
23122300

2301+
private static async withLspCancellationHandling<T>(task: () => Promise<T>, token: vscode.CancellationToken): Promise<T> {
2302+
let result: T;
2303+
2304+
try {
2305+
result = await task();
2306+
} catch (e: any) {
2307+
if (e instanceof ResponseError && (e.code === RequestCancelled || e.code === ServerCancelled)) {
2308+
throw new vscode.CancellationError();
2309+
} else {
2310+
throw e;
2311+
}
2312+
}
2313+
2314+
if (token.isCancellationRequested) {
2315+
throw new vscode.CancellationError();
2316+
}
2317+
2318+
return result;
2319+
}
2320+
23132321
private callTaskWithTimeout<T>(task: () => Thenable<T>, ms: number, cancelToken?: vscode.CancellationTokenSource): Promise<T> {
23142322
let timer: NodeJS.Timeout;
23152323

@@ -4110,6 +4118,6 @@ class NullClient implements Client {
41104118
getShowConfigureIntelliSenseButton(): boolean { return false; }
41114119
setShowConfigureIntelliSenseButton(show: boolean): void { }
41124120
addTrustedCompiler(path: string): Promise<void> { return Promise.resolve(); }
4113-
getIncludes(): Promise<GetIncludesResult> { return Promise.resolve({} as GetIncludesResult); }
4121+
getIncludes(maxDepth: number, token: vscode.CancellationToken): Promise<GetIncludesResult> { return Promise.resolve({} as GetIncludesResult); }
41144122
getChatContext(token: vscode.CancellationToken): Promise<ChatContextResult> { return Promise.resolve({} as ChatContextResult); }
41154123
}

Extension/src/LanguageServer/configurations.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ export class CppProperties {
594594
configuration.intelliSenseMode === "${default}") {
595595
return "";
596596
}
597-
const resolvedCompilerPath: string = this.resolvePath(configuration.compilerPath);
597+
const resolvedCompilerPath: string = this.resolvePath(configuration.compilerPath, false, false);
598598
const settings: CppSettings = new CppSettings(this.rootUri);
599599
const compilerPathAndArgs: util.CompilerPathAndArgs = util.extractCompilerPathAndArgs(!!settings.legacyCompilerArgsBehavior, resolvedCompilerPath);
600600

@@ -1877,8 +1877,7 @@ export class CppProperties {
18771877
// Check for path-related squiggles.
18781878
const paths: string[] = [];
18791879
let compilerPath: string | undefined;
1880-
for (const pathArray of [currentConfiguration.browse ? currentConfiguration.browse.path : undefined,
1881-
currentConfiguration.includePath, currentConfiguration.macFrameworkPath]) {
1880+
for (const pathArray of [currentConfiguration.browse ? currentConfiguration.browse.path : undefined, currentConfiguration.includePath, currentConfiguration.macFrameworkPath]) {
18821881
if (pathArray) {
18831882
for (const curPath of pathArray) {
18841883
paths.push(`${curPath}`);

0 commit comments

Comments
 (0)