Skip to content

Conversation

@tonythetender
Copy link
Contributor

@tonythetender tonythetender commented Dec 1, 2025

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.

tonythetender and others added 30 commits November 27, 2025 07:48
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]>
Copy link
Collaborator

@lukewilliamboswell lukewilliamboswell left a 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

@tonythetender
Copy link
Contributor Author

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 Server.zig file wasn't even supposed to be there in the first place. I accidentally added it during a commit at some point. Now I just completely removed it

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