agda / agda-language-server

Language Server for Agda

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Expected functionality for non-VScode editors?

omentic opened this issue · comments

commented

Hey @banacorn! I saw in another comment somewhere that this language server operates mostly on extensions spoken by both it and agda-mode (which makes sense as to much of the trouble I was having getting it working before).

I was wondering: could what is done via custom methods and what is done via standards be written down and made explicit somewhere? It is hard for me to know exactly what to expect out of this language server at the moment (and thus if it's working).

Hey! Here is the handler of the server:

handlers :: Handlers (ServerM (LspM Config))
handlers =
mconcat
[ -- custom methods, not part of LSP
requestHandler (SCustomMethod "agda") $ \req responder -> do
let RequestMessage _ _i _ params = req
response <- Agda.sendCommand params
responder $ Right response,
-- hover provider
requestHandler STextDocumentHover $ \req responder -> do
let RequestMessage _ _ _ (HoverParams (TextDocumentIdentifier uri) pos _workDone) =
req
result <- Handler.onHover uri pos
responder $ Right result,
notificationHandler SInitialized $ \_not -> pure (),
notificationHandler STextDocumentDidOpen $ \_not -> pure (),
notificationHandler STextDocumentDidSave $ \_not -> pure (),
notificationHandler STextDocumentDidChange $ \_not -> pure (),
notificationHandler SCancelRequest $ \_not -> pure ()
-- -- syntax highlighting
-- , requestHandler STextD_cumentSemanticTokensFull $ \req responder -> do
-- result <- Handler.onHighlight (req ^. (params . textDocument . uri))
-- responder result
]

You can see that STextDocumentHover is the only "standard" method that is being handled at the moment. All the other functionalities are done via custom methods.