@@ -39,7 +39,8 @@ class TextDocumentHandler : ITextDocumentSyncHandler
3939 private readonly ILanguageServer _router ;
4040
4141 private readonly DocumentSelector _documentSelector = new DocumentSelector (
42- new DocumentFilter ( ) {
42+ new DocumentFilter ( )
43+ {
4344 Pattern = "**/*.csproj" ,
4445 Language = "xml"
4546 }
@@ -52,19 +53,24 @@ public TextDocumentHandler(ILanguageServer router)
5253 _router = router ;
5354 }
5455
55- public TextDocumentSyncOptions Options { get ; } = new TextDocumentSyncOptions ( ) {
56+ public TextDocumentSyncOptions Options { get ; } = new TextDocumentSyncOptions ( )
57+ {
5658 WillSaveWaitUntil = false ,
5759 WillSave = true ,
5860 Change = TextDocumentSyncKind . Full ,
59- Save = new SaveOptions ( ) {
61+ Save = new SaveOptions ( )
62+ {
6063 IncludeText = true
6164 } ,
6265 OpenClose = true
6366 } ;
6467
68+ public string Key => ( string ) _documentSelector ;
69+
6570 public Task Handle ( DidChangeTextDocumentParams notification )
6671 {
67- _router . LogMessage ( new LogMessageParams ( ) {
72+ _router . LogMessage ( new LogMessageParams ( )
73+ {
6874 Type = MessageType . Log ,
6975 Message = "Hello World!!!!"
7076 } ) ;
@@ -73,7 +79,8 @@ public Task Handle(DidChangeTextDocumentParams notification)
7379
7480 TextDocumentChangeRegistrationOptions IRegistration < TextDocumentChangeRegistrationOptions > . GetRegistrationOptions ( )
7581 {
76- return new TextDocumentChangeRegistrationOptions ( ) {
82+ return new TextDocumentChangeRegistrationOptions ( )
83+ {
7784 DocumentSelector = _documentSelector ,
7885 SyncKind = Options . Change
7986 } ;
@@ -86,15 +93,17 @@ public void SetCapability(SynchronizationCapability capability)
8693
8794 public async Task Handle ( DidOpenTextDocumentParams notification )
8895 {
89- _router . LogMessage ( new LogMessageParams ( ) {
96+ _router . LogMessage ( new LogMessageParams ( )
97+ {
9098 Type = MessageType . Log ,
9199 Message = "Hello World!!!!"
92100 } ) ;
93101 }
94102
95103 TextDocumentRegistrationOptions IRegistration < TextDocumentRegistrationOptions > . GetRegistrationOptions ( )
96104 {
97- return new TextDocumentRegistrationOptions ( ) {
105+ return new TextDocumentRegistrationOptions ( )
106+ {
98107 DocumentSelector = _documentSelector ,
99108 } ;
100109 }
@@ -111,7 +120,8 @@ public Task Handle(DidSaveTextDocumentParams notification)
111120
112121 TextDocumentSaveRegistrationOptions IRegistration < TextDocumentSaveRegistrationOptions > . GetRegistrationOptions ( )
113122 {
114- return new TextDocumentSaveRegistrationOptions ( ) {
123+ return new TextDocumentSaveRegistrationOptions ( )
124+ {
115125 DocumentSelector = _documentSelector ,
116126 IncludeText = Options . Save . IncludeText
117127 } ;
0 commit comments