Skip to content

Commit d6e15a6

Browse files
[automated] Merge branch 'main' => 'prerelease' (#8066)
2 parents 6f3511d + 3d3dbc6 commit d6e15a6

File tree

7 files changed

+71
-14
lines changed

7 files changed

+71
-14
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@
33
- Diagnostics related feature requests and improvements [#5951](https://github.com/dotnet/vscode-csharp/issues/5951)
44
- Debug from .csproj and .sln [#5876](https://github.com/dotnet/vscode-csharp/issues/5876)
55

6+
# 2.70.x
7+
* Bump razor to 9.0.0-preview.25161.2 (PR: [#8058](https://github.com/dotnet/vscode-csharp/pull/8058))
8+
* Move VS Code To Pull Diagnostics (#11602) (PR: [#11602](https://github.com/dotnet/razor/pull/11602))
9+
* Upgrade to net9 (#11535) (PR: [#11535](https://github.com/dotnet/razor/pull/11535))
10+
* Cleanup CompletionTriggerAndCommitCharacters (#11600) (PR: [#11600](https://github.com/dotnet/razor/pull/11600))
11+
* Add constraints to CaptureParameters method (#11530) (PR: [#11530](https://github.com/dotnet/razor/pull/11530))
12+
* [FUSE] Layout mapping (#11567) (PR: [#11567](https://github.com/dotnet/razor/pull/11567))
13+
* Bump xamlTools to 17.14.35913.250 (PR: [#8062](https://github.com/dotnet/vscode-csharp/pull/8062))
14+
615
# 2.69.x
716
* Bump razor to 9.0.0-preview.25156.2 (PR: [#8047](https://github.com/dotnet/vscode-csharp/pull/8047))
817
* Enable FUSE by default

azure-pipelines.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ pr:
1818
exclude:
1919
- ./*.md
2020
- .github/*
21+
- azure-pipelines/release.yml
2122

2223
# Run a scheduled build every night on main to run tests against insiders VSCode.
2324
# The variable testVSCodeVersion is set to insiders based on the build reason.

azure-pipelines/release.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,27 @@ extends:
5151
runOnce:
5252
deploy:
5353
steps:
54+
- pwsh: |
55+
$artifactVersion = '$(resources.pipeline.officialBuildCI.runName)'
56+
$artifactBranchName = '$(resources.pipeline.officialBuildCI.sourceBranch)' -replace 'refs/heads/',''
57+
58+
# Set the BuildNumber in the form `# Publish prerelease v2.69.22 #` to improve readability in AzDO
59+
$buildNumberName = "Publish $artifactBranchName $artifactVersion"
60+
if ('${{ parameters.test }}' -eq 'true') {
61+
$buildNumberName = 'Test ' + $buildNumberName
62+
}
63+
64+
# Replace invalid characters
65+
$buildNumberName = $buildNumberName -replace '["/:<>\|?@*]','_'
66+
# Maximum buildnumber length is 255 chars and we are going to add a prefix and suffix so ensure we have space.
67+
if ($buildNumberName.Length -GT 252) {
68+
$buildNumberName = $buildNumberName.Substring(0, 252)
69+
}
70+
# Avoid ever ending the BuildNumber with a `.` by always appending to it.
71+
$buildNumberName = ' ' + $buildNumberName + ' #'
72+
73+
Write-Host "##vso[build.updatebuildnumber]$buildNumberName"
74+
displayName: Set BuildNumber
5475
- template: /azure-pipelines/install-node.yml@self
5576
- pwsh: |
5677
npm install --global @vscode/vsce
@@ -113,6 +134,7 @@ extends:
113134
Write-Host "##[command]vsce $publishArgs"
114135
vsce @publishArgs
115136
}
137+
116138
- stage: 'TagRelease'
117139
displayName: 'Tag release of vscode-csharp'
118140
dependsOn: 'PublishStage'

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@
3939
"defaults": {
4040
"roslyn": "4.14.0-3.25156.1",
4141
"omniSharp": "1.39.12",
42-
"razor": "9.0.0-preview.25156.2",
42+
"razor": "9.0.0-preview.25161.2",
4343
"razorOmnisharp": "7.0.0-preview.23363.1",
44-
"xamlTools": "17.14.35904.287"
44+
"xamlTools": "17.14.35913.250"
4545
},
4646
"main": "./dist/extension",
4747
"l10n": "./l10n",

src/razor/src/diagnostics/razorDiagnosticHandler.ts

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import * as vscode from 'vscode';
7-
import { DocumentDiagnosticReport, DocumentDiagnosticParams, RequestType } from 'vscode-languageserver-protocol';
7+
import { DocumentDiagnosticParams, DocumentDiagnosticReport, RequestType } from 'vscode-languageserver-protocol';
88
import { RazorLanguageServerClient } from '../razorLanguageServerClient';
99
import { RazorDocumentManager } from '../document/razorDocumentManager';
1010
import { UriConverter } from '../../../lsptoolshost/utils/uriConverter';
@@ -13,14 +13,15 @@ import { RazorLanguageFeatureBase } from '../razorLanguageFeatureBase';
1313
import { RazorDocumentSynchronizer } from '../document/razorDocumentSynchronizer';
1414
import { RazorLogger } from '../razorLogger';
1515
import { roslynPullDiagnosticCommand } from '../../../lsptoolshost/razor/razorCommands';
16+
import { SerializableTextDocumentIdentifierAndVersion } from '../simplify/serializableTextDocumentIdentifierAndVersion';
1617

1718
export class RazorDiagnosticHandler extends RazorLanguageFeatureBase {
1819
private static readonly razorPullDiagnosticsCommand = 'razor/csharpPullDiagnostics';
19-
private diagnosticRequestType: RequestType<DocumentDiagnosticParams, DocumentDiagnosticReport, any> =
20+
private diagnosticRequestType: RequestType<DelegatedDiagnosticParams, DocumentDiagnosticReport, any> =
2021
new RequestType(RazorDiagnosticHandler.razorPullDiagnosticsCommand);
2122

2223
constructor(
23-
documentSynchronizer: RazorDocumentSynchronizer,
24+
protected readonly documentSynchronizer: RazorDocumentSynchronizer,
2425
protected readonly serverClient: RazorLanguageServerClient,
2526
protected readonly serviceClient: RazorLanguageServiceClient,
2627
protected readonly documentManager: RazorDocumentManager,
@@ -31,31 +32,55 @@ export class RazorDiagnosticHandler extends RazorLanguageFeatureBase {
3132

3233
public async register() {
3334
await this.serverClient.onRequestWithParams<
34-
DocumentDiagnosticParams,
35+
DelegatedDiagnosticParams,
3536
DocumentDiagnosticReport | undefined,
3637
any
37-
>(this.diagnosticRequestType, async (request: DocumentDiagnosticParams, token: vscode.CancellationToken) =>
38+
>(this.diagnosticRequestType, async (request: DelegatedDiagnosticParams, token: vscode.CancellationToken) =>
3839
this.getDiagnostic(request, token)
3940
);
4041
}
4142

4243
private async getDiagnostic(
43-
request: DocumentDiagnosticParams,
44-
_: vscode.CancellationToken
44+
request: DelegatedDiagnosticParams,
45+
token: vscode.CancellationToken
4546
): Promise<DocumentDiagnosticReport | undefined> {
4647
if (!this.documentManager.roslynActivated) {
4748
return undefined;
4849
}
4950

50-
const razorDocumentUri = vscode.Uri.parse(request.textDocument.uri, true);
51+
const razorDocumentUri = vscode.Uri.parse(request.identifier.textDocumentIdentifier.uri, true);
52+
const textDocument = await vscode.workspace.openTextDocument(razorDocumentUri);
5153
const razorDocument = await this.documentManager.getDocument(razorDocumentUri);
54+
55+
const synchronized = await this.documentSynchronizer.trySynchronizeProjectedDocument(
56+
textDocument,
57+
razorDocument.csharpDocument,
58+
request.identifier.version,
59+
token
60+
);
61+
62+
if (!synchronized) {
63+
return undefined;
64+
}
65+
5266
const virtualCSharpUri = razorDocument.csharpDocument.uri;
53-
request.textDocument.uri = UriConverter.serialize(virtualCSharpUri);
67+
68+
const roslynRequest: DocumentDiagnosticParams = {
69+
textDocument: {
70+
uri: UriConverter.serialize(virtualCSharpUri),
71+
},
72+
};
73+
5474
const response: DocumentDiagnosticReport = await vscode.commands.executeCommand(
5575
roslynPullDiagnosticCommand,
56-
request
76+
roslynRequest
5777
);
5878

5979
return response;
6080
}
6181
}
82+
83+
interface DelegatedDiagnosticParams {
84+
identifier: SerializableTextDocumentIdentifierAndVersion;
85+
correlationId: string;
86+
}

src/razor/src/razorLanguageFeatureBase.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { getUriPath } from './uriPaths';
1414

1515
export class RazorLanguageFeatureBase {
1616
constructor(
17-
private readonly documentSynchronizer: RazorDocumentSynchronizer,
17+
protected readonly documentSynchronizer: RazorDocumentSynchronizer,
1818
protected readonly documentManager: RazorDocumentManager,
1919
protected readonly serviceClient: RazorLanguageServiceClient,
2020
protected readonly logger: RazorLogger

version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
3-
"version": "2.69",
3+
"version": "2.70",
44
"publicReleaseRefSpec": [
55
"^refs/heads/release$",
66
"^refs/heads/prerelease$",

0 commit comments

Comments
 (0)