-
Notifications
You must be signed in to change notification settings - Fork 62
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
feat: architecture and lsp features #128
Merged
Merged
Conversation
This file contains 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.
This pr is a rewrite of the project and implements the base architecture for the language server, its data model as well as a few proof-of-concepts for different language server features:
The goal of this work was to prove that implementing a language server on top off the rather hacky parser is doable, and that is now completed. Still, we have not reached a usable state yet, because
Besides that, there are other areas I want to improve the code in before declaring this language server usable.
Workspace
struct is handling just everything that is stored eg diagnostics. all queries (e.g. hover) are currently implemented directly within the language server. I want all features to be handled in the workspace crate to make it easier to use from a future cli and also easier to write e2e tests. I am targeting a design similar to biome, where both lsp and cli act as a client to the same daemon server. this will also make it much easier to test everything e2e.this pull request is huge, and I dont expect anyone to look through the entirety of it. areas that are worth a review though are:
server.rs
inpg_lsp
, especially everything around debouncing and change handling (did_open
,did_change
). my goal with this was to debounce the "heavy" computation after a change while computing directly when the user saves the file.pg_base_db
andpg_workspace
, especially everything around change handling. the idea here is to cut a source file into individual statements and only recompute what actually changed. so if the user types within a statement, we only compute diagnostics etc for that single statement. I am pretty confident that this works well, but would like to hear someone's opinion on the way its handled especially around multi-threading, usage ofDashMap
etcToDos before merging