-
-
Notifications
You must be signed in to change notification settings - Fork 389
Missing newline when evaluate on last line #1213
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
Comments
There were some pr's about newlines in the eval plugin, f.e.: Maybe this is related with them? |
I can't reproduce this with |
@expipiplus1 many thanks for checking it |
Hmm that's interesting, I can still reproduce it using |
@tittoassini is perhaps a better person to look at this. |
The problem is that the Eval plugin will instruct the client to add the result in the line after the test. However, if the line does not exist, the client will attach it to the last line instead. For File: We say "put the result on line 3": {"jsonrpc":"2.0","params":{"edit":{"changes":{"file:///Users/titto/workspace/haskell-language-server/plugins/hls-eval-plugin/test/testdata/TLastLine.hs":[{"range":{"start":{"line":3,"character":0},"end":{"line":3,"character":0}},"newText":"-- [1,2,3,4,5]\n"}]}}},"method":"workspace/applyEdit","id":14} Clients says: "ok, there is no line 3 so it goes at the end of line 2!": {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"uri":"file:///Users/titto/workspace/haskell-language-server/plugins/hls-eval-plugin/test/testdata/TLastLine.hs","version":20},"contentChanges":[{"range":{"start":{"line":2,"character":19},"end":{"line":2,"character":19}},"rangeLength":0,"text":"-- [1,2,3,4,5]\n"}]}} |
Using
Evaluate
on-- >>> take 5 [0..]
produces
instead of
when
>>> take 5 [0..]
is on the last line of file. I believe that appending newline character on beginning ofEvaluate
's output instead of at the and will solve the issue.The text was updated successfully, but these errors were encountered: