Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Readme.txt popup prevents visual studio from finishing loading #144

Closed
speige opened this Issue Feb 23, 2014 · 13 comments

Comments

Projects
None yet
2 participants
Contributor

speige commented Feb 23, 2014

When first-run after installation, a prompt asks the user if they would like to view the readme.txt file. It sometimes shows up in the background, so the user may not notice it. Until the respond, visual studio loading is paused.

One possible solution might be to move the "would you like to view vsClojure Readme.txt" prompt to a separate thread. Will a background thread allow UI?

Another option could be to create a vsClojure menu in the toolbar with an about section.

@speige speige added this to the Version 2.2 milestone Feb 23, 2014

Contributor

frankhale commented Feb 24, 2014

Why not just open the README in Visual Studio after installation and not ask the user? This is done with some nuget packages. It's just a one time thing so I don't see a big problem with it.

@speige speige closed this in 92a7ae3 Feb 24, 2014

Contributor

speige commented Feb 24, 2014

Good idea. I like that.

Contributor

frankhale commented Feb 25, 2014

Perhaps we can reopen this and instead of spawning a notepad.exe process load the README inside of Visual Studio instead. I've started looking for an example of how to open a file within VS using the API and I came across this:

http://stackoverflow.com/questions/350323/open-a-file-in-visual-studio-at-a-specific-line-number

Scroll down and there are some C# examples. I have not tried any of these but I thought I'd post this here for the record and to lubricate the idea gears a bit.

@speige speige reopened this Feb 25, 2014

Contributor

speige commented Feb 25, 2014

Sure. I'm fine with this.

Contributor

frankhale commented Mar 3, 2014

I'm working on this today.

Contributor

frankhale commented Mar 3, 2014

I think the name of this function is problematic:

ClojurePackage.cs

EnableSettingOfRuntimePathForNewClojureProjects

The setting it's talking about only happens if it's the first install.

I've renamed it to:

EnableSettingOfRuntimePathForNewClojureProjectsOnFirstInstall

And moved it to the delayedStartup thread in order to make sure VS is initialized fully so it can also open up the README within Visual Studio on first install.

Contributor

frankhale commented Mar 3, 2014

I've commited my change to my fork of vsClojure in a branch called myBranch (LOL!)

https://github.com/frankhale/vsClojure/commit/222970bb31923ff6eb3dbdc94dc799e067ffb01d

Contributor

frankhale commented Mar 3, 2014

Basically this is all that is needed:

var dte = (DTE2) GetService(typeof(DTE));
dte.MainWindow.Activate(); // This may not be needed, need to test without!
dte.ItemOperations.OpenFile(pathToReadme, EnvDTE.Constants.vsViewKindTextView);
Contributor

speige commented Mar 3, 2014

The function does also set an environment variable on first install. That variable is used in 3 places, I think: MSBuild, Metadata.clj intellisense, & loading the REPL.

You'll want to test any changes you make to the order of that delayed startup. I fought with that a lot in the last release. It was the cause of visual studio not loading clojure correctly when opening .sln files directly from windows explorer.

Contributor

frankhale commented Mar 3, 2014

All seems well but I did have to call UnzipRuntimes after the runtime path function being called

These two calls are now in the delayedStartup thread call:

EnableSettingOfRuntimePathForNewClojureProjectsOnFirstInstall();
UnzipRuntimes();
Contributor

frankhale commented Mar 8, 2014

I'm going to close this for now. I've committed the code to the repo that opens the README on first install inside Visual Studio. If there are any problems we can reopen.

@frankhale frankhale closed this Mar 8, 2014

Contributor

speige commented Mar 8, 2014

Thanks for doing this!

Contributor

frankhale commented Mar 8, 2014

No problem. What I've done here seems to work for me on several installs.
Hopefully it'll be fine but if not, no worries, I can come back and look at
it again if need be.

On Fri, Mar 7, 2014 at 10:59 PM, Devin Garner notifications@github.comwrote:

Thanks for doing this!

Reply to this email directly or view it on GitHubhttps://github.com/vsClojure/vsClojure/issues/144#issuecomment-37088335
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment