fsprojects / FsXaml

F# Tools for working with XAML Projects
http://fsprojects.github.io/FsXaml/
MIT License
172 stars 48 forks source link

How to build a suggestion list? #13

Closed forki closed 10 years ago

forki commented 10 years ago

I'd like to implement a "rename suggestion list" for https://github.com/fsprojects/VisualFSharpPowerTools/blob/master/src/FSharpVSPowerTools.Logic/RenameDialog.fs#L16 but don't really know how to do something like this with FsXaml. I'd like to provide a list with suggestions to the new name textbox (https://github.com/fsprojects/VisualFSharpPowerTools/blob/master/src/FSharpVSPowerTools.Logic/RenameDialog.xaml#L52) and if the user selects one of these the I want to have it in the textbox. Can you give me a hint?

forki commented 10 years ago

/cc @ReedCopsey @vasily-kirichenko @dungpa

dungpa commented 10 years ago

What identifiers do you want to suggest? I usually prefer thinking of a new identifier to picking one from suggestions :).

forki commented 10 years ago

It's more for correcting of typical typos and suggesting of typical names. One could also use information about the type and suggest a fitting variable name.

image

It would be cool if the tool would suggest "person" as a identifier. (Real magic would be if it suggested "steffen" ;-) - which might even work)

R# does a really good job here.

ReedCopsey commented 10 years ago

@forki How would you like this to be displayed visually? If you were to rework it so that the list of suggested identifiers (which should all be verified first, I suppose) were provided, it'd be fairly easy to rework the visuals in WPF to display them.

It's a bit different than R#, just because we're not doing the rename inline (which would be problematic with speed issues, anyways). We could have a popup and arrow keys, so the behavior was similar, though.

Most of this would be fairly custom UI logic, so I'd recommend putting it into the Controller class for the rename dialog (this is effectively FsXaml's "code behind" mechanism for F#). I'd be happy to help if you can provide the validated suggestion list.

forki commented 10 years ago

I'm prototyping the suggestion list see https://github.com/fsprojects/VisualFSharpPowerTools/pull/579

ReedCopsey commented 10 years ago

Will work on this in VFSPT project.