Skip to content

Normalize leading spaces before sending to FSI #101

@MrLuje

Description

@MrLuje

Is your feature request related to a problem? Please describe.
When sending line or selection to FSI, I'm often in the middle of a nested module/function like :

let solve data =
    printfn ""
    printfn "Solving %A" data
    let tmpSeq = seq { 1; 2; 3}
    tmpSeq |> Seq.sort

solve "test"

If I'm sending everything it's working fine, but if I'm only sending the last 2 lines of solve function

    let tmpSeq = seq { 1; 2; 3}
    tmpSeq |> Seq.sort

It will fail because of indentation which is expected from a compilation POV.

Describe the solution you'd like
Before sending lines to FSI, check if all lines have common leading spaces that can be removed.

Describe alternatives you've considered
Handling this directly in the keymap before calling Ionide functions

Additional context
I have a working branch if you'd like to try it

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions