File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,20 +7,18 @@ local lsp_handlers = {
77
88local handlers = {
99 [" PanelSolution" ] = function (_ , result , _ , config )
10- if result then
11- for _ , callback in pairs (config .callbacks ) do
12- callback (result )
13- end
14- end
10+ if not result then return " err" end
11+ if result .panelId then config .callbacks [result .panelId ](result )
12+ else for _ , callback in pairs (config .callbacks ) do callback () end end
1513 end ,
14+
1615 [" PanelSolutionsDone" ] = function (_ , _ , _ , config )
1716 for _ , callback in pairs (config .callbacks ) do
1817 callback ()
1918 end
2019 end
2120}
2221
23- -- require name so not confusing
2422lsp_handlers .add_handler_callback = function (handler , fn_name , fn )
2523 lsp_handlers .callbacks [handler ][fn_name ] = fn
2624 vim .lsp .handlers [handler ] = vim .lsp .with (handlers [handler ], {
@@ -35,4 +33,10 @@ lsp_handlers.remove_handler_callback = function (handler, fn_name)
3533 })
3634end
3735
36+ lsp_handlers .remove_all_name = function (fn_name )
37+ for handler , _ in pairs (lsp_handlers .callbacks ) do
38+ lsp_handlers .remove_handler_callback (handler , fn_name )
39+ end
40+ end
41+
3842return lsp_handlers
You can’t perform that action at this time.
0 commit comments