Skip to content

Commit b5f8db1

Browse files
authored
Merge pull request #6209 from davidwengier/RazorDiagnostics
Fix Razor mapping errors in the log
2 parents a87e136 + 8d3935c commit b5f8db1

File tree

4 files changed

+24
-54
lines changed

4 files changed

+24
-54
lines changed

.vscode/launch.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,8 @@
286286
"updatePackageDependencies"
287287
],
288288
"env": {
289-
"NEW_DEPS_URLS": "https://download.visualstudio.microsoft.com/download/pr/881c5617-50b5-49fa-9075-2eadb1bb4a20/8c9c1628f3f28e5f64f372f626a439e2/razorlanguageserver-linux-arm64-7.0.0-preview.23421.4.zip,https://download.visualstudio.microsoft.com/download/pr/881c5617-50b5-49fa-9075-2eadb1bb4a20/6b6cbece19bb5ad0b600204331a198f4/razorlanguageserver-linux-musl-arm64-7.0.0-preview.23421.4.zip,https://download.visualstudio.microsoft.com/download/pr/881c5617-50b5-49fa-9075-2eadb1bb4a20/2fb0c50bc18dd700f701038729819cdb/razorlanguageserver-linux-musl-x64-7.0.0-preview.23421.4.zip,https://download.visualstudio.microsoft.com/download/pr/881c5617-50b5-49fa-9075-2eadb1bb4a20/73fd71513d102f55a73a58cd0d4687a0/razorlanguageserver-linux-x64-7.0.0-preview.23421.4.zip,https://download.visualstudio.microsoft.com/download/pr/881c5617-50b5-49fa-9075-2eadb1bb4a20/17ec15d73d72e0422c25b24160790430/razorlanguageserver-osx-arm64-7.0.0-preview.23421.4.zip,https://download.visualstudio.microsoft.com/download/pr/881c5617-50b5-49fa-9075-2eadb1bb4a20/7c2ae5db88ce4bf2497cea5594309f00/razorlanguageserver-osx-x64-7.0.0-preview.23421.4.zip,https://download.visualstudio.microsoft.com/download/pr/881c5617-50b5-49fa-9075-2eadb1bb4a20/63f3cd0e2ceaa4e686657c7519a39a1f/razorlanguageserver-win-arm64-7.0.0-preview.23421.4.zip,https://download.visualstudio.microsoft.com/download/pr/881c5617-50b5-49fa-9075-2eadb1bb4a20/e3907604c19170097ba390f61c2cecfe/razorlanguageserver-win-x64-7.0.0-preview.23421.4.zip,https://download.visualstudio.microsoft.com/download/pr/881c5617-50b5-49fa-9075-2eadb1bb4a20/10de878742e068fda1f4c6afa05d023b/razorlanguageserver-win-x86-7.0.0-preview.23421.4.zip",
290-
"NEW_DEPS_VERSION": "7.0.0-preview.23421.4",
289+
"NEW_DEPS_URLS": "https://download.visualstudio.microsoft.com/download/pr/0b0d800b-570c-446a-8e29-4130bd68c63b/4aca138f5c6299422e240dcc50689a67/razorlanguageserver-linux-arm64-7.0.0-preview.23423.3.zip,https://download.visualstudio.microsoft.com/download/pr/0b0d800b-570c-446a-8e29-4130bd68c63b/eee386c129c18ba1705fe411cb981a20/razorlanguageserver-linux-musl-arm64-7.0.0-preview.23423.3.zip,https://download.visualstudio.microsoft.com/download/pr/0b0d800b-570c-446a-8e29-4130bd68c63b/7d1e4e0bf72de43dc272d22de2486633/razorlanguageserver-linux-musl-x64-7.0.0-preview.23423.3.zip,https://download.visualstudio.microsoft.com/download/pr/0b0d800b-570c-446a-8e29-4130bd68c63b/b9653cb6c40f965986266f70ae7dab25/razorlanguageserver-linux-x64-7.0.0-preview.23423.3.zip,https://download.visualstudio.microsoft.com/download/pr/0b0d800b-570c-446a-8e29-4130bd68c63b/679c6fe63c016298914264c33326f2ea/razorlanguageserver-osx-arm64-7.0.0-preview.23423.3.zip,https://download.visualstudio.microsoft.com/download/pr/0b0d800b-570c-446a-8e29-4130bd68c63b/74f8a06bc496f54b37466c382c6744ee/razorlanguageserver-osx-x64-7.0.0-preview.23423.3.zip,https://download.visualstudio.microsoft.com/download/pr/0b0d800b-570c-446a-8e29-4130bd68c63b/695b332017bfa81af74787904979fde8/razorlanguageserver-win-arm64-7.0.0-preview.23423.3.zip,https://download.visualstudio.microsoft.com/download/pr/0b0d800b-570c-446a-8e29-4130bd68c63b/a48c3e83b44a34ddb295099c55e31e7e/razorlanguageserver-win-x64-7.0.0-preview.23423.3.zip,https://download.visualstudio.microsoft.com/download/pr/0b0d800b-570c-446a-8e29-4130bd68c63b/e188fa3cbd9a5601701d0f8de0705496/razorlanguageserver-win-x86-7.0.0-preview.23423.3.zip",
290+
"NEW_DEPS_VERSION": "7.0.0-preview.23423.3",
291291
"NEW_DEPS_ID": "Razor"
292292
},
293293
"cwd": "${workspaceFolder}"

package.json

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"defaults": {
4040
"roslyn": "4.8.0-1.23422.6",
4141
"omniSharp": "1.39.7",
42-
"razor": "7.0.0-preview.23421.4",
42+
"razor": "7.0.0-preview.23423.3",
4343
"razorOmnisharp": "7.0.0-preview.23363.1"
4444
},
4545
"main": "./dist/extension",
@@ -605,46 +605,46 @@
605605
{
606606
"id": "Razor",
607607
"description": "Razor Language Server (Windows / x64)",
608-
"url": "https://download.visualstudio.microsoft.com/download/pr/881c5617-50b5-49fa-9075-2eadb1bb4a20/e3907604c19170097ba390f61c2cecfe/razorlanguageserver-win-x64-7.0.0-preview.23421.4.zip",
608+
"url": "https://download.visualstudio.microsoft.com/download/pr/0b0d800b-570c-446a-8e29-4130bd68c63b/a48c3e83b44a34ddb295099c55e31e7e/razorlanguageserver-win-x64-7.0.0-preview.23423.3.zip",
609609
"installPath": ".razor",
610610
"platforms": [
611611
"win32"
612612
],
613613
"architectures": [
614614
"x86_64"
615615
],
616-
"integrity": "4B6FA2941EB038DE99E194F350410DBB111D67A403D0EB046BD8C9F7A5DAB99F"
616+
"integrity": "A7815AE5A9BEFE7EB5C0006343341A38D0F7A662865DAD21F0842E064322C186"
617617
},
618618
{
619619
"id": "Razor",
620620
"description": "Razor Language Server (Windows / x86)",
621-
"url": "https://download.visualstudio.microsoft.com/download/pr/881c5617-50b5-49fa-9075-2eadb1bb4a20/10de878742e068fda1f4c6afa05d023b/razorlanguageserver-win-x86-7.0.0-preview.23421.4.zip",
621+
"url": "https://download.visualstudio.microsoft.com/download/pr/0b0d800b-570c-446a-8e29-4130bd68c63b/e188fa3cbd9a5601701d0f8de0705496/razorlanguageserver-win-x86-7.0.0-preview.23423.3.zip",
622622
"installPath": ".razor",
623623
"platforms": [
624624
"win32"
625625
],
626626
"architectures": [
627627
"x86"
628628
],
629-
"integrity": "23534991F57204672FF641BF9485B21DF6BED24ED0549CD89080F1C304A799FF"
629+
"integrity": "D543C2E513F93F91AEDD95AE2A410747D71D3E7CF4D32E0FA31F8B7691109F6F"
630630
},
631631
{
632632
"id": "Razor",
633633
"description": "Razor Language Server (Windows / ARM64)",
634-
"url": "https://download.visualstudio.microsoft.com/download/pr/881c5617-50b5-49fa-9075-2eadb1bb4a20/63f3cd0e2ceaa4e686657c7519a39a1f/razorlanguageserver-win-arm64-7.0.0-preview.23421.4.zip",
634+
"url": "https://download.visualstudio.microsoft.com/download/pr/0b0d800b-570c-446a-8e29-4130bd68c63b/695b332017bfa81af74787904979fde8/razorlanguageserver-win-arm64-7.0.0-preview.23423.3.zip",
635635
"installPath": ".razor",
636636
"platforms": [
637637
"win32"
638638
],
639639
"architectures": [
640640
"arm64"
641641
],
642-
"integrity": "3332655D68E65662689587C91B4B7F8E336855D4F37379826838BF66C1CEC670"
642+
"integrity": "DF2E2F442BE365DE390F7402CE69E5514D91D379A4A755133B696CC2972CFE53"
643643
},
644644
{
645645
"id": "Razor",
646646
"description": "Razor Language Server (Linux / x64)",
647-
"url": "https://download.visualstudio.microsoft.com/download/pr/881c5617-50b5-49fa-9075-2eadb1bb4a20/73fd71513d102f55a73a58cd0d4687a0/razorlanguageserver-linux-x64-7.0.0-preview.23421.4.zip",
647+
"url": "https://download.visualstudio.microsoft.com/download/pr/0b0d800b-570c-446a-8e29-4130bd68c63b/b9653cb6c40f965986266f70ae7dab25/razorlanguageserver-linux-x64-7.0.0-preview.23423.3.zip",
648648
"installPath": ".razor",
649649
"platforms": [
650650
"linux"
@@ -655,12 +655,12 @@
655655
"binaries": [
656656
"./rzls"
657657
],
658-
"integrity": "E306FD0B3416FA022A5497A02D49183BA31AF4B4995E4E4AC3F95BA0E39FBEB0"
658+
"integrity": "87D1357F1BCDCBA9D775677B5ADFFE22D87B013155B3ADBDA69F9CEA0F5C0FCF"
659659
},
660660
{
661661
"id": "Razor",
662662
"description": "Razor Language Server (Linux ARM64)",
663-
"url": "https://download.visualstudio.microsoft.com/download/pr/881c5617-50b5-49fa-9075-2eadb1bb4a20/8c9c1628f3f28e5f64f372f626a439e2/razorlanguageserver-linux-arm64-7.0.0-preview.23421.4.zip",
663+
"url": "https://download.visualstudio.microsoft.com/download/pr/0b0d800b-570c-446a-8e29-4130bd68c63b/4aca138f5c6299422e240dcc50689a67/razorlanguageserver-linux-arm64-7.0.0-preview.23423.3.zip",
664664
"installPath": ".razor",
665665
"platforms": [
666666
"linux"
@@ -671,12 +671,12 @@
671671
"binaries": [
672672
"./rzls"
673673
],
674-
"integrity": "BFBA8974043F89FC01168622287A89FADDEACEBFF4B509C98C442092F9CC17AB"
674+
"integrity": "9E8C75DBEA512D7FCE5D96D240D57E6C12161EDFE7482A8F68F99BD5019F3EC1"
675675
},
676676
{
677677
"id": "Razor",
678678
"description": "Razor Language Server (Linux musl / x64)",
679-
"url": "https://download.visualstudio.microsoft.com/download/pr/881c5617-50b5-49fa-9075-2eadb1bb4a20/2fb0c50bc18dd700f701038729819cdb/razorlanguageserver-linux-musl-x64-7.0.0-preview.23421.4.zip",
679+
"url": "https://download.visualstudio.microsoft.com/download/pr/0b0d800b-570c-446a-8e29-4130bd68c63b/7d1e4e0bf72de43dc272d22de2486633/razorlanguageserver-linux-musl-x64-7.0.0-preview.23423.3.zip",
680680
"installPath": ".razor",
681681
"platforms": [
682682
"linux-musl"
@@ -687,12 +687,12 @@
687687
"binaries": [
688688
"./rzls"
689689
],
690-
"integrity": "2C74F83A728B8D23F20F7B72D6D002E840DDD4B850F110939B39A1B68DD310C3"
690+
"integrity": "AD36EAA27AC75EF161E4642454B995FFE71751ED7B89C6B4233D1D577CB763A6"
691691
},
692692
{
693693
"id": "Razor",
694694
"description": "Razor Language Server (Linux musl ARM64)",
695-
"url": "https://download.visualstudio.microsoft.com/download/pr/881c5617-50b5-49fa-9075-2eadb1bb4a20/6b6cbece19bb5ad0b600204331a198f4/razorlanguageserver-linux-musl-arm64-7.0.0-preview.23421.4.zip",
695+
"url": "https://download.visualstudio.microsoft.com/download/pr/0b0d800b-570c-446a-8e29-4130bd68c63b/eee386c129c18ba1705fe411cb981a20/razorlanguageserver-linux-musl-arm64-7.0.0-preview.23423.3.zip",
696696
"installPath": ".razor",
697697
"platforms": [
698698
"linux-musl"
@@ -703,12 +703,12 @@
703703
"binaries": [
704704
"./rzls"
705705
],
706-
"integrity": "85E03202C2527DB93913D1E41E3CE5A4DB3C89F328BBD97602CB5D1C26BB8E79"
706+
"integrity": "EC8279752254F33AECC5D59E7D02DC93BB37EF2740CC63ACFF0DB78725BF169C"
707707
},
708708
{
709709
"id": "Razor",
710710
"description": "Razor Language Server (macOS / x64)",
711-
"url": "https://download.visualstudio.microsoft.com/download/pr/881c5617-50b5-49fa-9075-2eadb1bb4a20/7c2ae5db88ce4bf2497cea5594309f00/razorlanguageserver-osx-x64-7.0.0-preview.23421.4.zip",
711+
"url": "https://download.visualstudio.microsoft.com/download/pr/0b0d800b-570c-446a-8e29-4130bd68c63b/74f8a06bc496f54b37466c382c6744ee/razorlanguageserver-osx-x64-7.0.0-preview.23423.3.zip",
712712
"installPath": ".razor",
713713
"platforms": [
714714
"darwin"
@@ -719,12 +719,12 @@
719719
"binaries": [
720720
"./rzls"
721721
],
722-
"integrity": "AC2AB29F5E11C94603F616926B0FEC50E16570A585B2F34DDCF378B377583547"
722+
"integrity": "FE3356F653A786A5442E99AA6FE19DD9215962F9B926AD2E723596A5B6E3C135"
723723
},
724724
{
725725
"id": "Razor",
726726
"description": "Razor Language Server (macOS ARM64)",
727-
"url": "https://download.visualstudio.microsoft.com/download/pr/881c5617-50b5-49fa-9075-2eadb1bb4a20/17ec15d73d72e0422c25b24160790430/razorlanguageserver-osx-arm64-7.0.0-preview.23421.4.zip",
727+
"url": "https://download.visualstudio.microsoft.com/download/pr/0b0d800b-570c-446a-8e29-4130bd68c63b/679c6fe63c016298914264c33326f2ea/razorlanguageserver-osx-arm64-7.0.0-preview.23423.3.zip",
728728
"installPath": ".razor",
729729
"platforms": [
730730
"darwin"
@@ -735,7 +735,7 @@
735735
"binaries": [
736736
"./rzls"
737737
],
738-
"integrity": "1D539DF017596D234FB76A6C965B6E05307EB2359EA41DC9DFAEB5C495196E15"
738+
"integrity": "594EAE393087FD002829041B261D6777CBA17E612783C548E1B9B2D20BE97E54"
739739
},
740740
{
741741
"id": "RazorOmnisharp",

src/razor/src/diagnostics/razorDiagnosticHandler.ts

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,18 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import * as vscode from 'vscode';
7-
import {
8-
DocumentDiagnosticReport,
9-
DocumentDiagnosticParams,
10-
RequestType,
11-
FullDocumentDiagnosticReport,
12-
Range,
13-
Diagnostic,
14-
} from 'vscode-languageclient';
7+
import { DocumentDiagnosticReport, DocumentDiagnosticParams, RequestType } from 'vscode-languageclient';
158
import { RazorLanguageServerClient } from '../razorLanguageServerClient';
169
import { RoslynLanguageServer } from '../../../lsptoolshost/roslynLanguageServer';
1710
import { RazorDocumentManager } from '../document/razorDocumentManager';
1811
import { UriConverter } from '../../../lsptoolshost/uriConverter';
19-
import { LanguageKind } from '../rpc/languageKind';
2012
import { RazorLanguageServiceClient } from '../razorLanguageServiceClient';
2113
import { RazorLanguageFeatureBase } from '../razorLanguageFeatureBase';
2214
import { RazorDocumentSynchronizer } from '../document/razorDocumentSynchronizer';
2315
import { RazorLogger } from '../razorLogger';
2416

2517
export class RazorDiagnosticHandler extends RazorLanguageFeatureBase {
26-
private static readonly razorPullDiagnosticsCommand = 'razor/pullDiagnostics';
18+
private static readonly razorPullDiagnosticsCommand = 'razor/csharpPullDiagnostics';
2719
private diagnosticRequestType: RequestType<DocumentDiagnosticParams, DocumentDiagnosticReport, any> =
2820
new RequestType(RazorDiagnosticHandler.razorPullDiagnosticsCommand);
2921

@@ -63,28 +55,6 @@ export class RazorDiagnosticHandler extends RazorLanguageFeatureBase {
6355
RoslynLanguageServer.roslynPullDiagnosticCommand,
6456
request
6557
);
66-
if (response.kind === 'full') {
67-
const changedDiagnostics: FullDocumentDiagnosticReport = response as FullDocumentDiagnosticReport;
68-
const remappedDiagnostics = new Array<Diagnostic>();
69-
for (const diagnostic of changedDiagnostics.items) {
70-
const convertedRange = new vscode.Range(
71-
diagnostic.range.start.line,
72-
diagnostic.range.start.character,
73-
diagnostic.range.end.line,
74-
diagnostic.range.end.character
75-
);
76-
const remappedResponse = await this.serviceClient.mapToDocumentRanges(
77-
LanguageKind.CSharp,
78-
[convertedRange],
79-
razorDocument.uri
80-
);
81-
if (remappedResponse.ranges.length != 0) {
82-
diagnostic.range = Range.create(remappedResponse.ranges[0].start, remappedResponse.ranges[0].end);
83-
remappedDiagnostics.push(diagnostic);
84-
}
85-
}
86-
changedDiagnostics.items = remappedDiagnostics;
87-
}
8858

8959
return response;
9060
}

src/razor/src/razorLanguageServerClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ export class RazorLanguageServerClient implements vscode.Disposable {
246246
if (!options.usingOmniSharp) {
247247
args.push('--projectConfigurationFileName');
248248
args.push('project.razor.vscode.json');
249-
args.push('--SupportsDelegatedDiagnostics');
249+
args.push('--DelegateToCSharpOnDiagnosticPublish');
250250
args.push('true');
251251
args.push('--SupportsDelegatedCodeActions');
252252
args.push('true');

0 commit comments

Comments
 (0)