A method is added to the source editor to handle syntax highlighting so we can
handle both cm5 and cm6.
As the rules for syntax highlighting in CodeMirror 6 were all defined in the `cm-editor`
class, we have to add a specific class that we can target for the previews,
and handle it in the light and dark CSS files.
Differential Revision: https://phabricator.services.mozilla.com/D219175
With Bug 1909594, decorationLines items are expected to be an object.
We missed one callsite when marker.shouldMarkAllLines is true.
Differential Revision: https://phabricator.services.mozilla.com/D217784
This patch adds support for running debugger DAMP tests with CM6.
Currently switch off by default. Set the `devtools.debugger.features.codemirror-next` pref in
the custom.js to `true` to run.
Differential Revision: https://phabricator.services.mozilla.com/D210909
In the DAMP tests we dispatch mouse-events, where `e.pageX/Y` or `e.screenX/Y` are 0 if they are not explicitly set.
So dependence on `pageX/Y` are therefore not reliable.
This patch removes the use of `pageX/Y` to determine the token positions for toolip previews.
To test this, just make sure that tooltip breakpoints still works.
Differential Revision: https://phabricator.services.mozilla.com/D216144
The story here :-
CM6 adds a padding of 6px as a space between the gutter and the editor content.
The consequence of this the conditional panel will have a 6px gap on the left side.
Prior to this patch i removed the padding on the .cm-line element which contains the
conditional panel, this causes the content on the line to shift and ..viola ..the BUG.
To fix this, i'm adding 6px `padding-inline-start` to compensate.
Differential Revision: https://phabricator.services.mozilla.com/D215269
In this patch ...
1) Using `getSelectedLocation` to get the correct breakpoint location for either orignal or generated sources.
2) A little reafactor to get some perf wins by not searching the breakpoint list twice (i.e in condition() and createLineElementNode())
Differential Revision: https://phabricator.services.mozilla.com/D215751
Highlights of this patch
- Fixes the line shifting issue in the related bug as the `block` property can be used in `Decoration.widget`.
- Uses Statefields. With StateFields codemirror has more control over updates, avoiding possible crashes like in Bug 1898157
- Changes from using `conditions` on markers to using `positions`, this means we can just render the marker at the
desired location without always needing to loop over the all the lines of the viewport. Most times the number of `positions` to mark
are a lot lesser that the no of lines in the `viewport`.
- When explicitly updating a marker only the required decoration is updated.
Differential Revision: https://phabricator.services.mozilla.com/D213012
This patch
- Adds the gutter hover styling to help indicate which lines can be clicked.
- Fix triggering events on the whole gutter panel (including the code folder).
- Fix showing hover indicators when hovering over the line number gutter
- Fix showing breakpoints on initial load
- Fix styling for breakable lines in dark theme
Differential Revision: https://phabricator.services.mozilla.com/D212752
The issue here is a selection becomes stale once the editor content changes, and codemirror
no longer knows how to render the old selection with the new content (causing blank editor).
Once the user clicks, this resets the selection which causes the editor content to display properly.
To fix this we reset the selection as we reset the editor content.
Unfortunately we lose the previous selection (even if we go back).
Differential Revision: https://phabricator.services.mozilla.com/D213875
This patch
- Gets the search in file feature working for codemirror 6 (Use Ctrl/CMD F to open in the editor)
- Highlights search results in the editor, when using the search panel on the left.
- Includes the @codemirror/search package in the codemirror bundle. This enables using the `RegExpCursor`
Differential Revision: https://phabricator.services.mozilla.com/D208110
`visibleRanges` can return multiple ranges (mostly for large sources the overflow the current viewport),
and those might contain the same line, causing duplicates.
Switching from cm.visibleRanges to cm.viewport
Differential Revision: https://phabricator.services.mozilla.com/D209233
- Added the requirement for a new `id` property to markers passed to the `setLineGutterMarkers` API.
- Changed `gutterLineClassName` to `lineClassName` the API name already indicates that it is the gutter, no need to have gutter in the property name, this also amkes it consistent with `setLineContentMarker`
- Changed `createGutterLineElementNode` to `createLineElementNode` for same reason as above.
Differential Revision: https://phabricator.services.mozilla.com/D205435
In this patch
1) Adds the `setLineGutterMarkers` function to the editor which enables defining gutter markers
the line number gutter component. This also updates the line number gutter when the viewport (visible ranges)
change (This usually happens when the editor is scrolled).
2)The first use of the `setLineGutterMarkers` is for rendering empty lines
Differential Revision: https://phabricator.services.mozilla.com/D202716
In this patch
1) Adds the `setLineGutterMarkers` function to the editor which enables defining gutter markers
the line number gutter component. This also updates the line number gutter when the viewport (visible ranges)
change (This usually happens when the editor is scrolled).
2)The first use of the `setLineGutterMarkers` is for rendering empty lines
Differential Revision: https://phabricator.services.mozilla.com/D202716
With this patch
- The line gutter context menu will get displayed on right click of the gutter
- Clicking line gutter should set breakpoints
Note not covered in this patch:-
- Context menu feaures might not work
- Line breakpoints are not showing yet ( this is coming in a future patch)
Differential Revision: https://phabricator.services.mozilla.com/D203210
This patch updates the size of the button (above the editor gutter) which toogles the sidebar for codemirror 6.
Note this was broken with the current codemirror as wel so fixed both.
Also adding the ability to attach an updateListener to the editor we can listen for editor changes.
Differential Revision: https://phabricator.services.mozilla.com/D202398