Skip to content

Implement a (currently useless) LSP server#2

Merged
hsnavihS merged 3 commits into
mainfrom
feat/lsp
Apr 30, 2025
Merged

Implement a (currently useless) LSP server#2
hsnavihS merged 3 commits into
mainfrom
feat/lsp

Conversation

@hsnavihS
Copy link
Copy Markdown
Owner

No description provided.

- Spent around an hour being annoyed because the changes I was making
  were not working. Turns out I was building Koala the whole time, not
  the LSP. It seems like I basically have the LSP as a static package
  right now, need to find out a better way of building it.
- Fixed some issues with logging, now I'm actually able to see whatever
  I'm writing to the file. I think it wasn't working earlier because I
  wasn't flushing the stream, but I'm not really sure.
- Exit actually works now, instead of running forever and hogging up
  memory the server now shuts down gracefully.
The framework is in place now, I think the work on this "feature" as a
whole is done. The next step now would be to integrate the LSP with the
interpreter itself and make changes so that it can actually provide
meaningful language features.
@hsnavihS hsnavihS requested a review from Copilot April 30, 2025 09:48
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

A basic LSP server implementation is introduced with minimal support for JSON parsing, request dispatching, and logging.

  • Implements a Scanner to parse incoming messages via JSON.
  • Adds a RequestHandler to dispatch and handle various LSP methods (initialize, shutdown, hover).
  • Provides a Responder and Logger for constructing responses and logging events.

Reviewed Changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
lsp/src/Scanner.cpp Implements JSON parsing and message extraction for LSP requests.
lsp/src/Responder.cpp Provides methods to send responses; missing notification support.
lsp/src/RequestHandler.cpp Implements dispatching of LSP messages including initialize and hover.
lsp/src/Logger.cpp Defines a simple logging mechanism with file-based logging.
lsp/main.cpp Sets up and loops the LSP server handling basic request flow.
lsp/include/types/LspMessage.hpp Declares the LspMessage structure used throughout the server.
lsp/include/Scanner.hpp Declares the Scanner class.
lsp/include/Responder.hpp Declares the Responder class with missing sendNotification method.
lsp/include/RequestHandler.hpp Declares the RequestHandler class with LSP method dispatching.
lsp/include/Logger.hpp Declares the Logger class.
Files not reviewed (1)
  • lsp/CMakeLists.txt: Language not supported
Comments suppressed due to low confidence (1)

lsp/include/Responder.hpp:16

  • The declared sendNotification method lacks an implementation in Responder.cpp. Please add its definition or remove the declaration if it's not needed.
void sendNotification(const string &method, const json &params);

Comment thread lsp/src/Scanner.cpp
@hsnavihS hsnavihS merged commit c1be033 into main Apr 30, 2025
2 checks passed
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

Successfully merging this pull request may close these issues.

2 participants