Commit Graph
108 Commits
Author SHA1 Message Date
Nicolas Chevobbe 9af9aa5f85 Bug 1915804 - [devtools] Add AbortController in SourceEditor to control event listeners. r=devtools-reviewers,bomsy.
Differential Revision: https://phabricator.services.mozilla.com/D220684
2024-09-04 06:14:17 +00:00
Hubert Boma Manilla 323b231b0c Bug 1915636 - [devtools] Fix regression of tab key working with selected content in the js terminal r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D220678
2024-08-30 21:32:23 +00:00
Hubert Boma Manilla a5b64ee88c Bug 1913693 - [devtools] Cleanup legacy code added to handle escaping out of the editor r=devtools-reviewers,jdescottes
After a bit of investigation it seems like the code in the `onKeyDown` event was added to work around
the source editor hijacking all the Tab and Shift + Tab key events. The source editor code responsible can be found here
https://searchfox.org/mozilla-central/rev/ea91f336d0004ca28c909da948cb363f3e560877/devtools/client/shared/sourceeditor/editor.js#311-346.
The debugger does not seem to use most of the config settings related to the tab.

Differential Revision: https://phabricator.services.mozilla.com/D219425
2024-08-28 21:44:53 +00:00
Nicolas Chevobbe c2124ecf93 Bug 1913343 - [devtools] Set cursor blink rate from ui.caretBlinkTime in CodeMirror 6. r=devtools-reviewers,jdescottes.
Differential Revision: https://phabricator.services.mozilla.com/D219257
2024-08-26 06:48:52 +00:00
Nicolas Chevobbe 5ac2ff58d1 Bug 1890205 - [devtools] Use CodeMirror 6 to highlight syntax of breakpoint line in Breakpoints panel when cm6 is enabled. r=devtools-reviewers,bomsy.
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
2024-08-26 05:16:38 +00:00
Iulian Moraru 72dd47149b Backed out changeset 7f90a3644c28 (bug 1898204) for causing dt failures on browser_dbg-search-file.js. CLOSED TREE 2024-08-20 11:54:51 +03:00
Hubert Boma Manilla 0f2f04e940 Bug 1898204 - [devtools] Show cursor location as document selection changes r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D215787
2024-08-20 07:32:53 +00:00
Hubert Boma Manilla fa9944434b Bug 1905840 - [devtools] Maintain scroll positon when switching through documents r=devtools-reviewers,nchevobbe
This implements caching of scroll snapshots of each source openend in the editor

Differential Revision: https://phabricator.services.mozilla.com/D216922
2024-07-31 12:56:09 +00:00
Nicolas Chevobbe fd5f9e41b8 Bug 1910037 - [devtools] Remove unused parameter in _buildDecorationsForMarker and _buildDecorationsForPositionMarkers. r=bomsy,devtools-reviewers.
Differential Revision: https://phabricator.services.mozilla.com/D217785
2024-07-26 11:42:37 +00:00
Nicolas Chevobbe c3c5eafb12 Bug 1910034 - [devtools] Fix issue in _buildDecorationsForMarker for marker.shouldMarkAllLines. r=bomsy,devtools-reviewers.
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
2024-07-26 11:42:37 +00:00
Hubert Boma Manilla 1722dad3c8 Bug 1909594 - [devtools] Use the preview value to check the equality of the line content widget r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D217564
2024-07-25 18:11:31 +00:00
Hubert Boma Manilla 9aeb218d1c Bug 1897755 - [devtools] Update DAMP tests to support Codemirror 6 r=perftest-reviewers,devtools-reviewers,nchevobbe,sparky
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
2024-07-19 18:42:02 +00:00
Hubert Boma Manilla 927bdb2ccd Bug 1907260 - [devtools] Fix lineWrapping on reload r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D216548
2024-07-19 13:14:19 +00:00
Hubert Boma Manilla 0cf1a4e6d4 Bug 1903700 - [devtools] Fix position visiblity check to handle scrolling correctly r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D216719
2024-07-18 12:47:03 +00:00
Hubert Boma Manilla 00b017592e Bug 1897755 - [devtools] Stop using e.pageX/pageY for mouse events r=devtools-reviewers,nchevobbe
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
2024-07-11 11:24:50 +00:00
Hubert Boma Manilla e769ce7f9d Bug 1892684 - [devtools] Fix the text indent when the conditional panel is open r=devtools-reviewers,nchevobbe
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
2024-07-09 09:33:45 +00:00
Hubert Boma Manilla 2f1c110511 Bug 1893355 - [devtools] Set gutter breakpoints correctly when jumping between original and generated sources r=devtools-reviewers,nchevobbe
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
2024-07-08 19:33:41 +00:00
Hubert Boma Manilla 2179d80f5d Bug 1897776 - [devtools] Highlight match on selection r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D215807
2024-07-08 12:33:21 +00:00
Hubert Boma Manilla 44d5896f55 Bug 1898157 - [devtools] Refactor positionContentMarkers to use StateFields from ViewPlugins r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D213265
2024-07-02 16:04:03 +00:00
Hubert Boma Manilla 1843e2bfbb Bug 1905380 - [devtools] Refactor lineContentMarkers to use StateFields from ViewPlugins r=devtools-reviewers,nchevobbe
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
2024-07-02 16:04:02 +00:00
Hubert Boma Manilla 5771832323 Bug 1900741 - [devtools] Enable events for all the gutter r=devtools-reviewers,jdescottes,nchevobbe
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
2024-06-30 21:27:36 +00:00
Hubert Boma Manilla 100766d436 Bug 1900684 - [devtools] Reset the selection when changing editor content r=devtools-reviewers,nchevobbe
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
2024-06-18 00:12:28 +00:00
Hubert Boma Manilla aebc2a5424 Bug 1889284 - [devtools] Fix tooltip preview for CM6 r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D210780
2024-05-31 19:10:58 +00:00
Hubert Boma Manilla dc299da66b Bug 1897922 - [devtools] Manage DOM event using EditorView.domEventHandlers r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D211006
2024-05-31 19:10:57 +00:00
Sandor Molnar 4ed56bf704 Backed out 2 changesets (bug 1889284, bug 1897922) for causing dt failures @ devtools/client/shared/test/browser_telemetry_toolboxtabs_webconsole.js CLOSED TREE
Backed out changeset 6f1e17619679 (bug 1889284)
Backed out changeset 4dbf4414edde (bug 1897922)
2024-05-31 02:08:52 +03:00
Hubert Boma Manilla d523ffb2d3 Bug 1889284 - [devtools] Fix tooltip preview for CM6 r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D210780
2024-05-30 22:24:29 +00:00
Hubert Boma Manilla 15bce54208 Bug 1897922 - [devtools] Manage DOM event using EditorView.domEventHandlers r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D211006
2024-05-30 22:24:28 +00:00
Nicolas Chevobbe b64ccccc10 Bug 1896847 - [devtools] Add matching bracket styling in cm6. r=bomsy,devtools-reviewers.
Differential Revision: https://phabricator.services.mozilla.com/D210901
2024-05-21 05:43:20 +00:00
Hubert Boma Manilla 6ee10584ed Bug 1890269 - [devtools] Implementing search highlight in codemirror 6 r=devtools-reviewers,nchevobbe
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
2024-05-20 09:50:41 +00:00
Hubert Boma Manilla 999135a4da Bug 1891336 - [devtools] Highlight text during pause and for exceptions r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D207418
2024-05-19 22:28:23 +00:00
Hubert Boma Manilla 2db2984f38 Bug 1889281 - [devtools] Display column breakpoints for codemirror 6 r=devtools-reviewers,nchevobbe
This patch creates a new extension and api enable marking content nodes

Differential Revision: https://phabricator.services.mozilla.com/D207408
2024-05-19 22:28:23 +00:00
Hubert Boma Manilla 5d85945437 Bug 1889276 - [devtools] Fix editor scrolling in codemirror 6 r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D202125
2024-05-07 23:53:33 +00:00
Hubert Boma Manilla 23a61d41b2 Bug 1894659 - [devtools] Fix duplicate breakpoints on really long lines r=devtools-reviewers,nchevobbe
`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
2024-05-07 00:04:16 +00:00
Hubert Boma Manilla cfc1737fd0 Bug 1889283 - [devtools] Add support for inline previews r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D208267
2024-05-05 13:11:03 +00:00
Hubert Boma Manilla c66148a707 Bug 1887649 - [devtools] Show the conditional/log breakpoint panel in codemirror 6 r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D205578
2024-04-30 22:15:17 +00:00
Tamas Szentpeteri dac2560d0e Backed out changeset c18051672452 (bug 1887649) for causing dt failures in browser_dbg-breakpoints-cond-ui-state.js. CLOSED TREE 2024-04-30 09:43:05 +03:00
Hubert Boma Manilla 976b715f39 Bug 1887649 - [devtools] Show the conditional/log breakpoint panel in codemirror 6 r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D205578
2024-04-30 05:57:42 +00:00
Hubert Boma Manilla 3e437ed282 Bug 1888864 - [devtools] Add click and context menu event listeners for the editor content r=devtools-reviewers,nchevobbe
With this patch the context menu for the editor should be visible

Differential Revision: https://phabricator.services.mozilla.com/D206291
2024-04-22 11:56:39 +00:00
Hubert Boma Manilla 34047e8c3a Bug 1886967 - [devtools] Cleanup the API to make more consitent r=devtools-reviewers,nchevobbe
- 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
2024-03-25 21:56:12 +00:00
Hubert Boma Manilla 1f236dbd77 Bug 1884651 - [devtools] Rendering debug lines when paused in code mirror 6 r=devtools-reviewers,nchevobbe
In this patch
- we begin to render debug lines when paused.
- New APIs are added to add and remove line content markers

Differential Revision: https://phabricator.services.mozilla.com/D204243
2024-03-25 21:56:11 +00:00
pstanciu 26e14298bd Backed out 3 changesets (bug 1884651) for causing pause line failures e.g. on browser_dbg-keyboard-shortcuts.js
Backed out changeset 571e7f23a751 (bug 1884651)
Backed out changeset 3c52a12e9f0c (bug 1884651)
Backed out changeset f7201f71c231 (bug 1884651)
2024-03-25 17:18:30 +02:00
Hubert Boma Manilla 3a4f688073 Bug 1884651 - [devtools] Rendering debug lines when paused in code mirror 6 r=devtools-reviewers,nchevobbe
In this patch
- we begin to render debug lines when paused.
- New APIs are added to add and remove line content markers

Differential Revision: https://phabricator.services.mozilla.com/D204243
2024-03-25 13:47:42 +00:00
Hubert Boma Manilla bbab5fc674 Bug 1882060 - [devtools] Add support for empty lines markers to codemirror 6 r=devtools-reviewers,nchevobbe
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
2024-03-21 07:48:58 +00:00
Cristina Horotan b537a35df5 Backed out 3 changesets (bug 1882060) for causing dt failures at DOMSecurityMonitor.cpp CLOSED TREE
Backed out changeset 1d39266eb67d (bug 1882060)
Backed out changeset a72df33c8fb6 (bug 1882060)
Backed out changeset 16a6afc63e6c (bug 1882060)
2024-03-20 16:35:03 +02:00
Hubert Boma Manilla d99a480af2 Bug 1882060 - [devtools] Add support for empty lines markers to codemirror 6 r=devtools-reviewers,nchevobbe
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
2024-03-20 13:08:30 +00:00
Hubert Boma Manilla 11e553435e Bug 1882060 - [devtools] Add gutter events for click and context menu r=devtools-reviewers,nchevobbe
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
2024-03-18 09:51:29 +00:00
Hubert Boma Manilla 3d21a16949 Bug 1882333 - [devtools] Update the editor toggle button size when the editior dimensions change r=devtools-reviewers,nchevobbe
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
2024-03-18 09:51:27 +00:00
Nicolas Chevobbe dfac8eca38 Bug 1881677 - [devtools] Fix CodeMirror 6 wrapping. r=bomsy,devtools-reviewers.
Differential Revision: https://phabricator.services.mozilla.com/D202546
2024-02-23 15:44:02 +00:00
Nicolas Chevobbe 83718d377b Bug 1881247 - [devtools] Use esm for CodeMirror 6 bundle. r=devtools-reviewers,ochameau.
Differential Revision: https://phabricator.services.mozilla.com/D202310
2024-02-23 12:33:51 +00:00
Sandor Molnar 2e811b0318 Backed out changeset cc4383344170 (bug 1881247) for causing lint failures at devtools/client/shared/sourceeditor/editor.js CLOSED TREE 2024-02-23 09:16:42 +02:00