Commit Graph
25 Commits
Author SHA1 Message Date
Jack Franklin e839c0cf22 Enable long import wrapping for JS imports
DISABLE_THIRD_PARTY_CHECK=big clang format run against all files in
front_end and test/

Bug: 1319340
Change-Id: I1fff63cb07544ccd0e3059fc901f9a48ff4af13b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3598879
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Wolfgang Beyer <wolfi@chromium.org>
2022-05-03 10:22:12 +00:00
Changhao Han 573dfc1cca Add copy button in the Changes tab
This CL also moves the formatting function from StylesSidebarPane to
panels/utils, which can be shared between the Styles pane and the
Changes tab.

Bug: 1268754
Change-Id: I172a6a8d247c8326d67e1f6342a4d9bd91f1557a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3560436
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Changhao Han <changhaohan@chromium.org>
Reviewed-by: Johan Bay <jobay@chromium.org>
2022-03-31 13:10:50 +00:00
Jaroslav Sevcik 97a93b6671 Substitution of minified identifiers in expressions
Without this patch, we only substituted single identifiers. With
the patch, we substitute in arbitrary expressions. (Still only
as an experiment.)

Bug: chromium:1297047
Change-Id: Ifae5cab1a42823559751fbd9dc515edfae02255e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3487866
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
2022-03-09 09:13:21 +00:00
Kateryna Prokopenko 79f7e6c996 Remove casts to UrlString from SourceMapManager & StaticContentProvider
Bug: 1299773
Change-Id: I377daea5d94e73326e77e56bbd8b94bad2c86b58
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3468517
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Eric Leese <leese@chromium.org>
Commit-Queue: Kateryna Prokopenko <kprokopenko@chromium.org>
2022-02-22 16:35:37 +00:00
Jaroslav Sevcik 0ee4cd1f42 Move scope names resolver to models
The patch makes the resolver usable by the console.
There should be no functional changes.

Bug: chromium:1297047
Change-Id: I020375c4c5587d1053a801dbf1b9c6a850e367aa
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3461555
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
2022-02-15 21:40:01 +00:00
Tim van der Lippe b67a3f0877 Fix GN dependencies
The formatter model creates a worker that references the formatter_worker
entrypoint. However, it wasn't depending on it as such. Therefore,
to ensure deterministic building, we have to add the entrypoint as
dependency to the model. That required another tidy up, as there was
a type defined in the model that was used in the entrypoint. We can
move that type to the entrypoint to circumvent the issue.

Additionally, fix the dependency on Images and themeColors.css to make
them available as expected when running unit tests.

R=jacktfranklin@chromium.org

Fixed: 1284865
Change-Id: I9d1eb6877629ccb5dd5ed105a10acf6291275610
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3369364
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2022-01-06 12:26:09 +00:00
Tim van der Lippe 2d9a95ce7b Suppress all existing promise races
To suppress the races, we mark these invocations with `void` per
the instructions of `no-floating-promises`. This explicitly marks
these statements as side-effect promises.

Engineers can later analyze these void statements and determine
whether the promise races are intentional or accidental.

R=jacktfranklin@chromium.org

Bug: 1239617
Change-Id: I6b7a24cf21029d6ff73b112b3e8255ebab8c60ec
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3366467
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim Van der Lippe <tvanderlippe@chromium.org>
2022-01-04 16:08:08 +00:00
Marijn Haverbeke 3ea8755408 Remove machinery surrounding CodeMirror 5
The third_party module is still there because a few of its scripts are
used for tokenizing.

R=tvanderlippe@chromium.org

Bug: 1241848
Change-Id: I576b7c1a0fb6c78ca83422fdb9117f169a75efb7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3295489
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2021-11-29 15:10:46 +00:00
Changhao Han 4382b53352 Add option to format diff in the Changes tab
This CL adds an experimental flag to automatically format code changes
in the Changes tab. This way the minified sources won't show only one
line of diff that's quite hard to trace the actual difference. It also
won't show formatted source as changes any more.

Screenshot: https://imgur.com/a/lIEqUmU

Bug: chromium:1238818, chromium:1268754, chromium:1086491
Change-Id: I0f2636d1bced17f2f9b32f594bf720951fd4e191
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3300359
Commit-Queue: Changhao Han <changhaohan@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-11-25 09:05:44 +00:00
Benedikt Meurer a992c9dfc6 Remove position adjustment for inline scripts with #sourceURL.
Following up on https://crrev.com/c/3069289 the back-end reports
positions (raw locations) for inline scripts with `//# sourceURL`
annotations relative to the start of the <script> tag content, rather
than relative to the surrounding document.

The DevTools front-end however was still trying to make up for the
wrong positions reported by the back-end, leading to negative line
numbers being reported and sometimes jumping to the wrong line when
using inline scripts with `//# sourceURL` annotations.

This change removes the hacks from the front-end and simply uses the
positions from the back-end, which are now correct.

Fixed: chromium:1270227
Bug: chromium:578269, chromium:1183990
Change-Id: I65a59f64f42230179f56218518e727116329ad5d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3291151
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
2021-11-22 07:01:30 +00:00
Tim van der Lippe c1ab112d90 Port the sources panels to CM6
R=tvanderlippe@chromium.org

Bug: 1241848
Change-Id: Idfe1658c9c2948b5c79c2845b9fd9472746a62b9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3247435
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-11-12 16:47:28 +00:00
Marijn Haverbeke cf7dcfa498 Port JS autocompletion to CodeMirror.next, integrate with breakpoint editor
R=tvanderlippe@chromium.org

Bug: 1241848
Change-Id: I1d3ebe78d507a28b58ab7eaf174ec814abb1d4ca
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3132563
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2021-10-11 11:06:45 +00:00
Kateryna Prokopenko 799d1e2b59 Use type-safe events for WorkSpaceImpl
Bug: 1228674
Change-Id: Ib3a67154c3933df4f840a20a77f20d7f42bc046f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3090971
Commit-Queue: Kateryna Prokopenko <kprokopenko@google.com>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2021-08-13 06:59:25 +00:00
Jan Scheffler ad7a2ddd4c [Underscore Migration] Migrate models/formatter
This patch is part of the underscore migration that adds the private
keyword to all properties that start with an underscore and removes the
underscore.

Bug:chromium:1207342
Change-Id: I386ec317f4a944135feba6d40b0d9849c7d4ccdc
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3077893
Commit-Queue: Jan Scheffler <janscheffler@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Jan Scheffler <janscheffler@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-08-06 16:04:06 +00:00
Tim van der Lippe e19929dc74 Add tests for SourceFormatter
This requires us using the environment, as the SourceFormatter relies
on numerous singletons related to workspaces, projects and documents.

This CL gets us to about 50% code coverage. The missing coverage is
mostly in the two mapping classes at the end of the file, which are
more difficult to test. We will do that in a follow-up CL.

R=szuend@chromium.org

Bug: 1009443
Change-Id: I8412b5f6e8053d72cea5110a3b82458388fb9e95
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3056378
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2021-07-29 10:49:19 +00:00
Tim van der Lippe fb38e368e9 Add tests for ScriptFormatter
With these tests, we achieve 100% test coverage (barring the 2
missing branches from the initialization of the setting, which
we can't test in a unit test environment).

I also renamed the fields in the object that is returned, as they
make sense and almost all usages were renaming them anyways.

R=szuend@chromium.org

Bug: 1009443
Change-Id: I3ac6cdf3cca99baf312d0d4e4036e7f95e9ef06d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3056375
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2021-07-27 16:33:09 +00:00
Tim van der Lippe 6df5ce7fbd Return promise instead of using callbacks
This should improve the testability of these functions. Hopefully,
a follow-up CL can introduce some tests for this API.

R=szuend@chromium.org

Bug: none
Change-Id: If0d1884e5abed05520cbc9cfe42c99052550d9ba
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3055240
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2021-07-27 11:29:59 +00:00
Tim van der Lippe ea2fe19c2d Use functions instead of classes for formatter
Both of these classes were performing side-effect work in their
constructor and eventually calling the callback. Instead, these
should become proper functions.

In a follow-up CL, I will also remove the callback and refactor
to return proper promises instead.

R=szuend@chromium.org

Bug: none
Change-Id: I91d91f04c5ade75ee7e124719f1285a8a09a44be
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3053748
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2021-07-27 10:04:09 +00:00
Tim van der Lippe 3c3cd80fc6 Remove FormatterInterface
This class was a remnant of the code structure during the Closure
Compiler era. In ES modules, we no longer need a special class
and instead can explicitly export the relevant functions and
remove the interim class.

R=szuend@chromium.org

Bug: none
Change-Id: Ib6a2bcaef9a1dad462f02a3411b9bef1ee989a34
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3053747
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2021-07-27 09:53:09 +00:00
Tim van der Lippe c2cbf32af8 Remove no-unused-vars suppressions
We don't use this rule any longer. Therefore, any supression of
the rule is considered a no-op. (We use the typescript-eslint
version instead).

R=jacktfranklin@chromium.org

Bug: none
Change-Id: I13595fffc980db423ee8ad5d133fd187d0dbdbbb
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3053746
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2021-07-27 09:48:39 +00:00
Jack Franklin a75ae7cbb3 Enforce import type when importing TS types.
Bug: none
Change-Id: I02ef1182143b7fe091ce92d59f04ac2188903e0d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2886925
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2021-05-11 14:00:22 +00:00
Tim van der Lippe 300f2b3d7b Add GN visibility for models/
Downstream projects can define the devtools_models_visibility in
their `default_args` in their `.gn` file to add any other
dependencies.

R=jacktfranklin@chromium.org

Bug: 1202788
Change-Id: I7e9ab02d3bcb0f76b170f3a5ffe67afb790d6285
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2854687
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-04-28 13:07:14 +00:00
Tim van der Lippe eea44828fe Add GN visibility to all legacy targets
R=jacktfranklin@chromium.org

Bug: 1202788
Change-Id: I47b05c25df571de948ab59e9abcc6a62d0146ff2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2854677
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-04-28 09:57:04 +00:00
Tim van der Lippe bbb43fbe74 Consolidate owners in models/
Not every single person was present in all folders, but these owners
were present in a majority of all folders.

R=yangguo@chromium.org

Bug: 1187573
Change-Id: I4ed38d3e118715ab3ed14bd261095b0c8d54e6e6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2848235
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2021-04-26 13:51:40 +00:00
Tim van der Lippe a9ae810860 Move formatter to models/formatter
R=aerotwist@chromium.org

Bug: 1187573
Change-Id: Idc2b0f88665e276f692515afe667517a4e5ed245
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2831975
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2021-04-19 14:18:33 +00:00