You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Other VSIX examples for finding the word under the caret use a ITextStructureNavigator, but how do I get that while using this Community.VisualStudio.Toolkit?
var docView = await VS.Documents.GetActiveDocumentViewAsync();
var point = docView.TextView.Caret.Position.Point.GetPoint(docView.TextBuffer, caret.Position.Affinity);
ITextStructureNavigator navigator = ....; // how to get this?
var word = navigator.GetExtentOfWord(point).Span.GetText();
What would really be nice is a helper method...
var docView = await VS.Documents.GetActiveDocumentViewAsync();
var word = docView.TextView.GetWordTextUnderCaret();
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Other VSIX examples for finding the word under the caret use a ITextStructureNavigator, but how do I get that while using this Community.VisualStudio.Toolkit?
What would really be nice is a helper method...
Beta Was this translation helpful? Give feedback.
All reactions