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

[Enhancement] Info Panel: Only auto-popup when an F#-type file is opened. #1176

Closed
baronfel opened this issue Jul 11, 2019 · 15 comments
Closed
Labels
enhancement Accepted suggestions that makes existing features better up for grabs Good first issues

Comments

@baronfel
Copy link
Contributor

Is your feature request related to a problem? Please describe.
When I open my work repository and I was last working on yaml/bash/any non-F# file, the Info Panel pops up. When I'm working with F# files I want this behavior, but for non-F# coding tasks I don't want it right away.

Describe the solution you'd like
I'd like if the Info Panel wasn't popped-up automatically until the first F# file was opened. This would keep the Info Panel relevant while minimizing the number of times it's present and not immediately useful, I think. Imagine the case where you open a yaml file first: the info panel is present and completely blank, obscuring parts of your screen. Now imagine a world where you work in yaml unobstructed until you go to some F# code and BAM your beloved Info Panel is right there with you, helping you along your coding journey.

Describe alternatives you've considered
Closing the Info Panel all the time. This hurts because it's like I'm saying goodbye to a close friend.

@open-collective-bot
Copy link

Hey @baronfel 👋,

Thank you for opening an issue. We will get back to you as
soon as we can. Also, check out our OpenCollective and consider
backing us.

https://opencollective.com/ionide

PS.: We offer backer support for all backers. Don't forget to add backer label when you start backing us 😄

@Krzysztof-Cieslak Krzysztof-Cieslak added the enhancement Accepted suggestions that makes existing features better label Jul 11, 2019
@Krzysztof-Cieslak
Copy link
Member

Makes sense, should be fairly easy to do - in the place where we make InfoPanel visible during plugin startup we can check current list of opened documents and check if any is F# file.

@Krzysztof-Cieslak Krzysztof-Cieslak added the up for grabs Good first issues label Jul 11, 2019
@teo-tsirpanis
Copy link
Contributor

Another option is to never auto-popup, or even better, to configure its behavior through the settings.

@MangelMaxime
Copy link
Contributor

Another option is to never auto-popup, or even better, to configure its behavior through the settings.

You can already configure it's behaviour via the settings:

Capture d’écran 2019-07-15 à 12 18 34

@teo-tsirpanis
Copy link
Contributor

teo-tsirpanis commented Jul 15, 2019 via email

@MangelMaxime
Copy link
Contributor

You are confusing the F# solution explorer (on the left) and the Info Panel (on the right).

Capture d’écran 2019-07-15 à 12 45 12

If you don't want to show "F# Solution explorer" on start up you can use:

Capture d’écran 2019-07-15 à 12 49 17

@teo-tsirpanis
Copy link
Contributor

OK. Thanks.

@ZaymonFC
Copy link
Contributor

Is this issue still open?

@wilsoncg
Copy link
Contributor

I too have noticed this. I open up a csharp project, and within a few seconds the F# solution explorer & InfoPanel appear all proud as punch, only to steal my screen real estate and then tell me csproj is not a supported language. 🙄

If you close the info panel and right click -> hide the F# solution explorer, close & re-open vscode csproj solution, this makes no difference as they both popup again.

fsharp-sln-explorer-look-at-me

Looking at the vscode docs I notice this key piece of information under Extension Host:

For example, the Markdown extension should only be loaded when a user opens a Markdown file. This makes sure that extensions do not consume unnecessary CPU and memory.

Under Activation Events:

This activation event is emitted and interested extensions will be activated whenever a file that resolves to a certain language gets opened.
The onLanguage event takes a language identifier value.

@Krzysztof-Cieslak would using the onLanguage activation event be a better approach for initialising the info panel & solution explorer? Could also do away with the info panel on startup setting as it would then be redudant.

I'd be happy to try submitting a PR if you can sort of point me in the right direction, is it something in the activate() function in InfoPanel.fs?

@baronfel
Copy link
Contributor Author

For reference, @wilsoncg, the current set of activation events that we use are located here. We're already using the fsharp language identifier, which is not the problem here. We don't want to change these because we want Ionide to be running before you need it and these do a good job for this.

I believe the fix as @Krzysztof-Cieslak was suggesting is to expand the condition here to check if window.visibleTextEditors contains any F#-related files before opening. So that condition would become something like:

if show && window.visibleTextEditors |> Seq.exists isFsharpTextEditor 
then openPanel () |> ignore
else ()

@wilsoncg
Copy link
Contributor

Interesting @baronfel. I'm still slightly confused, as vscode has correctly detected my project is C# but then ionide has ignored that & forcefully loaded anyway. That looks to me like ionide is not correctly using the language identifier activation.

For example as a contrast, the docker extension looks to load on demand. The F# solution explorer is loading for C# projects, & grabbing focus, should it not load on demand instead? Surely it's un-necessary to do any loading for a C# project?

@baronfel
Copy link
Contributor Author

The part I think you're overlooking is that solution files are part of our activation events as well. There are many different activation events described in the links I sent you, and it's this one that is causing the overlap on c# projects. You'll note that omnisharp for example has the same activation event, loading whenever an F# only solutions load, so you have the same problem.

@wilsoncg
Copy link
Contributor

Ah right, got it, thanks for the info.

@baronfel
Copy link
Contributor Author

personally, I have things set up to fold the solution explorer into the outline pane instead of a separate pane, which seems to do a good job of preventing that pop-out you speak of. I think that coupled with the code change above on the info panel would go a long way to handling your concerns.

@Krzysztof-Cieslak
Copy link
Member

Fixed by #1438

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Accepted suggestions that makes existing features better up for grabs Good first issues
Development

No branches or pull requests

6 participants