Skip to content

Handlers should run in a custom monad that doesn't expose stuff that people shouldn't use #4057

Open
@michaelpj

Description

@michaelpj

Today our handlers have access to all of LspM, which lets them:

  • Access the VFS and the configuration
    • This is incorrect - plugin handlers should be accessing the snapshots of these that we have in the shake graph
  • Send arbitrary messages
    • This makes things harder to test, we can't just look at the handler return value to see the main thing that the handler "does"

We should probably run in a custom monad that is a wrapper around LspM that restricts some stuff, and maybe also change our handler types to mostly return their results.

Metadata

Metadata

Assignees

No one assigned

    Labels

    HackathonThis issue is suitable for hackathon sessionslevel: easyThe issue is suited for beginnerstype: enhancementNew feature or request

    Type

    No type

    Projects

    Status

    In Progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions