Skip to content

Commit

Permalink
Fix code actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Russoul committed Dec 8, 2024
1 parent d0057e4 commit cf861b7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Server/ProcessMessage.idr
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,15 @@ handleRequest TextDocumentCodeAction params = whenActiveRequest $ \conf => do
(do quickfixActions <- if maybe True (CodeActionKind.QuickFix `elem`) params.context.only
then map Just <$> gets LSPConf quickfixes
else pure []
let fpath = uriPathToSystemPath params.textDocument.uri.path
setMainFile (Just fpath)
Right src <- coreLift $ File.ReadWrite.readFile fpath
| Left err => pure $ Left (MkResponseError RequestCancelled "Couldn't read the file source file" JNull)
setSource src
modIdent <- ctxtPathToNS fpath
mainttm <- getTTCFileName fpath "ttm"
[] <- catch ([] <$ readFromTTM mainttm) (\err => pure [err])
| _ => pure $ Left (MkResponseError RequestCancelled "Couldn't load TTM for the file" JNull)
exprSearchActions <- map Just <$> exprSearch params
splitAction <- caseSplit params
lemmaAction <- makeLemma params
Expand Down

0 comments on commit cf861b7

Please sign in to comment.