Quang
Quang

Reputation: 51

allowing to insert breakpoint in visual studio editor extension

Add Syntax Highlighting to IElisonBuffer

I follow this question and implement my visual studio editor extension. I got everything working fine: syntax highlight, completion...but I cannot add breakpoint even thought the options was there in the right context menu (disabled)

Is there anything else I need to do to enable this feature for my editor?

Upvotes: 2

Views: 633

Answers (1)

Cameron
Cameron

Reputation: 98836

Well, for the breakpoint to actually do anything, you'll need to implement a debugger (via the AD7 interfaces, etc.).

But to just get the actual breakpoint toggling working, all you need to do is implement the IVsLanguageDebugInfo interface (and optionally IVsLanguageDebugInfo2 and IVsLanguageDebugInfo3 too for more control). (I suggest you do so on the your language info object that's already implementing IVsLanguageInfo.) Don't forget to register your implementation so that VS knows about it.

ValidateBreakpointLocation() will be called when the user presses F9, etc., and in it you should set the breakpoint span to the appropriate bounds of the line (or portion of the line depending on your language, e.g. you might be in a lambda or want to highlight a statement except for any trailing comments on the line), then return VSConstants.S_OK.

Upvotes: 1

Related Questions