File tree Expand file tree Collapse file tree 4 files changed +41
-1
lines changed Expand file tree Collapse file tree 4 files changed +41
-1
lines changed Original file line number Diff line number Diff line change 50
50
"name" : " Microsoft.CodeAnalysis.LanguageClient.SolutionSnapshotProvider" ,
51
51
"version" : " 0.1"
52
52
}
53
+ },
54
+ {
55
+ "moniker" : {
56
+ "name" : " Microsoft.VisualStudioCode.CSharp.BuildResultService" ,
57
+ "version" : " 0.1"
58
+ }
53
59
}
54
60
],
55
61
"scripts" : {
4992
4998
}
4993
4999
]
4994
5000
}
4995
- }
5001
+ }
Original file line number Diff line number Diff line change
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License. See License.txt in the project root for license information.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ import { CancellationToken } from 'vscode' ;
6
+
7
+ interface IBuildResultDiagnostics {
8
+ buildStarted ( cancellationToken ?: CancellationToken ) : Promise < void > ;
9
+ reportBuildResult ( buildDiagnostics : RegExpExecArray [ ] , cancellationToken ?: CancellationToken ) : Promise < void > ;
10
+ }
11
+
12
+ export class BuildResultDiagnostics implements IBuildResultDiagnostics {
13
+ public async buildStarted ( ) : Promise < void > {
14
+ console . log ( 'build started' ) ;
15
+ }
16
+
17
+ public async reportBuildResult ( buildDiagnostics : RegExpExecArray [ ] ) : Promise < void > {
18
+ console . log ( 'received ' + buildDiagnostics . length + ' diagnostics' ) ;
19
+ }
20
+ }
Original file line number Diff line number Diff line change @@ -32,4 +32,13 @@ export default class Descriptors {
32
32
protocolMajorVersion : 3 ,
33
33
}
34
34
) ;
35
+
36
+ static readonly csharpExtensionBuildResultService : ServiceRpcDescriptor = new ServiceJsonRpcDescriptor (
37
+ ServiceMoniker . create ( 'Microsoft.VisualStudioCode.CSharp.BuildResultService' , '0.1' ) ,
38
+ Formatters . MessagePack ,
39
+ MessageDelimiters . BigEndianInt32LengthHeader ,
40
+ {
41
+ protocolMajorVersion : 3 ,
42
+ }
43
+ ) ;
35
44
}
Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ import { registerOmnisharpOptionChanges } from './omnisharp/omnisharpOptionChang
56
56
import { RoslynLanguageServerEvents } from './lsptoolshost/languageServerEvents' ;
57
57
import { ServerStateChange } from './lsptoolshost/serverStateChange' ;
58
58
import { SolutionSnapshotProvider } from './lsptoolshost/services/solutionSnapshotProvider' ;
59
+ import { BuildResultDiagnostics } from './lsptoolshost/services/buildResultReporterService' ;
59
60
60
61
export async function activate (
61
62
context : vscode . ExtensionContext
@@ -412,6 +413,10 @@ function profferBrokeredServices(
412
413
serviceContainer . profferServiceFactory (
413
414
Descriptors . solutionSnapshotProviderRegistration ,
414
415
( _mk , _op , _sb ) => new SolutionSnapshotProvider ( languageServerPromise )
416
+ ) ,
417
+ serviceContainer . profferServiceFactory (
418
+ Descriptors . csharpExtensionBuildResultService ,
419
+ ( _mk , _op , _sb ) => new BuildResultDiagnostics ( )
415
420
)
416
421
) ;
417
422
}
You can’t perform that action at this time.
0 commit comments