haskell / haskell/haskell-language-server

Support "Run function" inline hints

Open
#3,357 0 comments 3 reactions 0 assignees View on GitHub
type: enhancement
Dominant language
Haskell
Stars
3k
Forks
455
Avg merge
3d 21h
Merged PRs (30d)
13

Description

In major languages' IDEs, there will often be support for inline actions that allow running a main function. For example, Scala has the following action:

![](https://i.imgur.com/5nTnrcS.png)

If we notice that a function is `IO ()`, then we could surely run it I imagine? I'm not sure who wrote the eval plugin, but this would be right up their alley!

-----------

A potential extension to this was discussed on discourse: https://discourse.haskell.org/t/hf-coordination-for-test-framework-ide-integration/5221/2?u=santiweight

One can imagine supporting some of the following use cases:
- Support running TestTree's and the like from `tasty` or `hspec`
- One could imagine supporting a code action that generates some random data for a function. For example, if we have a function `foo :: Int -> Bool -> Int`, we could provide a few random arguments and show the user what happens...

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the eval plugin mentioned in the issue and reviewing how it evaluates Haskell expressions. Read the linked Discourse discussion for the proposed test-framework integration and clarify the initial scope, such as detecting IO () functions and exposing a Run function inline action. Done means the supported action is defined, implemented, and verified for the chosen use case.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.