Fsharp: Send to Interactive not bound to Alt+Enter in german VS2017

Created on 25 Feb 2017  Â·  38Comments  Â·  Source: dotnet/fsharp

I installed german VS2017 + master vsix.

Alt+Enter is not bound to "Interaktiv ausführen"

Area-IDE FSI Severity-High bug

Most helpful comment

Ok so you're saying vaskir is slacking and not responding to my alt+enter
commands? VASKIR! Wake up buddy.

Am 01.03.2017 10:10 nachm. schrieb "Gauthier Segay" <
[email protected]>:

FSharpEditorFactory is a place somewhere in Russia.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/Microsoft/visualfsharp/issues/2490#issuecomment-283471265,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AADgNKU5XUcuZqK2JYDb4ceykCqkMRJhks5rhd7dgaJpZM4ML_q_
.

All 38 comments

I confirm it does not bound in English either.

image

weird it shows as configured corrently after install, but doesn't work

or maybe it's because it's bound to "FSharpEditorFactory" - whatever that means

FSharpEditorFactory is a place somewhere in Russia.

Ok so you're saying vaskir is slacking and not responding to my alt+enter
commands? VASKIR! Wake up buddy.

Am 01.03.2017 10:10 nachm. schrieb "Gauthier Segay" <
[email protected]>:

FSharpEditorFactory is a place somewhere in Russia.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/Microsoft/visualfsharp/issues/2490#issuecomment-283471265,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AADgNKU5XUcuZqK2JYDb4ceykCqkMRJhks5rhd7dgaJpZM4ML_q_
.

I think @dungpa is the only person who touched commands handling. PHAN, we need you!

The FSharpEditorFactory is introduced in https://github.com/Microsoft/visualfsharp/pull/2029.
There is a relevant comment:

Note: This also requires a change to the Alt+Enter bindings in Visual Studio. So the fix won't be apparent until the next update to Visual Studio 2017 RC.

@JoshVarty Is this related? Has the mentioned Visual Studio change been available in any RC yet?

so there is a chance this magically works in RTM?

Alt+enter works for me with the RTM candidate on my desktop.

  1. open a .fsx file
  2. type in some code
  3. highlight and use alt+enter to send it to FSI works

Kevin

.

@vasily-kirichenko and @forki What versions of VS are you using? (In Help >About)

Did this command work for you recently and stop? Or has it simply not been working at all?

I re-enabled it some time ago, but I'm not sure how the F# changes have flowed through to VS.

@dungpa The Visual Studio changes I was talking about have been made available and were first distributed in RC3.

I'm on rc4. It always worked in VS 2015. It did not work in rc4 when I
first tried.

After binding manually to global workspace it worked.

Am 03.03.2017 3:43 vorm. schrieb "Josh Varty" notifications@github.com:

@vasily-kirichenko https://github.com/vasily-kirichenko and @forki
https://github.com/forki What versions of VS are you using? (In Help >
About)

Did this command work for you recently and stop? Or has it simply not been
working at all?

I re-enabled it some time ago, but I'm not sure how the F# changes have
flowed through to VS.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/Microsoft/visualfsharp/issues/2490#issuecomment-283849414,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AADgNMpRX9JSeSrAVwrM1rAPW8D8Exfwks5rh344gaJpZM4ML_q_
.

Strange, it works on my private laptop's installation of RC4...

Can you show me what exists in the drop down when you reset to default commands and press Alt+Enter in the shortcutkey box?

For example, here's mine:

image

image

^^ it's the same. Just translated.

In the "Shortcut currently used by:" dropdown as well? And in the same order?

image

mhm order looks reversed!?

(btw: I'm only using german in order to find more bugs - I would never do that during production times ;-) )

On second thought I was wrong about order being important (it's just alphabetical).

It looks like everything is registered correctly so I'm not sure what's wrong exactly. Tomorrow I'll let up a VM with German language and see if I can repro. Thanks for your help! :)

@JoshVarty it's not german language related. @vasily-kirichenko had the same in english

I think the issue is with FSharpEditorFactory being not configured in my build. @KevinRansom said his newer build works.

@vasily-kirichenko Do you use the English version of Windows as well?

@forki It's just concerning to me that my RC4 bits work and yours do not. I'll just run some sanity checks on fresh machines tomorrow.

It would be a shame if my only PR to the F# repo broke such a critical feature. 😩

English Windows here with English VS2017 RC4 and I can repro this.
That's on master OSS vsix. I'm reinstalling latest RC at the moment, I'll test that, too ...and it's the same.

Maybe naïve question, but looking at fsiCommands.vsct it seems someone tried to make it work with UIContexts:
https://github.com/Microsoft/visualfsharp/blob/389f04f326a55d58111f2ca1b627b8736c3f0561/vsintegration/src/FSharp.VS.FSI/fsiCommands.vsct#L196

There also seems to be an attempt to use custom UIContext. Custom guid defined here, that is never, nowhere used:
https://github.com/Microsoft/visualfsharp/blob/389f04f326a55d58111f2ca1b627b8736c3f0561/vsintegration/src/FSharp.VS.FSI/fsiCommands.vsct#L256

Wouldn't a rule based approach work reliably for us: Use Rule-based UI Context for Visual Studio Extensions ? Or is there some gotcha here?

That's certainly worth exploring. If the comment there is correct and it's not working then we should probably remove it entirely for the sake of clarity.

I'm in the process of setting of my VMs (one with RC4, one with RTW).

In the meantime @cartermp do the rules for installing RC3 also apply to RC4? Or were the changes integrated into VS in time for RC4?

@JoshVarty Nope, changes were integrated for RC4. No extra instructions necessary.

For 15.0.0-RC.4+26206.0 (Community) taken from public facing download Alt+Enter works.

For 15.0.0+26228.0 taken from internal RTW branch: Alt+Enter works.

Both were VS Community Installations with a .NET Workload with the F# language support option checked.

For people using VS 2017 seeing this bug: Was RC4 your first download of 2017? If not, could you try running devenv /Setup from Developer Command Prompt for VS 2017 RC?

It's kind of a shot in the dark, but since I edited the .pkgdef it's possible these changes haven't flowed through to your registry and the F# editor factory isn't being used to create your editors.

@forki You mentioned you installed the master VSIX. Did it work before this?

@majocha @vasily-kirichenko Did you guys also install the master VSIX? Or were you just using vanilla installations?

If anyone can repro this for me can you do the following:

  1. Open Visual Studio.
  2. Open or create a solution with F#.
  3. Open an F# document and try pressing Alt+Enter.
  4. Open a second instance of VisualStudio
  5. Choose Debug > Attach to Process and choose devenv.exe.
  6. Edit: Break All.
  7. Choose Debug > Save Dump As... (it's near the bottom)
  8. Save the dump and either make it available or send it to me at: [email protected]

I did not test before installing the master vsix.

Am 04.03.2017 12:57 vorm. schrieb "Josh Varty" notifications@github.com:

For 15.0.0-RC.4+26206.0 (Community) taken from public facing download
Alt+Enter works.

For 15.0.0+26228.0 taken from internal RTW branch: Alt+Enter works.

Both were VS Community Installations with a .NET Workload with the F#
language support option checked.

For people using VS 2017 seeing this bug: Was RC4 your first download of
2017? If not, could you try running "devenv /Setup from Developer Command
Prompt for VS 2017 RC?

It's kind of a shot in the dark, but since I edited the .pkgdef it's
possible these changes haven't flowed through to your registry and the F#
editor factory isn't being used to create your editors.

@forki https://github.com/forki You mentioned you installed the master
VSIX. Did it work before this?

@majocha https://github.com/majocha @vasily-kirichenko
https://github.com/vasily-kirichenko Did you guys also install the
master VSIX? Or were you just using vanilla installations?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/Microsoft/visualfsharp/issues/2490#issuecomment-284103648,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AADgNGK3uDCCadVpAsiTnMKQJWrobLYuks5riKjdgaJpZM4ML_q_
.

@JoshVarty I have this issue both on master and RC4 on different machines. I'm quite sure I fully reinstalled Visual Studio 2017 a few times since December.

A breakpoint placed in CreateEditorInstance is never hit when opening F# files in editor. Looks like FSharpEditorFactory is being constructed (constructor does get invoked) but is never used.
I have a suspicion it doesn't register properly for some reason. It shows up in keyboard settings (because MPF picks it up?) but is never used as EditorFactory for F#.

@JoshVarty "Save dump..." doesn't work for me. Disabled.

@majocha You'll need to invoke Debug->Break All in between. Attaching leaves the debuggee in a running state.

@JoshVarty MiniDump
Only in name. It's quite huge, unfortunately.

I can repro this with the following steps:

  1. Install RTM with F# tools
  2. Observe that Alt+Enter works
  3. Uninstall the F# tools with VSIXInstaller.exe /uninstall:VisualFSharp
  4. Install latest master .vsix from https://ci2.dot.net/job/Microsoft_visualfsharp/job/master/job/release_ci_part1_windows_nt/lastSuccessfulBuild/artifact/release/net40/bin/VisualFSharpOpenSource.vsix
  5. Observe that Alt+Enter no longer works.

Unfortunately, I'm having a ton of trouble building the F# repo, so it's going to take me some time to figure out exactly what's going wrong here.

I suspect it's something to do with an incorrect .pkgdef or something.

I think it's Editor.QuickActions binding hide our 'send to interactive. After removing it everything is ok. I suspect they addedAlt+Enter` for quick actions in RTW. I've no idea how to fight it.

The reason we had to introduce the FSharpEditorFactory was because of the Editor.QuickActions command, but that's not the root cause here.

The issue is that our command bound to the FSharpEditorFactory. But for some reason when you uninstall the main VSIX and re-install VisualFSharpOpenSource.vsix the FSharpEditorFactory is no longer being used to create our F# editors, the standard editor factory is. This means that our command isn't active.

It's going to take me at least another day (maybe more) to trace through the old msenv.dll and figure out what's going on.

In the meantime: Does anyone know the differences between the VisualFSharpFull.vsix (I confirmed this is what VS installs) and VisualFSharpOpenSource.vsix (What we recommend you install for latest master)?

I had a brief look but nothing stood out to me. (.pkgdef's were identical, .vsixmanifests looked normal).

@JoshVarty VisualFSharpFull.vsix is indeed what VS installs, and it's what we build internally for a release. VisualFSharpOpenSource.vsix is for OSS developers to install locally on their machines.

I'm still unsure why we need two different VSIXs and what the differences between them are.

I've made some progress.

When F# wants to open a file (eg. clicking an item in Solution Explorer) it calls IVsUIShellOpenDocument.OpenStandardEditor(). F# makes this call here and here.

One of the parameters here is rguidLogicalView which takes its value from the LogicalView enumeration.

  • When F# passes in Primary {00000000-0000-0000-0000-000000000000} the F# Editor Factory is chosen.
  • When F# passes in Text {7651A703-06E5-11D1-8EBD-00A0C90F26EA} the Source Code (Text) Editor Factory is chosen and Alt+Enter does not work.

I've confirmed that if I force the GUID to be Primary {00000000-0000-0000-0000-000000000000} then the F# Editor Factory is used and Alt+Enter works properly.

I believe the GUID is being chosen here:
https://github.com/Microsoft/visualfsharp/blob/e28fcd7a39c463b388a94d66a7e114580e669a6f/vsintegration/src/FSharp.ProjectSystem.FSharp/Project.fs#L2173 and was added in #2417.

@vasily-kirichenko ~What's the criteria for IsFormSubType?~ I see that we've changed to return the Text GUID. How's this relate to previewing and is it 100% necessary?

Great, that's a relief to have this fixed :)

Was this page helpful?
0 / 5 - 0 ratings