Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge for 1.22.5 #12764

Merged
merged 6 commits into from
Sep 24, 2024
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
4 changes: 4 additions & 0 deletions Build/cg/cg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ extends:
filename: mkdir
arguments: $(Build.ArtifactStagingDirectory)\Extension

- script: yarn run vsix-prepublish
displayName: Build files
workingDirectory: $(Build.SourcesDirectory)\Extension

- task: CmdLine@1
name: ProcessRunner_12
displayName: Run VSCE to package vsix
Expand Down
21 changes: 21 additions & 0 deletions Build/signing/SignFiles.proj
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?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)/Extension</BaseOutputDirectory>
<!-- These properties are required by MicroBuild, which only signs files that are under these paths -->
<IntermediateOutputPath>$(BaseOutputDirectory)</IntermediateOutputPath>
<OutDir>$(BaseOutputDirectory)</OutDir>
</PropertyGroup>

<ItemGroup>
<!-- Because of Webpack bundling, these are the only shipping Javascript files.
There are no third-party files to sign because they've all been bundled. -->
<FilesToSign Include="$(OutDir)\dist\src\main.js;$(OutDir)\dist\ui\settings.js">
<Authenticode>Microsoft400</Authenticode>
</FilesToSign>
</ItemGroup>

<Import Project="packages\Microsoft.VisualStudioEng.MicroBuild.Core.0.4.1\build\Microsoft.VisualStudioEng.MicroBuild.Core.targets" />
</Project>
4 changes: 4 additions & 0 deletions Build/signing/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.VisualStudioEng.MicroBuild.Core" version="0.4.1" developmentDependency="true" />
</packages>
9 changes: 9 additions & 0 deletions Extension/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# C/C++ for Visual Studio Code Changelog

## Version 1.22.5: September 24, 2024
### Enhancement
* Add the database path to the `C/C++: Log Diagnostics` output.

### Bug Fixes
* Fix some synchronization and crash issues with `handle_edits`. [#12747](https://github.com/microsoft/vscode-cpptools/issues/12747)
* Fix usage of `#cpp` with Copilot chat. [PR #12755](https://github.com/microsoft/vscode-cpptools/pull/12755)
* Fix some document buffer issues.

## Version 1.22.4: September 19, 2024
### Enhancements
* Performance improvements related to how custom configurations are processed. [#12632](https://github.com/microsoft/vscode-cpptools/issues/12632)
Expand Down
9 changes: 6 additions & 3 deletions 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.4-main",
"version": "1.22.5-main",
"publisher": "ms-vscode",
"icon": "LanguageCCPP_color_128x.png",
"readme": "README.md",
Expand Down Expand Up @@ -6452,7 +6452,10 @@
"modelDescription": "For the active C or C++ file, this tool provides: the language (C, C++, or CUDA), the language standard version (such as C++11, C++14, C++17, or C++20), the compiler (such as GCC, Clang, or MSVC), the target platform (such as x86, x64, or ARM), and the target architecture (such as 32-bit or 64-bit).",
"icon": "$(file-code)",
"parametersSchema": {},
"when": "(config.C_Cpp.experimentalFeatures =~ /^[eE]nabled$/)"
"when": "(config.C_Cpp.experimentalFeatures =~ /^[eE]nabled$/)",
"supportedContentTypes": [
"text/plain"
]
}
]
},
Expand All @@ -6468,7 +6471,7 @@
"compile": "yarn install && (yarn verify prep --quiet || yarn prep) && yarn build",
"watch": "yarn install && (yarn verify prep --quiet || yarn prep) && tsc --build tsconfig.json --watch",
"rebuild": "yarn install && yarn clean && yarn prep && yarn build",
"vscode:prepublish": "yarn install && yarn clean && yarn webpack",
"vsix-prepublish": "yarn install && yarn clean && yarn webpack",
"webpack": "yarn install && (yarn verify prep --quiet || yarn prep) && tsc --build ui.tsconfig.json && webpack --mode production --env vscode_nls",
"generate-native-strings": "ts-node -T ./.scripts/generateNativeStrings.ts",
"generate-options-schema": "ts-node -T ./.scripts/generateOptionsSchema.ts",
Expand Down
2 changes: 1 addition & 1 deletion Extension/src/LanguageServer/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ function onInterval(): void {
/**
* registered commands
*/
export function registerCommands(enabled: boolean, isRelatedFilesApiEnabled: boolean = false): void {
export function registerCommands(enabled: boolean, isRelatedFilesApiEnabled: boolean): void {
commandDisposables.forEach(d => d.dispose());
commandDisposables.length = 0;
commandDisposables.push(vscode.commands.registerCommand('C_Cpp.SwitchHeaderSource', enabled ? onSwitchHeaderSource : onDisabledCommand));
Expand Down
13 changes: 7 additions & 6 deletions Extension/src/LanguageServer/lmTool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,15 @@ const knownValues: { [Property in keyof ChatContextResult]?: { [id: string]: str
}
};

class StringLanguageModelToolResult implements vscode.LanguageModelToolResult {
public constructor(public readonly value: string) { }
public toString(): string { return this.value; }
}
const plainTextContentType = 'text/plain';

export class CppConfigurationLanguageModelTool implements vscode.LanguageModelTool {
public async invoke(_parameters: any, token: vscode.CancellationToken): Promise<vscode.LanguageModelToolResult> {
return new StringLanguageModelToolResult(await this.getContext(token));
public async invoke(options: vscode.LanguageModelToolInvocationOptions, token: vscode.CancellationToken): Promise<vscode.LanguageModelToolResult> {
const result: vscode.LanguageModelToolResult = {};
if (options.requestedContentTypes.includes(plainTextContentType)) {
result[plainTextContentType] = await this.getContext(token);
}
return result;
}

private async getContext(token: vscode.CancellationToken): Promise<string> {
Expand Down
3 changes: 2 additions & 1 deletion Extension/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ export async function activate(context: vscode.ExtensionContext): Promise<CppToo
if (shouldActivateLanguageServer) {
await LanguageServer.activate();
} else if (isIntelliSenseEngineDisabled) {
LanguageServer.registerCommands(false);
const isRelatedFilesApiEnabled = await Telemetry.isExperimentEnabled("CppToolsRelatedFilesApi");
LanguageServer.registerCommands(false, isRelatedFilesApiEnabled);
// The check here for isIntelliSenseEngineDisabled avoids logging
// the message on old Macs that we've already displayed a warning for.
log(localize("intellisense.disabled", "intelliSenseEngine is disabled"));
Expand Down
Loading