icsharpcode / AvalonEdit

The WPF-based text editor component used in SharpDevelop
http://avalonedit.net/
MIT License
1.86k stars 470 forks source link

AutomationPeer editor extension #332

Open sloutsky opened 2 years ago

sloutsky commented 2 years ago

Add extension to text editor that allows to inject automation peer that represents IntelliSense suggestion list and the currently selected suggestion - to allow screen narrators to read the suggestion.

siegfriedpammer commented 2 years ago

Thank you very much for your pull request! The changes are looking good, just a few remarks:

1) Can you please clean up the commits? 3 of the 4 commits in this pull request are not related to the actual change. 2) Can you please rename/remove all references to "IntelliSense"... AvalonEdit uses the word "CodeCompletion", we want to prevent any confusion.

If you don't have time to apply these changes, I can do that for you once we merge this.

I will have to take a closer look and test how Narrator behaves now.

sloutsky commented 2 years ago

I have renamed the property. Now I need to figure how to get rid of the "bad commits"

siegfriedpammer commented 2 years ago

I normally use the gitk UI tool for this as it's more convenient and you don't have to remember commit hashes. Also the command-line instructions might not use the minimal amount of commands.

Assuming you are on the correct branch:

use git log to find the commit hashes of all the commits you want to keep.

If you want to merge the "Renaming property name" commit and the first commit into one, you can use steps in 4, otherwise just skip those.

1) git reset --hard origin/master resets everything to the original state (this is a destructive action for all code that is not committed!) 2) git pull --rebase https://github.com/icsharpcode/AvalonEdit.git master gets the latest code from our repo (if your origin/master already has the latest revision, you can omit this) 3) git cherry-pick <commit-hash> for every commit you want to add 4) If you want to merge two commits you can do (assuming HEAD points to commit-hash1 now):

Hope this helps!

siegfriedpammer commented 2 years ago

Looks like this didn't work out as expected. If you want, I can just clean it up manually before merge.

sloutsky commented 2 years ago

Yep, indeed - it looks I've messed this up. If you can handle this upon merge - this would be great!

siegfriedpammer commented 2 years ago

Hmmm, it seems, this change currently does not provide a out-of-the-box solution for users of AvalonEdit. I would have expected Narrator to properly work out-of-the-box with how we currently use/instantiate the CompletionWindow in the sample application:

https://github.com/icsharpcode/AvalonEdit/blob/395ef8166870e2c6e1f63a7d97ac22e5e646e790/ICSharpCode.AvalonEdit.Sample/Window1.xaml.cs#L124-L154

Seems like I will have to dig around to get this to work properly like in VS. Thanks anyway for the starting point.