Skip to content
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

chore: refactor LSP code for readability and dev ex #2969

Merged
merged 3 commits into from
Oct 3, 2023

Conversation

TomAFrench
Copy link
Member

@TomAFrench TomAFrench commented Oct 3, 2023

Description

Problem*

Groundwork for #2941

Summary*

There's two issues with the LSP as it currently stands:

  1. Most of the code resides in a single file whilst the logic is very amenable to breaking it down into components.
  2. The usage of futures has been allowed to infect all levels of the LSP logic. This makes it difficult to use nice language features such as Result and ? due to the need to wrap the result in a future.

This PR tackles these issues by creating new modules for code lenses which are responsible for serving these requests. Now that they're isolated, we could have an "inner" implementation which is synchronous and only have futures on a facade which is called by the LSP router.

Documentation

  • This PR requires documentation updates when merged.

    • I will submit a noir-lang/docs PR.
    • I will request for and support Dev Rel's help in documenting this PR.

Additional Context

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

@kevaundray
Copy link
Contributor

Very much a fan of having synchronous "inner" code which is easy to test and diagnose and then having async on top

@kevaundray kevaundray added this pull request to the merge queue Oct 3, 2023
Merged via the queue into master with commit d7b439b Oct 3, 2023
29 checks passed
@kevaundray kevaundray deleted the tf/lsp_refactor branch October 3, 2023 19:41
TomAFrench added a commit that referenced this pull request Oct 3, 2023
* master:
  feat(wasm)!: update wasm artifacts to match cli artifacts (#2973)
  chore: Update ACIR artifacts (#2971)
  chore: refactor LSP code for readability and dev ex (#2969)
Sakapoi pushed a commit to Sakapoi/noir_fork that referenced this pull request Oct 19, 2023
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