@@ -760,15 +760,22 @@ endfunction
760
760
761
761
function ! s: on_request (server_name, id, request) abort
762
762
call lsp#log_verbose (' <---' , a: id , a: request )
763
+
764
+ let l: stream_data = { ' server' : a: server_name , ' request' : a: request }
765
+ call s: Stream (1 , l: stream_data ) " notify stream before callbacks
766
+
763
767
if a: request [' method' ] == # ' workspace/applyEdit'
764
768
call lsp#utils#workspace_edit#apply_workspace_edit (a: request [' params' ][' edit' ])
765
769
call s: send_response (a: server_name , { ' id' : a: request [' id' ], ' result' : { ' applied' : v: true } })
766
770
elseif a: request [' method' ] == # ' workspace/configuration'
767
771
let l: response_items = map (a: request [' params' ][' items' ], { key , val - > lsp#utils#workspace_config#get_value (a: server_name , val) })
768
772
call s: send_response (a: server_name , { ' id' : a: request [' id' ], ' result' : l: response_items })
769
773
else
770
- " Error returned according to json-rpc specification.
771
- call s: send_response (a: server_name , { ' id' : a: request [' id' ], ' error' : { ' code' : -32601 , ' message' : ' Method not found' } })
774
+ " TODO: for now comment this out until we figure out a better solution.
775
+ " We need to comment this out so that others outside of vim-lsp can
776
+ " hook into the stream and provide their own response.
777
+ " " Error returned according to json-rpc specification.
778
+ " call s:send_response(a:server_name, { 'id': a:request['id'], 'error': { 'code': -32601, 'message': 'Method not found' } })
772
779
endif
773
780
endfunction
774
781
0 commit comments