Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

How to determine whether the trigger point is in a perticular region

$
0
0

Hi,

I am developing an intellisense extension to c++ like language. In my source files, I have some sections marked like #mysection1, #mysection2 etc.. (Similar to regions in C#)

When I press ctrl+. in the editor, I need to determine what is the section that the trigger point is in. I read the trigger point as follows,

var triggerPoint = (SnapshotPoint)session.GetTriggerPoint(snapshot);

Here I know I can just get the whole string as "m_textBuffer.CurrentSnapshot.GetText()" and do some string comparison. But I would like to implement it in a more robust way. To my mind, the best approach would be to define #mysection1, #mysection2 etc.. as regions and check what is the region of my trigger point.

But I am new to Visual Studio development and couldn't find any helpful code example to perform similar functionality.

Can you please advise?

Thanks,

Sandun


Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>