|
4 | 4 | *--------------------------------------------------------------------------------------------*/
|
5 | 5 |
|
6 | 6 | 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'; |
15 | 8 | import { RazorLanguageServerClient } from '../razorLanguageServerClient';
|
16 | 9 | import { RoslynLanguageServer } from '../../../lsptoolshost/roslynLanguageServer';
|
17 | 10 | import { RazorDocumentManager } from '../document/razorDocumentManager';
|
18 | 11 | import { UriConverter } from '../../../lsptoolshost/uriConverter';
|
19 |
| -import { LanguageKind } from '../rpc/languageKind'; |
20 | 12 | import { RazorLanguageServiceClient } from '../razorLanguageServiceClient';
|
21 | 13 | import { RazorLanguageFeatureBase } from '../razorLanguageFeatureBase';
|
22 | 14 | import { RazorDocumentSynchronizer } from '../document/razorDocumentSynchronizer';
|
23 | 15 | import { RazorLogger } from '../razorLogger';
|
24 | 16 |
|
25 | 17 | export class RazorDiagnosticHandler extends RazorLanguageFeatureBase {
|
26 |
| - private static readonly razorPullDiagnosticsCommand = 'razor/pullDiagnostics'; |
| 18 | + private static readonly razorPullDiagnosticsCommand = 'razor/csharpPullDiagnostics'; |
27 | 19 | private diagnosticRequestType: RequestType<DocumentDiagnosticParams, DocumentDiagnosticReport, any> =
|
28 | 20 | new RequestType(RazorDiagnosticHandler.razorPullDiagnosticsCommand);
|
29 | 21 |
|
@@ -63,28 +55,6 @@ export class RazorDiagnosticHandler extends RazorLanguageFeatureBase {
|
63 | 55 | RoslynLanguageServer.roslynPullDiagnosticCommand,
|
64 | 56 | request
|
65 | 57 | );
|
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 |
| - } |
88 | 58 |
|
89 | 59 | return response;
|
90 | 60 | }
|
|
0 commit comments