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.

CodeMonkey
  • 4,067
  • 1
  • 31
  • 43
  • 1
    This is a known problem with VSCode (Ionide) and FSI: see [Issue 199](https://github.com/ionide/ionide-vscode-fsharp/issues/199), so I doubt you will get a solution here. Unless it is fixed. – s952163 Jan 26 '17 at 08:20
  • Thank you, I didn't find this in the issue list before. I was wondering if I was the only one. – CodeMonkey Jan 26 '17 at 08:28
  • 1
    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. – s952163 Jan 26 '17 at 08:38
  • 1
    @s952163 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. – CodeMonkey Jan 26 '17 at 12:32
  • 1
    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. – s952163 Jan 26 '17 at 13:08
  • 1
    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. – CodeMonkey Jan 26 '17 at 13:20

1 Answers1

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

CodeMonkey
  • 4,067
  • 1
  • 31
  • 43