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
We've added support for GlyphMarginWidgets in the code editor. This allows decoration authors in core only (not extension authors) to handle clicks on glyph margin decorations by passing in a DOM node that has attached listeners.
Test: please take a look at the IGlyphMarginWidget interface and the new methods for adding, layouting, and removing widgets. Verify that the methods and properties make sense, are properly documented, and behave as expected.
edit from hediet: Try out the new API in the monaco editor playground!
Why does a widget have a range and not just a position? Can you add some docs there?
You followed the same API that Content and Overlay widgets have, but I think that API is quite outdated (addGlyphMarginWidget should return a disposable instead of having removeGlyphMarginWidget, layoutGlyphMarginWidget could be replaced by an "onChange" event and I don't think getId is needed).
Personally, I'd prefer a more modern API over consistency for the monaco editor (and would eventually refactor the other APIs as well), but I can understand the other side as well
Just curious, for what feature did you add GlyphMarginWidgets?
Refs: #176316
Authors: @joyceerhl @alexdima
Complexity: 4
Create Issue
We've added support for
GlyphMarginWidget
s in the code editor. This allows decoration authors in core only (not extension authors) to handle clicks on glyph margin decorations by passing in a DOM node that has attached listeners.Test: please take a look at the
IGlyphMarginWidget
interface and the new methods for adding, layouting, and removing widgets. Verify that the methods and properties make sense, are properly documented, and behave as expected.edit from hediet: Try out the new API in the monaco editor playground!
Refs:
vscode/src/vs/editor/browser/editorBrowser.ts
Lines 255 to 271 in f907729
vscode/src/vs/editor/browser/editorBrowser.ts
Lines 1029 to 1041 in f907729
The text was updated successfully, but these errors were encountered: