Character/line limit when pasting in vscode terminal
Asked Answered
R

1

6

I have a problem when using Fsi in VSCode. I've been having this issue since 1.7 and it persists in the current releases of 1.8.

If I use alt + enter to send a code selection to VSCode it works, but only for short selections. When the selection is too long it doesn't do anything in the Fsi window.

I found the same problem when using Terminal as well as Fsi and pasting a portion of text.

I couldn't find a character or line limit. I have e.g. tried pasting 1415 characters on 38 lines and it works. 1416 on 38 lines doesn't work for one of my files. But when I paste 1568 characters of "a" it works, 1569 doesn't. So it's not necessarily a character limit. When I put in some line breaks this works:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

Add another a at the end and it doesn't (1534 characters, 35 lines).

It's really annoying, the only workaround I found is copying small parts of code into the Fsi individually and then executing them with ;;.

I'm on Windows 7, VSCode 1.8.1, ionide-fsharp 2.21.0, F# 4.0. Newlines count as 2 characters (\r\n).

Writing down these numbers, apparently with only a and newline we need characters + newlines < 1569. It doesn't hold for arbitrary other characters though.

Repeater answered 18/1, 2017 at 8:50 Comment(6)
This is a known problem with VSCode (Ionide) and FSI: see Issue 199, so I doubt you will get a solution here. Unless it is fixed.Morry
Thank you, I didn't find this in the issue list before. I was wondering if I was the only one.Repeater
it would also help if you could add VsCode, ionide-fsharp, and OS and F# versions. On win 10 with ioniode 2.2.1 I do not see this issue. But on win 7, with fairly similar setup I still encounter it.Morry
@Morry True, I added the information now. I think we can exclude F# and ionide-fsharp though. Because sending to cmd.exe has the same issue. It should be either VSCode or Windows.Repeater
I thought ionide handles the messaging into FSI. if you can repro something where non F# related stuff behaves the same way that would be a valuable comment to the above Issue on GitHub. I too would like to see this fixed.Morry
What I tried is copying code from the editor to FSI using ctrl+c ctrl+v. The same character limit applies as using the FSI messaging command. When I try this with the cmd.exe terminal integration I get the same character limit.Repeater
R
0

It is indeed not a bug in the Ionide plugin, but in the layers below. I found a workaround which is now available in ionide-vscode-fsharp 2.23.1.

https://github.com/ionide/ionide-vscode-fsharp/issues/199

Repeater answered 22/2, 2017 at 8:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.