Custom breakpoint issue in Language Service Lua extension for VS2022
Hello,
I am supporting a language service extension that we use internally for our Lua codes. This extension add syntax highlight for our lua codes, and also integrate a Lua debugger in the IDE. This extension was created a long time ago, on VS 2015, and we since then ported it to VS2019, and more recently, on VS2022.
Ever since I ported the extension to VS2022, I am having some issues with our custom breakpoint if I try to place one by clicking on the margin of the text document:
On VS 2019, clicking on the margin would place a Lua breakpoint (That we added in our extension).
On VS 2022, clicking on the margin add a c++ breakpoint, even though we are in a Lua file. If, after placing a c++ breakpoint, I never remove my mouse from the margin, then I remove the C++ breakpoint, and press on the margin again, only then will I have our own custom breakpoint placed.
In my debugging of this issue, I noticed that everytime I click on the margin, our ValidateBreakpointLocation function from the IVsLanguageDebugInfo interface is gettting called, and we always return that it is a valid location, as long as the text line length is bigger than 0, but even though we return that the location is valid, and we setup the text span accordingly, the first beakpoint to be inserted will always be a c++ breakpoint. I also noticed that the function GetTextMarkerType from the IVsTextMarkerTypeProvider only get called on our second click, or when we are about to succeeds to place our own breakpoint.
I am a bit confused as to how can I achieve parity with VS 2019 here, where clicking on the margin would always place our own breakpoint while we are in a lua file, instead of always getting a C++ breakpoint first.
I would appreciate any help you can provide.
Thanks, David