Hello,
In the older WinForms SyntaxEditor design, the DotNetSyntaxLanguage class defines a protected GetContext method you can call to get a DotNetContext. Quick info calls it like:
DotNetContext context = this.GetContext(syntaxEditor, offset, false, false);
That will have some contextual information about what is at the offset.
In the newer WPF SyntaxEditor design, we have implemented a much better system for getting full resolver result details about an offset. Our WPF SyntaxEditor's quick info provider effectively does this sort of thing:
// 'offset' is the desired offset of the identifier
var dotNetContext = new VBContextFactory().CreateContext(new TextSnapshotOffset(editor.Document.CurrentSnapshot, offset));
if ((dotNetContext != null) && (dotNetContext.InitializationSnapshotRange.HasValue)) {
var resultSet = dotNetContext.Resolve();
if ((resultSet != null) && (resultSet.Results != null) && (resultSet.Results.Count > 0)) {
// Results are sorted by best match and could be an INamespaceResolverResult,
// ITypeResolverResult, ITypeMemberResolverResult, IParameterResolverResult,
// or IVariableResolverResult... examine the results for type info
}
}