Question

Get function parameters and function name on ViewMouseHover

Posted 5 months ago by Avatar Hilton Law

Hi,

 

Is it possible to retrieve the parameters types of a function, along with the function name on a SyntaxEditor.ViewMouseHover event, when the mouse is over a function identifier? I'd need all the types and the function name to be fully qualified.

 

Thanks,

Hilton


Comments (6)

Posted 5 months ago by Actipro Software Support - Cleveland, OH, USA

Hi Hilton,

Which syntax language are you using for this question?


Actipro Software Support
Posted 5 months ago by Hilton Law

I'm using VB and C#.

Posted 5 months ago by Actipro Software Support - Cleveland, OH, USA

Hi Hilton,

If you mean the premium C#/VB languages in our .NET Languages Add-on, our CSharpQuickInfoProvider effectively does this kind of thing:

var context = new CSharpContextFactory().CreateContext(new TextSnapshotOffset(view.CurrentSnapshot, offset));
var resultSet = dotNetContext.Resolve();

Then we look at the top result in the result set, which could be an INamespaceResolverResult, ITypeResolverResult, ITypeMemberResolverResult, IParameterResolverResult, or IVariableResolverResult.  The type references in those various results should be fully-qualified if we were able to resolve the type names.


Actipro Software Support
Posted 5 months ago by Hilton Law

Thank you! I will try it.

Posted 5 months ago by Hilton Law

My bad, I meant to post this in the SyntaxEditor Winforms forums. Could this be moved? And is my original question possible in the Winforms version?

Posted 5 months ago by Actipro Software Support - Cleveland, OH, USA

Hello,

I moved the thread to the WinForms SyntaxEditor forum instead.

In the WinForms .NET Languages Add-on, you can call the language's GetContext method to get some contextual information.  Then the DotNetProjectResolver.GetQuickInfo method uses that context to build up the quick info.  Note that the older WinForms version's contextual data isn't as robust as what you find in the WPF version's code we provided above.


Actipro Software Support
Information The latest build of this product (2018.1 build 0341) was released 5 days ago, which was after the last post in this thread.

Add a Comment

Please log in to a validated account to post comments.