Skip to content

Commit

Permalink
Merge pull request #12791 from microsoft/main
Browse files Browse the repository at this point in the history
Merge for 1.22.7
  • Loading branch information
sean-mcmanus authored Sep 30, 2024
2 parents 8d0d360 + 911c04b commit c8b7f13
Show file tree
Hide file tree
Showing 13 changed files with 4,112 additions and 4,282 deletions.
2 changes: 2 additions & 0 deletions .github/actions/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
registry=https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/npm/registry/
always-auth=true
5,168 changes: 2,547 additions & 2,621 deletions .github/actions/package-lock.json

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions Build/signing/SignVsix.proj
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="SignFiles" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="packages\Microsoft.VisualStudioEng.MicroBuild.Core.0.4.1\build\Microsoft.VisualStudioEng.MicroBuild.Core.props" />

<PropertyGroup>
<BaseOutputDirectory>$(BUILD_STAGINGDIRECTORY)</BaseOutputDirectory>
<!-- These properties are required by MicroBuild, which only signs files that are under these paths -->
<IntermediateOutputPath>$(BaseOutputDirectory)</IntermediateOutputPath>
<OutDir>$(BaseOutputDirectory)</OutDir>
</PropertyGroup>

<ItemGroup>
<FilesToSign Include="$(OutDir)\vsix\cpptools-*.signature.p7s">
<Authenticode>VSCodePublisher</Authenticode>
</FilesToSign>
</ItemGroup>

<Import Project="packages\Microsoft.VisualStudioEng.MicroBuild.Core.0.4.1\build\Microsoft.VisualStudioEng.MicroBuild.Core.targets" />
</Project>
8 changes: 7 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,10 @@ instructions provided by the bot. You will only need to do this once across all

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
or contact [[email protected]](mailto:[email protected]) with any additional questions or comments.
or contact [[email protected]](mailto:[email protected]) with any additional questions or comments.

### Adding/Updating package.json dependencies

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.

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.
2 changes: 2 additions & 0 deletions Extension/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
registry=https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/npm/registry/
always-auth=true
10 changes: 10 additions & 0 deletions Extension/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# C/C++ for Visual Studio Code Changelog

## Version 1.22.7: September 30, 2024
### Enhancement
* 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)

### Bug Fixes
* Fix some Copilot-related issues. [PR #12773](https://github.com/microsoft/vscode-cpptools/pull/12773)
* Fix an issue preventing use of a full command line in `compilerPath`. [PR #12774](https://github.com/microsoft/vscode-cpptools/pull/12774)
* Fix an infinite loop on shutdown after changing the selected settings.
* Fix a crash (from `insert_lines`).

## Version 1.22.6: September 25, 2024
### Bug Fixes
* Fix an issue with usage of `#cpp` with Copilot chat. [vscode-copilot-release#1634](https://github.com/microsoft/vscode-copilot-release/issues/1634)
Expand Down
146 changes: 3 additions & 143 deletions Extension/ThirdPartyNotices.txt
Original file line number Diff line number Diff line change
Expand Up @@ -736,10 +736,9 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

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

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

copyright Microsoft 2018
Copyright (c) Microsoft Corporation
Copyright (c) Microsoft and contributors
Copyright (c) NevWare21 Solutions LLC and contributors
Expand All @@ -766,48 +765,12 @@ 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.

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

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

@microsoft/1ds-post-js 4.3.1 - MIT
https://github.com/microsoft/ApplicationInsights-JS#readme

copyright Microsoft 2018
copyright Microsoft 2020
copyright Microsoft 2018-2020
copyright Microsoft 2022 Simple
Copyright (c) Microsoft Corporation
Copyright (c) Microsoft and contributors
Copyright (c) NevWare21 Solutions LLC and contributors

The MIT License (MIT)

Copyright (c) Microsoft Corporation

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.

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

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

@microsoft/applicationinsights-channel-js 3.3.1 - MIT
@microsoft/applicationinsights-common 3.3.3 - MIT
https://github.com/microsoft/ApplicationInsights-JS#readme

Copyright (c) Microsoft Corporation
Expand Down Expand Up @@ -841,41 +804,7 @@ SOFTWARE.

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

@microsoft/applicationinsights-common 3.3.1 - MIT
https://github.com/microsoft/ApplicationInsights-JS#readme

Copyright (c) Microsoft Corporation
Copyright (c) Microsoft and contributors
Copyright (c) NevWare21 Solutions LLC and contributors

The MIT License (MIT)

Copyright (c) Microsoft Corporation

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.


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

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

@microsoft/applicationinsights-core-js 3.3.1 - MIT
@microsoft/applicationinsights-core-js 3.3.3 - MIT
https://github.com/microsoft/ApplicationInsights-JS#readme

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


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

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

@microsoft/applicationinsights-web-basic 3.3.1 - MIT
https://github.com/microsoft/ApplicationInsights-JS#readme

Copyright (c) Microsoft Corporation
Copyright (c) Microsoft and contributors
Copyright (c) NevWare21 Solutions LLC and contributors

The MIT License (MIT)

Copyright (c) Microsoft Corporation

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 @@ -1041,41 +936,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


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

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

@nevware21/ts-utils 0.11.3 - MIT
https://github.com/nevware21/ts-utils

Copyright (c) 2022 NevWare21 Solutions LLC
Copyright (c) 2023 NevWare21 Solutions LLC
Copyright (c) 2024 NevWare21 Solutions LLC
Copyright (c) NevWare21 Solutions LLC and contributors

MIT License

Copyright (c) 2022 NevWare21 Solutions LLC

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
2 changes: 1 addition & 1 deletion Extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "cpptools",
"displayName": "C/C++",
"description": "C/C++ IntelliSense, debugging, and code browsing.",
"version": "1.22.6-main",
"version": "1.22.7-main",
"publisher": "ms-vscode",
"icon": "LanguageCCPP_color_128x.png",
"readme": "README.md",
Expand Down
4 changes: 2 additions & 2 deletions Extension/src/LanguageServer/Providers/codeActionProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export class CodeActionProvider implements vscode.CodeActionProvider {
if (codeActionCodeInfo !== undefined) {
if (codeActionCodeInfo.fixAllTypeCodeAction !== undefined &&
(codeActionCodeInfo.uriToInfo.size > 1 ||
codeActionCodeInfo.uriToInfo.values().next().value.numValidWorkspaceEdits > 1)) {
(codeActionCodeInfo.uriToInfo.values().next().value?.numValidWorkspaceEdits ?? 0) > 1)) {
// Only show the "fix all type" if there is more than one fix for the type.
fixCodeActions.push(codeActionCodeInfo.fixAllTypeCodeAction);
}
Expand All @@ -161,7 +161,7 @@ export class CodeActionProvider implements vscode.CodeActionProvider {
if (codeActionCodeInfo.removeAllTypeCodeAction !== undefined &&
codeActionCodeInfo.uriToInfo.size > 0 &&
(codeActionCodeInfo.uriToInfo.size > 1 ||
codeActionCodeInfo.uriToInfo.values().next().value.identifiers.length > 1)) {
(codeActionCodeInfo.uriToInfo.values().next().value?.identifiers?.length ?? 0) > 1)) {
// Only show the "clear all type" if there is more than one fix for the type.
removeAllTypeAvailable = true;
}
Expand Down
46 changes: 27 additions & 19 deletions Extension/src/LanguageServer/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ export interface Client {
getShowConfigureIntelliSenseButton(): boolean;
setShowConfigureIntelliSenseButton(show: boolean): void;
addTrustedCompiler(path: string): Promise<void>;
getIncludes(maxDepth: number): Promise<GetIncludesResult>;
getIncludes(maxDepth: number, token: vscode.CancellationToken): Promise<GetIncludesResult>;
getChatContext(token: vscode.CancellationToken): Promise<ChatContextResult>;
}

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

public async getIncludes(maxDepth: number): Promise<GetIncludesResult> {
public async getIncludes(maxDepth: number, token: vscode.CancellationToken): Promise<GetIncludesResult> {
const params: GetIncludesParams = { maxDepth: maxDepth };
await this.ready;
return this.languageClient.sendRequest(IncludesRequest, params);
return DefaultClient.withLspCancellationHandling(
() => this.languageClient.sendRequest(IncludesRequest, params, token), token);
}

public async getChatContext(token: vscode.CancellationToken): Promise<ChatContextResult> {
await withCancellation(this.ready, token);
let result: ChatContextResult;
try {
result = await this.languageClient.sendRequest(CppContextRequest, null, token);
} catch (e: any) {
if (e instanceof ResponseError && (e.code === RequestCancelled || e.code === ServerCancelled)) {
throw new vscode.CancellationError();
}

throw e;
}
if (token.isCancellationRequested) {
throw new vscode.CancellationError();
}

return result;
return DefaultClient.withLspCancellationHandling(
() => this.languageClient.sendRequest(CppContextRequest, null, token), token);
}

/**
Expand Down Expand Up @@ -2310,6 +2298,26 @@ export class DefaultClient implements Client {
this.dispatching.resolve();
}

private static async withLspCancellationHandling<T>(task: () => Promise<T>, token: vscode.CancellationToken): Promise<T> {
let result: T;

try {
result = await task();
} catch (e: any) {
if (e instanceof ResponseError && (e.code === RequestCancelled || e.code === ServerCancelled)) {
throw new vscode.CancellationError();
} else {
throw e;
}
}

if (token.isCancellationRequested) {
throw new vscode.CancellationError();
}

return result;
}

private callTaskWithTimeout<T>(task: () => Thenable<T>, ms: number, cancelToken?: vscode.CancellationTokenSource): Promise<T> {
let timer: NodeJS.Timeout;

Expand Down Expand Up @@ -4110,6 +4118,6 @@ class NullClient implements Client {
getShowConfigureIntelliSenseButton(): boolean { return false; }
setShowConfigureIntelliSenseButton(show: boolean): void { }
addTrustedCompiler(path: string): Promise<void> { return Promise.resolve(); }
getIncludes(): Promise<GetIncludesResult> { return Promise.resolve({} as GetIncludesResult); }
getIncludes(maxDepth: number, token: vscode.CancellationToken): Promise<GetIncludesResult> { return Promise.resolve({} as GetIncludesResult); }
getChatContext(token: vscode.CancellationToken): Promise<ChatContextResult> { return Promise.resolve({} as ChatContextResult); }
}
5 changes: 2 additions & 3 deletions Extension/src/LanguageServer/configurations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ export class CppProperties {
configuration.intelliSenseMode === "${default}") {
return "";
}
const resolvedCompilerPath: string = this.resolvePath(configuration.compilerPath);
const resolvedCompilerPath: string = this.resolvePath(configuration.compilerPath, false, false);
const settings: CppSettings = new CppSettings(this.rootUri);
const compilerPathAndArgs: util.CompilerPathAndArgs = util.extractCompilerPathAndArgs(!!settings.legacyCompilerArgsBehavior, resolvedCompilerPath);

Expand Down Expand Up @@ -1877,8 +1877,7 @@ export class CppProperties {
// Check for path-related squiggles.
const paths: string[] = [];
let compilerPath: string | undefined;
for (const pathArray of [currentConfiguration.browse ? currentConfiguration.browse.path : undefined,
currentConfiguration.includePath, currentConfiguration.macFrameworkPath]) {
for (const pathArray of [currentConfiguration.browse ? currentConfiguration.browse.path : undefined, currentConfiguration.includePath, currentConfiguration.macFrameworkPath]) {
if (pathArray) {
for (const curPath of pathArray) {
paths.push(`${curPath}`);
Expand Down
Loading

0 comments on commit c8b7f13

Please sign in to comment.