@@ -34,17 +34,37 @@ def run
3434 in { method : "shutdown" }
3535 store . clear
3636 return
37- in { method : "textDocument/didChange" , params : { textDocument : { uri : } , contentChanges : [ { text : } , *] } }
37+ in {
38+ method : "textDocument/didChange" ,
39+ params : { textDocument : { uri : } , contentChanges : [ { text : } , *] }
40+ }
3841 store [ uri ] = text
39- in { method : "textDocument/didOpen" , params : { textDocument : { uri :, text : } } }
42+ in {
43+ method : "textDocument/didOpen" ,
44+ params : { textDocument : { uri :, text : } }
45+ }
4046 store [ uri ] = text
41- in { method : "textDocument/didClose" , params : { textDocument : { uri : } } }
47+ in {
48+ method : "textDocument/didClose" , params : { textDocument : { uri : } }
49+ }
4250 store . delete ( uri )
43- in { method : "textDocument/formatting" , id :, params : { textDocument : { uri : } } }
51+ in {
52+ method : "textDocument/formatting" ,
53+ id :,
54+ params : { textDocument : { uri : } }
55+ }
4456 write ( id : id , result : [ format ( store [ uri ] ) ] )
45- in { method : "textDocument/inlayHints" , id :, params : { textDocument : { uri : } } }
57+ in {
58+ method : "textDocument/inlayHints" ,
59+ id :,
60+ params : { textDocument : { uri : } }
61+ }
4662 write ( id : id , result : inlay_hints ( store [ uri ] ) )
47- in { method : "syntaxTree/visualizing" , id :, params : { textDocument : { uri : } } }
63+ in {
64+ method : "syntaxTree/visualizing" ,
65+ id :,
66+ params : { textDocument : { uri : } }
67+ }
4868 output = [ ]
4969 PP . pp ( SyntaxTree . parse ( store [ uri ] ) , output )
5070 write ( id : id , result : output . join )
@@ -61,15 +81,24 @@ def run
6181 def capabilities
6282 {
6383 documentFormattingProvider : true ,
64- textDocumentSync : { change : 1 , openClose : true }
84+ textDocumentSync : {
85+ change : 1 ,
86+ openClose : true
87+ }
6588 }
6689 end
6790
6891 def format ( source )
6992 {
7093 range : {
71- start : { line : 0 , character : 0 } ,
72- end : { line : source . lines . size + 1 , character : 0 }
94+ start : {
95+ line : 0 ,
96+ character : 0
97+ } ,
98+ end : {
99+ line : source . lines . size + 1 ,
100+ character : 0
101+ }
73102 } ,
74103 newText : SyntaxTree . format ( source )
75104 }
0 commit comments