Skip to content

Replace parse_thread closure with a self-referential struct #33

@ratmice

Description

@ratmice

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions