Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expected functionality for non-VScode editors? #25

Open
omentic opened this issue Dec 19, 2023 · 1 comment
Open

Expected functionality for non-VScode editors? #25

omentic opened this issue Dec 19, 2023 · 1 comment

Comments

@omentic
Copy link

omentic commented Dec 19, 2023

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).

@banacorn
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants