Commit Graph
31 Commits
Author SHA1 Message Date
Tim van der Lippe 90e5470c94 Update @types packages
DISABLE_THIRD_PARTY_CHECK=NPM updates
R=jacktfranklin@chromium.org

Bug: none
Change-Id: Ia9e3e529cab792cf1c0773f16523489e29fcb6ff
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2692163
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-02-12 14:30:45 +00:00
Tim van der Lippe d7cfd14814 Fix no-implicit-coercion errors in front_end/
R=jacktfranklin@chromium.org

No-Presubmit: True
Bug: 1082789
Change-Id: Ic77884bf7e9b5dc74053915b3b10699368841b66
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2595268
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-01-07 12:40:16 +00:00
Tim van der Lippe 2e38eeaf9f Remove all comments with only the unrestricted annotation
The unrestricted annotation is Closure-specific and can be removed.
This patch removes all comments with only the unrestricted annotation
in them.

R=szuend@chromium.org

No-Presubmit: True
Bug: 1011811
Change-Id: Iba0723644f53f5307c3077d341271af86becc32a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2569758
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
2020-12-02 15:25:32 +00:00
Philip Pfaffe 708087ed38 [Sources] Fix the code mirror context menus
Fixing the sources panel's gutter context menu broke the editor's
context menu. This CL adds back seperate handling for the editor.

R=bmeurer@chromium.org

Bug: chromium:1154101
Change-Id: I1333c1a7b74146ebeed454f6aea5751bccbde5cf
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2567957
Auto-Submit: Philip Pfaffe <pfaffe@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
2020-12-02 14:14:09 +00:00
Jack Franklin a4b6ac8219 [TS] CodeMirrorTextEditor.js
Bug: 1011811
Change-Id: Idad5e01d8d843171541fa5557dc6cdda4c19e155
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2556688
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-11-25 09:28:08 +00:00
Peter Marshall cd896819c5 [typescript] TypeScript-ify source_frame/SourcesTextEditor.js 2/2
Bug: 1011811
Change-Id: If97b5e5266033239eaa339c7ad98e24af1f06328
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2550700
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2020-11-23 10:35:02 +00:00
Philip Pfaffe d99bf143c6 Fix setting breakpoints through the gutter contextMenu
Getting the line number from the clicked-on element is problematic with
pretty printed code where overly long lines get wrap and get "-" line
numbers. This CL just uses CodeMirror's gutterContextMenu instead to get
the proper line number.

Fixed: chromium:1143723
Change-Id: I86fdb5118bdf371a703c8553dfafbf66e5a61473
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2550688
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Auto-Submit: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
2020-11-20 15:55:41 +00:00
Peter Marshall e2bcd07868 [typescript] TypeScript-ify source_frame/SourcesTextEditor.js 1/N
Bug: 1011811
Change-Id: I15315644b1f7efddb6e1698390d1d5b53a918ab2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2550561
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
2020-11-20 08:53:11 +00:00
Derek Li 8236ee0530 Improve _searchHighlighting performance
This change advances the stream by manually setting the stream position to the next occurrence of the matched pattern.

Before this fix, the stream advanced by calling the codemirror api, stream.next(), which advances position by 1 every call. For longer patterns, this causes the debugger to slow down significantly or even freeze.

Fixed: 1127708
Change-Id: I5572b79216c8231d4c5b9148b991307684f1b4d5
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2530735
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
2020-11-17 07:44:57 +00:00
Jan Scheffler 10dcdaf9bd [TypeScript] Move DebuggerPlugin.js to TypeScript
Bug: chromium:1011811
Change-Id: Ib22492faef4495965f3ab2fac95f470de50239a7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2506580
Commit-Queue: Jan Scheffler <janscheffler@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-10-30 12:11:31 +00:00
Jan Scheffler 4a89ed360b [TypeScript] Migrate front_end/source_frame to devtools_entrypoint
R=aerotwist@chromium.org, jacktfranklin@chromium.org

Bug: 1101738
Change-Id: Id6d460cd1e37ee2b4096e90ab02a8c797343171e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2318385
Commit-Queue: Jan Scheffler <janscheffler@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-07-29 16:42:54 +00:00
Benedikt Meurer b358e5fae9 [wasm] Handle disassembly on the editor level
Simplify the handling of non-breakable lines in general, and make
both the line mapping as well as the non-breakable lines iteration
unittestable.

Drive-by-fix: Implement binary search for more efficient
Wasm bytecode reverse mapping.

Fixed: chromium:1056632
Bug: chromium:1071432, chromium:1043047
Change-Id: Ibb2c029a7011206f0676d630c0c94a33fc83d3d8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2220098
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
2020-06-02 13:17:10 +00:00
Peter Marshall 05d1104645 Enable lineWiseCopyCut CodeMirror option for the Sources panel
This was disabled in response to a bug being filed against the Elements
panel after clicking 'Edit As HTML' on an element. When editing an
element as HTML, the window that appears doesn't look like an editor
and users probably aren't expecting 'editor-like' shortcuts like this.
(crbug.com/470435)

The sources panel is an editor (and looks like one) so we restore the
ctrl-x or ctrl-c behavior there, which is to cut or copy the current
line when there is no selection and the shortcut is used. These shorcuts
work the same way in VS Code.

Bug: chromium:1066415
Fixed: chromium:800028
Change-Id: I1a5f16705900c9caf14099d079dca2154bbb0ec6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2204101
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
2020-05-15 13:50:36 +00:00
Tim van der Lippe f49e23286b Replace single class invocations of createElementWithClass
This applies the following replacement to the codebase:

(\S+) = createElementWithClass\('(\w+)', '([^'\s]+)'\);

to

$1 = document.createElement('$2');\n$1.classList.add('$3');

R=aerotwist@chromium.org

No-Presubmit: true
Bug: 1011811, 1077215
Change-Id: I0d76b39f1ed8cd4a44f18f94e398db934ba4b09c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2176112
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-05-01 16:54:52 +00:00
Paul Lewis 2d7d65c5e8 [global] Remaps self.Common.settings
This CL changes references to self.Common.settings (the global
instance of SDK.Common.Settings) over to
Common.Settings.Settings.instance(). To keep both TypeScript and
Closure happy we must make a method on the Settings class itself,
since it only allows private constructors to be accessed by static
methods on the class.

Bug: 1058320
Change-Id: I04afc8caf64acf29cdda13ef03ad05cfff4786a1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2091450
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-16 22:04:07 +00:00
Brian Cui 715c8c459f Infobar Improvements
This CL makes several improvements to the Infobar component.

Most notably, action(s) can now be taken directly from the Infobar
itself. Clients of the Infobar component can pass any number of action
buttons during construction depending on the context.

Infobar has three uses presently in DevTools;
two of those use cases are actionable and have been upgraded with
this new experience:

 - "Pretty print this minified file?" now has a "Pretty-print" button
   where users can directly pretty-print the file.

 - "This script is blackboxed in the debugger" now has an "Unblackbox"
   button, plus a "Configure" button that opens Blackboxing settings.

The layout has been updated to reflow responsively for narrow
window widths and high zoom. Accessibility considerations include:

 - Keyboard navigation: Infobar itself can now gain focus and be
   dismissed by pressing the Esc key. Pressing the Enter key will
   open the Learn More section.

 - Screen reader support: Infobar contents are read aloud in a natural
   and predictable fashion. The ARIA "alert" role is used on the Infobar
   text content.

 - High contrast support: Infobar text and buttons are visible in high
   contrast view. Note, the icons are not high-contrast compliant;
   HC icon updates throughout DevTools is a future task.

Demo: https://i.imgur.com/kNjI4pA.gif

Bug: 1056348
Change-Id: Id2e695af367fb8f5a1c489fa8d3d94c8974458fb
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1981175
Commit-Queue: Brian Cui <brcui@microsoft.com>
Reviewed-by: Fabio Rocha <fabio.rocha@microsoft.com>
2020-03-11 00:00:43 +00:00
Mathias Bynens f06e8c0758 Enable no-else-return lint rule with autofix
This rule matches the Chromium-wide coding style.

Bug: chromium:1057042

Change-Id: I21ad946227ca7344146abace1d2f6146b3a6c207
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2078924
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-02-28 14:17:07 +00:00
Tim van der Lippe 5669023210 Migrate coverage/ to import cross-module
Bug: 1006759
Change-Id: If7dc92bd13da08bf0b2b5ac3668cb9ea56eaeb5e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2052170
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-02-12 18:36:03 +00:00
Tim van der Lippe 2543c5cbff Migrate source_frame/ to import cross-module
Bug: 1006759
Change-Id: I4e81d6c4f3e75646b5fbd6fb8cfb3df3babed87a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2035940
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-02-04 13:06:21 +00:00
Paul Lewis 4b64b3f263 [Global] Remap refs to Common.moduleSetting
Bug: 1006759
Change-Id: Ia45ef0fd0b97588ca23a8d784c0564050b0bbf4c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2016748
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-01-23 12:00:20 +00:00
Brian Cui 564dcf4c07 DevTools: Add Sources setting option: Allow/Disallow scrolling past end of file
NOTE: this is a reupload of CL 1838270, targeting the new separate
DevTools repository.

https://chromium-review.googlesource.com/c/chromium/src/+/1838270

This PR addresses customer feedback received regarding scrolling
behavior for files viewed in the Sources tab. Currently, users are able
to scroll beyond the end of file, for all files at least two lines or
more in length. However, for extra-small files, this behavior is awkward
as the entire file fits inside the editor and scrolling is not needed.

As it turns out, this behavior is a feature. It is also present in
some other text editors, like VSCode. The purpose of scrolling past EOF
is to enable developers to scroll lines to the top of the file, even if
those lines are near the end of the file. After an informal discussion
with my peers, some prefer this feature, while others find it
unintuitive and distracting (myself included).

This change adds a new checkbox toggle option to the Sources setting:
"Allow scrolling past end of file"

When enabled (by default), the behavior is the same as it is now: users
may scroll beyond the end of file for all files >2 lines in length.

When disabled, the user may only scroll to the last line in the file,
and a scrollbar does NOT appear if the entire file fits inside the
editor. (When the editor is resized, a scrollbar appears as needed).

Animated GIF demo: https://i.imgur.com/zJytuf1.gif

Remark: the scroll past EoF feature is not native to CodeMirror and is
a Chromium specific customization for the Sources tab.

Bug: 998270
Change-Id: I79d11cf68c105aabe407269819f0495adfba44b7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1872878
Reviewed-by: Fabio Rocha <fabio.rocha@microsoft.com>
Reviewed-by: Robert Paveza <Rob.Paveza@microsoft.com>
Commit-Queue: Brian Cui <brcui@microsoft.com>
2020-01-21 22:38:23 +00:00
Paul Lewis aa437a5f71 Migrates source_frame/ to ESM internally
Bug: 1006759
Change-Id: Ie0c5a2a815806f49e40d089ed8bae729c3846b20
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2002594
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-01-15 17:01:54 +00:00
Tim van der Lippe b88663fc59 Migrate source_frame/ to ESM
Bug: 1006759
Change-Id: Ibcff1093ef7b7a4a9f4a94a1d75f900b8ab2d88f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1903473
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2019-11-09 19:29:23 +00:00
Michael Liao b186cfaa74 DevTools [Common - Infobar]: Making infobars SR accessible
Reupload of https://chromium-review.googlesource.com/c/chromium/src/+/1824277 to DevTools repository

Changes:
- Wrapping infobar in infobar div and setting element as an alert

Bug: 963183
Change-Id: I442f709bbdd3b6b9c6d3ff6cc801a7e4398e480f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1873140
Reviewed-by: Lorne Mitchell <lomitch@microsoft.com>
Commit-Queue: Michael Liao <michael.liao@microsoft.com>
2019-10-23 23:19:18 +00:00
Tim van der Lippe 1d6e57a0e3 Always add braces to single-line if-statements
The Chromium/Google style guides does not enforce curly braces for
single-line if-statements, but does strongly recommend doing so. Adding
braces will improve code readability, by visually separating code
blocks. This will also prevent issues where accidental additions are
pushed to the "else"-clause instead of in the if-block.

This CL also updates the presubmit `eslint` to run the fix with the
correct configuration. It will now fix all issues it can fix.

Change-Id: I4b616f21a99393f168dec743c0bcbdc7f5db04a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1821526
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Jeff Fisher <jeffish@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#701070}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 7e0bdbe2d7f9fc2386bfaefda3cc29c66ccc18f9
2019-09-30 11:55:34 +00:00
Sigurd Schneider a33a39bac9 [devtools] Open coverage drawer when coverage gutter is clicked
Bug: chromium:1004203
Change-Id: I5079a1b7096fc03ed51aa23014c403f9931dbf29
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1803295
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Michael Hablich <hablich@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#699329}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 0d3d363817e8926ab31917152b5175632a9709a0
2019-09-24 14:09:12 +00:00
Joey Arhar 19e85ccca5 [DevTools] Add binary websocket message viewer behind experiment
Screenshots: https://imgur.com/a/0rtukft

Bug: 605262
Change-Id: I1049d2196e51193419b9dd7ebbe7105a8655a631
Reviewed-on: https://chromium-review.googlesource.com/c/1321570
Commit-Queue: Joey Arhar <jarhar@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#627166}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 9eb859773e133754b856482a4b6ea79ba39412fe
2019-01-29 22:07:02 +00:00
Joel Einbinder c9861428f5 DevTools: Use geometry instead of CSS for code folding hover
The previous CL's CSS hack incorrectly cut off breakpoints, caused the
gutter to be transparent when scrolling code horizontally, and made
closed folding triangles invisible.

Bug: 328431
Change-Id: Iba9482efd4bfd13d750580746f5507dadd0c73b2
Reviewed-on: https://chromium-review.googlesource.com/c/1380557
Reviewed-by: Erik Luo <luoe@chromium.org>
Commit-Queue: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#617362}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 87b1e4b4c4908281cb602c44f4a757fd653ec4b4
2018-12-18 03:26:45 +00:00
Joel Einbinder bbaf38311d DevTools: Code Folding
This adds the ability to collapse sections of code in the Sources and
Network panels.

https://i.imgur.com/CkREJEV.png

Bug: 328431

Change-Id: I88e44d86c7fd2e6dbf076cc734aa538836516cf0
Reviewed-on: https://chromium-review.googlesource.com/c/1014386
Commit-Queue: Joel Einbinder <einbinder@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Reviewed-by: Erik Luo <luoe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#616885}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 9e5bce11314b18020acc24e078f2ccc723be3867
2018-12-15 00:05:35 +00:00
Joel Einbinder 52829ed75d DevTools: JavaScriptSourceFrame -> DebuggerPlugin
This moves JavaScriptSourceFrame into a plugin, and completes
the plugin initiative.

Bug: 778043
Change-Id: I5908cfe46650fd50524a08b2e402d8ac6ce77cc9
Reviewed-on: https://chromium-review.googlesource.com/889692
Commit-Queue: Joel Einbinder <einbinder@chromium.org>
Reviewed-by: Andrey Lushnikov <lushnikov@chromium.org>
Reviewed-by: Pavel Feldman <pfeldman@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#551193}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 0920b5eecf51ca3b520098d09ef65460acba3407
2018-04-17 00:47:45 +00:00
Blink Reformat 4c46d0969f The Great Blink mv for source files, part 2.
Move and rename files.

NOAUTOREVERT=true
NOPRESUBMIT=true
NOTREECHECKS=true
Bug: 768828
TBR=darin@chromium.org
NOTRY=true

Change-Id: I66d3b155808bc5bdbf237b80208e1e552bcf7f28
Reviewed-on: https://chromium-review.googlesource.com/1001153
Reviewed-by: Blink Reformat <blink-reformat@chromium.org>
Commit-Queue: Blink Reformat <blink-reformat@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#549061}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 0aee4434a4dba42a42abaea9bfbc0cd196a63bc1
2018-04-07 15:32:37 +00:00