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

Replace parse_thread closure with a self-referential struct #33

Open
ratmice opened this issue Feb 27, 2023 · 0 comments
Open

Replace parse_thread closure with a self-referential struct #33

ratmice opened this issue Feb 27, 2023 · 0 comments

Comments

@ratmice
Copy link
Owner

ratmice commented Feb 27, 2023

Currently we have a closure which references data which the closure owns (parse_thread.rs:init()). Which is the extent we can do within safe rust. Limitations are that we cannot implement traits for a closure since the type of closures are not nameable.
This isn't currently an issue since the trait we would want to implement (tower_lsp's LanguageServer) requires various bounds beyond those we can supply. Thus currently we spawn a thread for this closure and implement LanguageServer over types with channels and move some endpoints into the closure.

Once the work mentioned in ebkalderon/tower-lsp#284 is in a state which it can be tested, try replacing the closure with a self referential struct probably using ouroboros. This could in theory cleanup quite a lot of indirection through channels for both input/output through the parse thread. If we can manage to implement the new trait bound requirements discussed there.

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

No branches or pull requests

1 participant