Skip to content
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

improve send selection #1723

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

improve send selection #1723

wants to merge 1 commit into from

Conversation

yuuuxt
Copy link

@yuuuxt yuuuxt commented Jun 14, 2022

Thanks for creating this extension!

I want fsi:send selection to send the complete lines selected, instead of selection only. It's easy to have an incomplete selection (e.g. omitting o of first-line open System) using mouse. So I made this naive PR.

Now we can just briefly select the lines (don't need to be complete) to send the complete lines.

It works like this:
temp

@jasiozet
Copy link

jasiozet commented Jul 3, 2022

I think that the idea of improving selection is a great one, but worth noting that with this Ionide looses a feature of selecting something mid line and evaluating it. I'm not sure if it is a big deal.

functionWithTwoArguments (anotherFunction arg) (anotherFunction2 arg2)
I could imagine that I want to select one of the parens and evaluate the middle, with that change it would always evaluate the whole line.

My idea of solving this problem, that I want to explore is to provide a shortcut for evaluating paragraphs.

let s = 0

let a = 1 // middle
let b = 1 // section
printfn "%d" <| a + b // middle section

let c = 1

Placing a cursor anywhere in the middle section (commented) and evaluating would send the:

let a = 1
let b = 1
printfn "%d" <| a + b

To REPL

@yuuuxt
Copy link
Author

yuuuxt commented Jul 5, 2022

@jasiozet Yes, it is better to have a new shortcut to behave like this and keep the original one unchanged.

For me the original behavior is not useful and modifying it makes minimal effort, so I did it like this and started using it.

Your execute-paragraph idea is one more step further :)

I also created #1728, maybe we can let discussions happen there?

@Krzysztof-Cieslak Krzysztof-Cieslak marked this pull request as draft July 12, 2022 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants