@@ -148,11 +148,12 @@ let getOpenedFileContent = (fileUri: string) => {
148
148
149
149
process . on ( 'message' , ( a : ( m . RequestMessage | m . NotificationMessage ) ) => {
150
150
if ( ( a as m . RequestMessage ) . id == null ) {
151
- // this is a notification message, aka client sent and forgot
151
+ // this is a notification message, aka the client ends it and doesn't want a reply
152
152
let aa = ( a as m . NotificationMessage )
153
153
if ( ! initialized && aa . method !== 'exit' ) {
154
154
// From spec: "Notifications should be dropped, except for the exit notification. This will allow the exit of a server without an initialize request"
155
155
// For us: do nothing. We don't have anything we need to clean up right now
156
+ // TODO: we might have things we need to clean up now... like some watcher stuff
156
157
} else if ( aa . method === 'exit' ) {
157
158
// The server should exit with success code 0 if the shutdown request has been received before; otherwise with error code 1
158
159
if ( shutdownRequestAlreadyReceived ) {
@@ -183,7 +184,7 @@ process.on('message', (a: (m.RequestMessage | m.NotificationMessage)) => {
183
184
closedFile ( params . textDocument . uri )
184
185
}
185
186
} else {
186
- // this is a request message, aka client sent request, waits for our reply
187
+ // this is a request message, aka client sent request and waits for our mandatory reply
187
188
let aa = ( a as m . RequestMessage )
188
189
if ( ! initialized && aa . method !== 'initialize' ) {
189
190
let response : m . ResponseMessage = {
@@ -196,7 +197,7 @@ process.on('message', (a: (m.RequestMessage | m.NotificationMessage)) => {
196
197
} ;
197
198
process . send ! ( response ) ;
198
199
} else if ( aa . method === 'initialize' ) {
199
- // send the list of things we support
200
+ // send the list of features we support
200
201
let result : p . InitializeResult = {
201
202
capabilities : {
202
203
// TODO: incremental sync?
@@ -245,10 +246,10 @@ process.on('message', (a: (m.RequestMessage | m.NotificationMessage)) => {
245
246
}
246
247
} else if ( aa . method === p . DocumentFormattingRequest . method ) {
247
248
// technically, a formatting failure should reply with the error. Sadly
248
- // the LSP alert box for these error replies suck (e.g. don 't actually
249
+ // the LSP alert box for these error replies sucks (e.g. doesn 't actually
249
250
// display the message). In order to signal the client to display a proper
250
251
// alert box (sometime with actionable buttons), we need to first send
251
- // back a fake success message (because reach request mandates a
252
+ // back a fake success message (because each request mandates a
252
253
// response), then right away send a server notification to display a
253
254
// nicer alert. Ugh.
254
255
let fakeSuccessResponse : m . ResponseMessage = {
0 commit comments