[wp-trac] [WordPress Trac] #42213: Code Editors: Filter autocomplete suggestions
WordPress Trac
noreply at wordpress.org
Tue Oct 17 17:54:19 UTC 2017
#42213: Code Editors: Filter autocomplete suggestions
--------------------------+------------------
Reporter: melchoyce | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 4.9
Component: General | Version:
Severity: normal | Resolution:
Keywords: | Focuses:
--------------------------+------------------
Comment (by WraithKenny):
The proof of concept patch is a working patch showing what would be needed
to achieve the functionality.
(To test the patch, please enable `SCRIPT_DEBUG` as it currently breaks
the grunt build step because of the class syntax.)
The patch uses a couple utilities from Chrome's dev tools, most
significantly, the `CSSMetadata` class, which does all of the work. (and a
shim for `Array.pushAll()`.)
It also copies out a few of CodeMirror's own utilities. (a helper function
from the `CSS` mode, and the default bundled `css-hint.js` for
modification.)
This is really raw code, and a number of improvements can be made to
improve it:
* Trim out unneeded code from `SDK.CSSMetadata`
* Organize the new code into the main file better
* redo `getPropertyName()`
* maybe not show so many vendor-prefixed values
The code isn't fully complete either. We'd have to import more of the dev
tools, specifically, wherever `Common.Color` is defined. (color based
properties are erroring.)
Basically, this shows it can be done, it's just a lot of code.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/42213#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list