-
-
Notifications
You must be signed in to change notification settings - Fork 283
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
error FS0193: Operation is not supported on this platform. #1859
Comments
I see this phenomenon, too. Linux Mint 20.3, VS Code 1.78.2, Ionide 7.5.4. The following code snippet, sent to an FSI terminal, works with dotnet 6.0.488 installed, but not with 7.0.302 or 8.0.100-preview.4.23260.5: (* ~\~ language=FSharp filename=src/dnlib-testbed.fsx *)
(* ~\~ begin <<lit/dnlib-testbed.md|src/dnlib-testbed.fsx>>[init] *)
#if INTERACTIVE
(* ~\~ begin <<lit/dnlib-testbed.md|import-nugets>>[init] *)
#r "nuget:Microsoft.CodeAnalysis.CSharp"
(* ~\~ end *)
(* ~\~ begin <<lit/dnlib-testbed.md|import-nugets>>[1] *)
#r "nuget:dnlib"
(* ~\~ end *)
(* ~\~ begin <<lit/dnlib-testbed.md|import-nugets>>[2] *)
#r "nuget:spkl.Diffs"
(* ~\~ end *)
(* ~\~ begin <<lit/dnlib-testbed.md|import-nugets>>[3] *)
#r "nuget:xunit"
#r "nuget:Unquote"
(* ~\~ end *)
#endif
(* ~\~ begin <<lit/dnlib-testbed.md|import-ms-codeanalysis>>[init] *)
open Microsoft.CodeAnalysis
open Microsoft.CodeAnalysis.CSharp
(* ~\~ end *)
(* ~\~ begin <<lit/dnlib-testbed.md|import-dnlib>>[init] *)
open dnlib.DotNet
open dnlib.DotNet.Emit
(* ~\~ end *)
(* ~\~ begin <<lit/dnlib-testbed.md|import-spkl-diffs>>[init] *)
open spkl.Diffs
(* ~\~ end *)
(* ~\~ begin <<lit/dnlib-testbed.md|import-dotnet>>[init] *)
open System
open System.IO
open System.Reflection
open System.Collections.Generic
open System.Text.RegularExpressions
(* ~\~ end *) It seems to be that it's really the block comments that make Ionide trip:
|
I had the same with // comments i think |
Does this happen only with NET7 and NET8? can someone else check this? i am on MacOS, is there any way to reproduce in tests if there is tests for comment sections? (comments parsed correctly in FSI by ionide) |
|
We don't have tests for the Ionide layer itself, but it is possible to test excursions to some degree. I'm not really familiar with it though. The 'send to FSI' interaction is really simplistic, it's possible that we may need to escape certain syntax when sending it via stdin for example. |
I have seen the phenomenon in different forms on several machines, and on some it doesn't work with dotnet 6.x either (especially if dotnet is installed via the Linux distribution's package manager system). I have actually set up a new development Linux machine, and the criterion was whether VS Code/Ionide/dotnet (7) "out of the box" do not exhibit the behavior. |
i get it also with this script in fsx when running portions with open System
type Message = string * AsyncReplyChannel<string>
let replyAgent =
MailboxProcessor<Message>.Start(fun inbox ->
let rec loop () =
async {
let! (message, replyChannel) = inbox.Receive()
replyChannel.Reply(String.Format("Received message: {0}", message))
do! loop ()
}
loop ())
replyAgent.PostAndReply(fun rc -> "Hello", rc)
macos net7 SDK lts
|
There are two issues about similar errors in the fsharp repo: |
I'm able to workaround this by adding the "FSharp.fsiExtraParameters": [
"--readline-"
], |
doesn't fully solve for me, the error is gone but in ionide still hangs with no completion, even after #quit;; and re-send to interactive with option/alt + enter |
Same issue for me when running on linux. It happens when the terminal
window is not large enough to fit the sent line.
If the line fits, it works fine. Usually I'm experiencing this issue when
casting my screen and zooming vscode. Not sure it´s an issue
inside ionide or if it's related to this one
microsoft/vscode#100225
…On Fri, Jan 19, 2024 at 10:53 AM jkone27 ***@***.***> wrote:
image.png (view on web)
<https://github.com/ionide/ionide-vscode-fsharp/assets/10419217/b3d18acd-6324-4f9c-a45f-890a79fb4d00>
still have this issue... does other people have this? I am on macOS and
dotnet 8 latest ionide v7.17.0
—
Reply to this email directly, view it on GitHub
<#1859 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAB35CSOSFIXC5H3NI2DJETYPI7B7AVCNFSM6AAAAAAWRKCB6KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMBQGA4DSNJWGA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
@Titaye that's really useful info! I had no idea the terminal pane could impact things to this degree. |
I can confirm that the size of the terminal can have this impact. I was actually seeing this behaviour without knowing it as I always resized my terminal when a line that I paste in it is too long and not interpreted correctly. |
It looks like there may be some API we can use to get the dimensions of the terminal: microsoft/vscode#67919 This might be usable to modify the message we send to make it usable by the terminal. |
I don't think we can easily reformat the code sent. Imagine we have this code: let x = DateTime(2014, 7, 1, 16, 37, 0, DateTimeKind.Utc).ToString("""r \\\zz""", CultureInfo.InvariantCulture)
^ and the terminal can accept up to the Perhaps, detecting the size of the terminal and generating a message box to explain that the terminal is too small or that the line at X is too long is possible solution if we can't reformat the line of code. |
in extreme cases we could ask fantomas to reformat it with a given maximum width, but yeah it's probably impossible to do correctly in the general case. starting to sound like something that we can't truly fix until/unless we move away from dotnet fsi usage directly and into managing a series of |
even comments on the screen cause this error (long comments), maybe ionide could have a self-fold option to enable or a tip for users when this message pops out, is very bad for newcomers i think. |
cc PR above should solve in all cases for long comments sections (sometimes happens in code), by ignoring comments send to FSI |
Describe the bug
I have a compiling script in F#
Steps to reproduce
not clear, but sometimes happens in interactive while running the code with ALT-ENTER, not able to reproduce consistently yet.
Link to sample reproduction
Expected behaviour
no errors as the code is valid F# code
Machine info
The text was updated successfully, but these errors were encountered: