I also tackled the diff_match_patch function...it does not seem worth getting
that into TypeScript, so I've left the nocheck. I did consider updating the code
to export the function rather than have the global, but it's depended on by
CodeMirror and changing it seems risky.
Bug: 1011811
Change-Id: Iffbe69d7dbc424e9d9a6bb1527f218f3e4998326
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2431506
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
QuickOpen is a highly-useful UI affordance for the DevTools. However,
the actual implementation introduces some problems with reusability;
the QuickOpen tool is a global DevTools singleton that coalesces
multiple "Providers" across DevTools to handle activities like Go To
Line, Open document, or Invoke Command. Because it is a singleton, a
developer who wanted to leverage that input modality would need to drop
to the FilteredListWidget, which is tightly coupled to the QuickOpen
implementation and also has a non-obvious implementation pattern (one
would need to implement a Provider, and there is no straightforward way
to observe when the user cancels out of it).
This change borrows a simplified version of the VS Code QuickPick and
QuickInput APIs. With this, a DevTools developer can write a single
line, using an awaitable, so that the meaning and purpose of the input
collection is straightforward:
const text = await QuickInput.show({
prompt: 'Please enter some information.',
value: 'A default value',
valueSelection: [0, 15],
});
// text will contain the entered value, or undefined
QuickPick requires a few more lines to implement, but provides a
similarly easy-to-use interface:
const demoMenu1 = [
{
label: 'Item 1',
},
{
label: 'Item 2',
},
{
label: 'Item 3',
}
];
const choice = await QuickPick.show(demoMenu1, {
placeHolder: 'Choose from these options:'
});
// choice contains one of the objects from demoMenu1, or undefined
The explainer can be found here:
https://docs.google.com/document/d/1EibIlPCeH-672wncOScGoMbSs0EzNY4SSaqJng-5-S4/edit#
... and GIFs of these in action can be found here:
https://imgur.com/a/GCfpHQ3
Bug: 1103402
Change-Id: I1ca7c7c87243553ff45d00369ce8996c2914be93
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2288530
Reviewed-by: Brandon Goddard <brgoddar@microsoft.com>
Commit-Queue: Robert Paveza <Rob.Paveza@microsoft.com>
This patch makes it so that all module.json files use the same
consistent indentation that matches .editorconfig and the rest
of the codebase. At the request of reviewers, one such file
(front_end/emulated_devices/module.json) has been excluded
from this patch. It will be reformatted in a separate CL.
Note that this patch does not “roll CodeMirror”, although a
pre-commit hook forces me to include that phrase in the commit
message because the module.json file in the relevant folder is
modified.
Bug: chromium:1070492
Change-Id: Ib31ed5232461e2f80bf05f31105fc919f6639b0a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2127007
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
The configuration was only including files that were in a commit diff.
This causes issues where we generate sources during the PRESUBMIT (which
are not in the git diff at that point in time) and don't format.
At the same time, we remove the complicated logic to reuse the
`.eslintignore` for clang-format purposes and use the correct
`.clang-format` "DisableFormat" options to disable formatting in various
directories.
Roll CodeMirror: ignore
Change-Id: I21b95a6e09c5d6bf036bf1aace103d6c26823ecc
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2091445
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
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