haskell / haskell/haskell-language-server

Syntax highlighting in doctest comments?

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

Description

I've been using the Eval Plugin of HLS, which provides us with a pleasant alternative for REPL.
That plugin provides a way to evaluate (or execute some simple ghci-like commands such as `type`) codes in doctest style comment: `-- >>>`.
The result is appended as line comments right after the doctest comments.

In some situation, both of the inputs and outputs of doctest comments can be relatively long.
I think it might be useful if VSCode also highlights the contents inside the doctest comments and comments that immediately follow.

In short: currently, we have the following:

![スクリーンショット 2020-09-20 0 15 20](https://user-images.githubusercontent.com/21860/93670448-64d75380-fad6-11ea-9e38-949fa7dfb4bf.png)

And it might be good if this becomes (with a less bright colour than in the standard code block):

![スクリーンショット 2020-09-20 0 15 20-high](https://user-images.githubusercontent.com/21860/93670520-f47d0200-fad6-11ea-9563-581808644228.png)

If I understand correctly, there is a VSCode API to change text-decorations dynamically.
Or, perhaps this should be resolved upstream, i.e. might be reported to [JustusAdam/language-haskell](https://github.com/JustusAdam/language-haskell)?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by checking how HLS and the JustusAdam/language-haskell extension currently tokenize or decorate Haskell doctest comments, and review the VSCode text-decoration API mentioned in the issue. Determine whether the change belongs in HLS or upstream, then verify that doctest inputs and immediately following output comments receive subdued syntax highlighting.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell, vscode
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.