I'm trying to make extension for VS, but I don't have enough knowledge about it's structures. (Well, actually I started searching for building extension about 4hrs ago)
By the way, I want to get type information from caret position such as "Go to definition".
For example)
using System;
...
private IServiceProvider ServiceProvider { get; }
In this case, if you move your caret to IServiceProvider
and execute "Go to definition" command, it will navigate and shows a code of System.IServiceProvider
.
My question is "How to get type information from caret"?
I can read line text where caret located and get "IServiceProvider" text by substring lines by space.
textView.GetCaretPos(out int line, out int column);
textView.GetBuffer(out IVsTextLines lines);
lines.GetLengthOfLine(line, out int lineLength);
lines.GetLineText(line, 0, line, lineLength, out string lineText);
Is anyone can guide me how to get type information from caret position?
Thanks for your interest.