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

Is it possible for method names to support IntelliSense? #1

Open
CodingOctocat opened this issue Jun 5, 2021 · 5 comments
Open

Is it possible for method names to support IntelliSense? #1

CodingOctocat opened this issue Jun 5, 2021 · 5 comments

Comments

@CodingOctocat
Copy link

I've tried some similar event binding libraries. Your library is the best, but as a lazy person, I hope to support IntelliSense when I enter method names. Is this technically feasible?

@mikernet
Copy link
Member

mikernet commented Jun 5, 2021

Thanks :) I'm not sure what it would take to add that to be honest, but I was curious about that as well. I'll inquire with some people that would know what would be involved.

@mikernet
Copy link
Member

mikernet commented Jun 10, 2021

One possible approach: create a VSIX extension that implements IIntellisensePresenterProvider which shows an alternate IntelliSense popup if the cursor is inside a method binding in a spot where the method name can go. Here's an example of replacing the IntelliSense XAML popup that may help:

https://www.codeproject.com/Articles/1216579/Implementing-Custom-XAML-Intellisense-VS-Extension

There could be other VS interfaces that could be utilized to simply add entries into the existing popup (ICompletionBroker?) but I don't know my way around these extension interfaces. I'll update this issue if I find out about any other easier approaches.

That said, the rewards for building this may not be big enough to justify the work involved just to get a method name list. It would also require installing a VS extension. What could change my mind is if it would be possible for the extension to also fix properly showing Intellisense for nested {Binding} declarations inside the method binding when the method target is changed to something other than the element's data context, but this seems like a rather complex undertaking, to be honest.

If someone wants to collaborate on this then I'd be happy to incorporate it into the project.

@mikernet
Copy link
Member

Another possible avenue: https://docs.microsoft.com/en-us/visualstudio/extensibility/walkthrough-displaying-statement-completion?view=vs-2019

I think this is only feasible if there's a way for us to tap into all the parsed XAML context that the XAML editor has (i.e. the type of element we are on, the type of the current data context, etc) instead of attempting to work with raw text tokens. Will need to investigate if there are any extensibility points the XAML editor provides that could be utilized which would give us the info we need.

@mikernet
Copy link
Member

mikernet commented Jun 10, 2021

Note to self: maybe someone here can point us in the right direction - https://github.com/microsoft/xaml-designer-extensibility (though the XAML designer team may not be the same as the XAML editor team).

Someone suggested trying to contact https://twitter.com/MarcoOGoertz for some direction as well.

@CodingOctocat
Copy link
Author

Hi @mikernet , I think writing Intellisense extensions is very complicated, especially for me as a beginner.
I am looking forward to Microsoft improving WPF, Xaml and Intellisense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants