Add back autocompletion for CSS class names
Add back autocompletion for CSS class names

During the CodeMirror 6 upgrade, we inadvertently removed autocompletion
of (among others) CSS class names. The functionality was provided in
https://crrev.com/c/3295489/3/front_end/ui/legacy/components/text_editor/TextEditorAutocompleteController.ts
which was hooked up in CodeMirror 5 internals. While the CodeMirror 5
worked, it was not correctly modeling CSS stylesheets (since it was only
doing textual querying) and therefore we hadn't spotted it as such.

Therefore, update the CodeMirror 6 autocompletion with support for class
names. The functionality uses the `uiSourceCode` (which holds
information about the currently opened file) and the `cssModel` (which
can query information about the stylesheet associated with the current
URL retrieved from the `uiSourceCode`).

Whenever we perform autocompletion, we query these models to obtain the
stylesheet and class names. The information is then fed into the
CodeMirror 6 autocompletion machinery, which renders the
autocompletions. This way, we have context-aware autocompletions, rather
than textual-based heuristics.

Note that this is only partly addressing the regression in
crbug.com/1297491 since the bug also mentions variables and properties.
However, since these require different machinery and it isn't
immediately obvious how to retrieve that information from CDP, I will
fix that in a follow-up.

Screenshot: https://imgur.com/a/9o5ikvF

R=yangguo@chromium.org

Bug: 1297491
Change-Id: Ie561eeed9a828e682e33fed8ad52c571df9b3d72
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3487870
Auto-Submit: Tim Van der Lippe <dba8716ee7f8d16236046f74d2167cb94410f6ed@chromium.org>
Reviewed-by: Johan Bay <c4a91c97e1f8a218202ca733f9e9f5122f475e0f@chromium.org>
Reviewed-by: Changhao Han <68542faf32f0a558a873c0f094ca9bedb2744bff@chromium.org>
Commit-Queue: Tim Van der Lippe <dba8716ee7f8d16236046f74d2167cb94410f6ed@chromium.org>

ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend