Skip to content

Commit e9613ae

Browse files
authored
Merge pull request #12764 from microsoft/main
Merge for 1.22.5
2 parents 3570705 + 1e89750 commit e9613ae

File tree

8 files changed

+54
-11
lines changed

8 files changed

+54
-11
lines changed

Build/cg/cg.yml

+4
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ extends:
102102
filename: mkdir
103103
arguments: $(Build.ArtifactStagingDirectory)\Extension
104104

105+
- script: yarn run vsix-prepublish
106+
displayName: Build files
107+
workingDirectory: $(Build.SourcesDirectory)\Extension
108+
105109
- task: CmdLine@1
106110
name: ProcessRunner_12
107111
displayName: Run VSCE to package vsix

Build/signing/SignFiles.proj

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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)/Extension</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+
<!-- Because of Webpack bundling, these are the only shipping Javascript files.
14+
There are no third-party files to sign because they've all been bundled. -->
15+
<FilesToSign Include="$(OutDir)\dist\src\main.js;$(OutDir)\dist\ui\settings.js">
16+
<Authenticode>Microsoft400</Authenticode>
17+
</FilesToSign>
18+
</ItemGroup>
19+
20+
<Import Project="packages\Microsoft.VisualStudioEng.MicroBuild.Core.0.4.1\build\Microsoft.VisualStudioEng.MicroBuild.Core.targets" />
21+
</Project>

Build/signing/packages.config

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="Microsoft.VisualStudioEng.MicroBuild.Core" version="0.4.1" developmentDependency="true" />
4+
</packages>

Extension/CHANGELOG.md

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

3+
## Version 1.22.5: September 24, 2024
4+
### Enhancement
5+
* Add the database path to the `C/C++: Log Diagnostics` output.
6+
7+
### Bug Fixes
8+
* Fix some synchronization and crash issues with `handle_edits`. [#12747](https://github.com/microsoft/vscode-cpptools/issues/12747)
9+
* Fix usage of `#cpp` with Copilot chat. [PR #12755](https://github.com/microsoft/vscode-cpptools/pull/12755)
10+
* Fix some document buffer issues.
11+
312
## Version 1.22.4: September 19, 2024
413
### Enhancements
514
* Performance improvements related to how custom configurations are processed. [#12632](https://github.com/microsoft/vscode-cpptools/issues/12632)

Extension/package.json

+6-3
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.4-main",
5+
"version": "1.22.5-main",
66
"publisher": "ms-vscode",
77
"icon": "LanguageCCPP_color_128x.png",
88
"readme": "README.md",
@@ -6452,7 +6452,10 @@
64526452
"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).",
64536453
"icon": "$(file-code)",
64546454
"parametersSchema": {},
6455-
"when": "(config.C_Cpp.experimentalFeatures =~ /^[eE]nabled$/)"
6455+
"when": "(config.C_Cpp.experimentalFeatures =~ /^[eE]nabled$/)",
6456+
"supportedContentTypes": [
6457+
"text/plain"
6458+
]
64566459
}
64576460
]
64586461
},
@@ -6468,7 +6471,7 @@
64686471
"compile": "yarn install && (yarn verify prep --quiet || yarn prep) && yarn build",
64696472
"watch": "yarn install && (yarn verify prep --quiet || yarn prep) && tsc --build tsconfig.json --watch",
64706473
"rebuild": "yarn install && yarn clean && yarn prep && yarn build",
6471-
"vscode:prepublish": "yarn install && yarn clean && yarn webpack",
6474+
"vsix-prepublish": "yarn install && yarn clean && yarn webpack",
64726475
"webpack": "yarn install && (yarn verify prep --quiet || yarn prep) && tsc --build ui.tsconfig.json && webpack --mode production --env vscode_nls",
64736476
"generate-native-strings": "ts-node -T ./.scripts/generateNativeStrings.ts",
64746477
"generate-options-schema": "ts-node -T ./.scripts/generateOptionsSchema.ts",

Extension/src/LanguageServer/extension.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ function onInterval(): void {
375375
/**
376376
* registered commands
377377
*/
378-
export function registerCommands(enabled: boolean, isRelatedFilesApiEnabled: boolean = false): void {
378+
export function registerCommands(enabled: boolean, isRelatedFilesApiEnabled: boolean): void {
379379
commandDisposables.forEach(d => d.dispose());
380380
commandDisposables.length = 0;
381381
commandDisposables.push(vscode.commands.registerCommand('C_Cpp.SwitchHeaderSource', enabled ? onSwitchHeaderSource : onDisabledCommand));

Extension/src/LanguageServer/lmTool.ts

+7-6
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,15 @@ const knownValues: { [Property in keyof ChatContextResult]?: { [id: string]: str
4444
}
4545
};
4646

47-
class StringLanguageModelToolResult implements vscode.LanguageModelToolResult {
48-
public constructor(public readonly value: string) { }
49-
public toString(): string { return this.value; }
50-
}
47+
const plainTextContentType = 'text/plain';
5148

5249
export class CppConfigurationLanguageModelTool implements vscode.LanguageModelTool {
53-
public async invoke(_parameters: any, token: vscode.CancellationToken): Promise<vscode.LanguageModelToolResult> {
54-
return new StringLanguageModelToolResult(await this.getContext(token));
50+
public async invoke(options: vscode.LanguageModelToolInvocationOptions, token: vscode.CancellationToken): Promise<vscode.LanguageModelToolResult> {
51+
const result: vscode.LanguageModelToolResult = {};
52+
if (options.requestedContentTypes.includes(plainTextContentType)) {
53+
result[plainTextContentType] = await this.getContext(token);
54+
}
55+
return result;
5556
}
5657

5758
private async getContext(token: vscode.CancellationToken): Promise<string> {

Extension/src/main.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@ export async function activate(context: vscode.ExtensionContext): Promise<CppToo
146146
if (shouldActivateLanguageServer) {
147147
await LanguageServer.activate();
148148
} else if (isIntelliSenseEngineDisabled) {
149-
LanguageServer.registerCommands(false);
149+
const isRelatedFilesApiEnabled = await Telemetry.isExperimentEnabled("CppToolsRelatedFilesApi");
150+
LanguageServer.registerCommands(false, isRelatedFilesApiEnabled);
150151
// The check here for isIntelliSenseEngineDisabled avoids logging
151152
// the message on old Macs that we've already displayed a warning for.
152153
log(localize("intellisense.disabled", "intelliSenseEngine is disabled"));

0 commit comments

Comments
 (0)