-
-
Notifications
You must be signed in to change notification settings - Fork 359
Add simple syntax diagnostics to LSP #8530
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
base: main
Are you sure you want to change the base?
Conversation
Currently using a StringHashMap to store the different project documents. Might investigate into doing some caching later down the line.
Add the document store to the Server struct. Also separate the handlers into request and notifications as their data structure and expected response differ.
In order to remove the need to modify `initialize.zig` and `protocol.zig` whenever a new version or new server capabilities is implemented, version was moved to the Server struct and capabilities to a separate file.
Document store now supports incremental change of files which mean it's possible to change a part of the file without inserting the whole file each time.
Currently just stores opened buffer into a StringHashMap which will allow parsing them later on.
The text document sync type was being sent as a string instead of its integer equivalent.
Allows using a BuildEnv and PackageEnv that works with files not on the filesystem. This allows using the files in a buffer which have been edited but not save to disk. This is necessary for allows syntax warning and errors onChange instead of only onSave
Allows more granular debugging when a lot of outputs are made.
Signed-off-by: Etienne Latendresse-Tremblay <[email protected]>
Signed-off-by: Etienne Latendresse-Tremblay <[email protected]>
Signed-off-by: Etienne Latendresse-Tremblay <[email protected]>
Signed-off-by: Etienne Latendresse-Tremblay <[email protected]>
lukewilliamboswell
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just noticed Server.zig sitting at the root. This isn't a good spot for this -- one thing it trigger the old CI workflow which isn't what we want.
Can it live in the src/lsp/ module? why is it separate. I am just running out for some errands, otherwise I'd look further into this myself today. @tonythetender
Actually the |
Integrate the BuildEnv and the PackageEnv to provide immediate diagnostics when editing a file using the same logic as the compiler. For now mostly check for valid syntax and types, but not as much for the existence of function names and variable.
The current implementation is not perfectly stable and might need to be reset on a few rare occasions, but it should still work fine in a lot of cases.
Trying to get something out right now for AoC, but will update throughout the month, mostly focusing on bug fixes and stability before adding new features.
Modifications to compile_build and compile_package were needed because the build system relies on files written on disk, but the modifications in an editor are done in a buffer. A new file provider can then be passed to those environment allowing the use of files in memory in the build system. The default behavior was unaltered.