haskell / haskell-language-server

Official haskell ide support via language server (LSP). Successor of ghcide & haskell-ide-engine.
Apache License 2.0
2.62k stars 353 forks source link

Feature request: Multiline input for eval plugin #1817

Open septatrix opened 3 years ago

septatrix commented 3 years ago

I have tried to get multiline inputs working for the eval plugin however to no avail. What I would like is support for the following syntax:

>>> tree = :{ Node 9 [
>>>     Leaf 5,
>>>     Leaft 12
>>> ] :}
-- or
>>> :set +m
>>> tree = Node 9 [
>>>     Leaf 5,
>>>     Leaft 12
>>> ]

However this always results in an exception like parse error on input ‘:’ and parse error (possibly incorrect indentation or mismatched brackets) respectively.

merc1031 commented 1 year ago

with HLS 1.5.1 i see a similar issue

>>> :{
 let a = 1
 in a
 :}

gets replaced with

>>> :{
unknown command '{'

when evaluated

same with the example from the doc https://hackage.haskell.org/package/hls-eval-plugin-1.2.0.2

>>> :{
  let
    x = 1
    y = 2
  in x + y + multiline
 :}

is replaced with

>>> :{
unknown command '{'