@@ -109,7 +109,7 @@ func (p *ProgressProxyHandler) handleProxy(id string, proxy *progressProxy) {
109
109
110
110
proxy .reportReq = nil
111
111
if err != nil {
112
- log .Printf ("ProgressHandler: error sending begin req token %s: %v" , id , err )
112
+ log .Printf ("ProgressHandler: error sending report req token %s: %v" , id , err )
113
113
} else {
114
114
proxy .requiredStatus = progressProxyBegin
115
115
}
@@ -122,7 +122,7 @@ func (p *ProgressProxyHandler) handleProxy(id string, proxy *progressProxy) {
122
122
123
123
proxy .endReq = nil
124
124
if err != nil {
125
- log .Printf ("ProgressHandler: error sending begin req token %s: %v" , id , err )
125
+ log .Printf ("ProgressHandler: error sending end req token %s: %v" , id , err )
126
126
} else {
127
127
proxy .currentStatus = progressProxyEnd
128
128
}
@@ -196,3 +196,27 @@ func (p *ProgressProxyHandler) End(id string, req *lsp.WorkDoneProgressEnd) {
196
196
proxy .requiredStatus = progressProxyEnd
197
197
p .actionRequiredCond .Broadcast ()
198
198
}
199
+
200
+ func (p * ProgressProxyHandler ) Shutdown () {
201
+ p .mux .Lock ()
202
+ defer p .mux .Unlock ()
203
+
204
+ for id , proxy := range p .proxies {
205
+ err := p .conn .Progress (& lsp.ProgressParams {
206
+ Token : lsp .EncodeMessage (id ),
207
+ Value : lsp .EncodeMessage (& lsp.WorkDoneProgressEnd {
208
+ Message : "Shutdown" ,
209
+ }),
210
+ })
211
+
212
+ proxy .endReq = nil
213
+ if err != nil {
214
+ log .Printf ("ProgressHandler: error sending end req token %s: %v" , id , err )
215
+ } else {
216
+ proxy .currentStatus = progressProxyEnd
217
+ proxy .requiredStatus = progressProxyEnd
218
+ }
219
+ }
220
+
221
+ p .actionRequiredCond .Broadcast ()
222
+ }
0 commit comments