haskell / haskell/haskell-language-server

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

Open
#4,057 1 comment 0 reactions 0 assignees View on GitHub
Hackathon level: easy type: enhancement
Dominant language
Haskell
Stars
3k
Forks
455
Avg merge
4d 3h
Merged PRs (30d)
12

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.