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

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

Open
michaelpj opened this issue Feb 7, 2024 · 1 comment
Labels
Hackathon This issue is suitable for hackathon sessions level: easy The issue is suited for beginners type: enhancement New feature or request

Comments

@michaelpj
Copy link
Collaborator

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.

@michaelpj michaelpj added the type: enhancement New feature or request label Feb 7, 2024
@michaelpj michaelpj added level: easy The issue is suited for beginners Hackathon This issue is suitable for hackathon sessions labels May 1, 2024
@awjchen
Copy link
Contributor

awjchen commented Jun 8, 2024

I'd like to work on this!

awjchen added a commit to awjchen/haskell-language-server that referenced this issue Jun 9, 2024
awjchen added a commit to awjchen/haskell-language-server that referenced this issue Jun 9, 2024
michaelpj pushed a commit that referenced this issue Jun 10, 2024
* Use restricted monad for plugins (#4057)

* Renaming: PluginM -> HandlerM

* Explain intent for HandlerM

* Fix comment

* Apply stylish-haskell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Hackathon This issue is suitable for hackathon sessions level: easy The issue is suited for beginners type: enhancement New feature or request
Projects
Status: In Progress
Development

No branches or pull requests

2 participants