haacked / Encourage

A bit of encouragment added to Visual Studio
75 stars 32 forks source link

Enable customization of encouragement list #24

Closed haacked closed 10 years ago

haacked commented 10 years ago

To start, I think we'd implement a simple property window with a text area and each encouragement goes on its own line.

@jaredpar do you have pointers for how to do this quickly and easily?

jaredpar commented 10 years ago

I think it mostly comes down to how / where you want to display the encouragement edit control. There are a couple of options

  1. A Tool Window: aka Immediate, Output, and Build windows
  2. A Margin Control: the edit control would pop-up at the bottom / top of the code window
  3. An adornment: basically put the WPF control wherever you want within the code window

These all have about the same amount of boiler plate code associated with them. I can send you pointers on any of these.

Have you thought about how you want to invoke it? Right click menu, key stroke, etc ...

philoushka commented 10 years ago

A property page sounds a great idea. Here's my potential enhancement:

Provide a text box that is prepopulated with a Gist URL. Prepopulate that just with the list of encouragements. When the user installs the extension, load the list and save locally.

Allow the user to change that URL to some other Gist. Reload the local cache when they save.

The benefit with all this is that you get to dynamically change the list of encouragements without a rebuild and repackage to nuget. The extension could check for changes at some interval. Users could then share their Gists with all their custom encouragements.

haacked commented 10 years ago

Yeah, I think I was thinking more along the lines of a property page. That would answer the question of how to invoke it, right? You just go to the Tools/Options menu?

Provide a text box that is prepopulated with a Gist URL. Prepopulate that just with the list of encouragements. When the user installs the extension, load the list and save locally.

I think I'd like to keep it simpler initially. Prepopulate with our hard-coded list. Let user change it. Doesn't VS have a means built-in to save settings in the cloud? We could rely on that.

jaredpar commented 10 years ago

Don't know why option pages didn't occur to me. That definitely makes the most sense.

Property pages are actually pretty straight forward to add. It requires really only 2 things

  1. The Package type needs to be annotated with ProvideOptionPageAttribute
  2. The attribute needs to point to a type that derives from DialogPage

Here is a reference commit that adds a property page to an existing project. The pages themselves are blank but it has the basic pattern

https://github.com/jaredpar/VsVim/commit/810057bd979aa679247163f4f4e213468b5fe9ba

Doesn't VS have a means built-in to save settings in the cloud?

It does but it's unclear how to hook arbitrary settings into it. I will ask around about that.

haacked commented 10 years ago

Cool, I'll take this one as I want to learn how this works. :smile:

haacked commented 10 years ago

Closed by #27