Skip to content

Commit 5c2cab6

Browse files
Fix implementation of fallback handler for code action literals.
Note that (forM_ as $ \a -> {- pure code -}; return undefined) is a noop. We were unpacking the edit request, doing nothing with it, then throwing it away. Now we send a message to the client to actually perform the requested edit.
1 parent 030bf48 commit 5c2cab6

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

hls-plugin-api/src/Ide/Plugin.hs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,8 @@ makeExecuteCommands ecs lf ide = wrapUnhandledExceptions $ do
238238
-- Send off the workspace request if it has one
239239
forM_ mEdit $ \edit -> do
240240
let eParams = J.ApplyWorkspaceEditParams edit
241-
-- TODO: Use lspfuncs to send an applyedit message. Or change
242-
-- the API to allow a list of messages to be returned.
243-
return (Right J.Null, Just(J.WorkspaceApplyEdit, eParams))
241+
reqId <- LSP.getNextReqId lf
242+
LSP.sendFunc lf $ ReqApplyWorkspaceEdit $ RequestMessage "2.0" reqId WorkspaceApplyEdit eParams
244243

245244
case mCmd of
246245
-- If we have a command, continue to execute it

0 commit comments

Comments
 (0)