Conversation
- 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.
There was a problem hiding this comment.
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 ¶ms);
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.