Open Bug 896969 Opened 7 years ago Updated 2 years ago

Experiment with dictionary based weighted auto completion


(DevTools :: General, defect)

Windows 7
Not set


(Not tracked)


(Reporter: Optimizer, Unassigned)



The main idea behind is here[0]. Basically, alphabetically chosen first entry is not always what the user wants and thus the user will have to navigate to the desired entry (or type enough characters to make the desired entry as the first suggestion) wherever a popup based suggestion is used.

Right now (or in near future) in DevTools, popup based suggestions are made at :

1) Debugger's search for
 - script names
 - function names
2) Inspector's search for selectors [Although this one already has weighted suggestions based on # of occurrence of the selector]
3) CSS completions in
 - Rule view (property name and value)
 - Markup Panel attribute editing
 - Style editor (property name and value)
4) Web Console JSTerm suggestions.

The idea is to create a centralized Dictionary system where anyone can create a persistent-across-sessions dictionary using a uuid and then update the dictionary as the user chooses things from the suggestions. A sample structure of the dictionary would be:

   word: "someWord",
   weight: 4

(implementation can be done using hashmap)

This way the suggestion popup will be able to highlight the most favorable/desired suggestion based on user history as the user uses the dictionary.

This will allow us to auto select "getElementById" as soon as the user does "document.g" instead of selecting "getAnonymousElementByAttribute" . Or, "display" when the user types "d" in rule view instead of "direction".

We can also have a sample/default dictionary for some cases like JSTerm and CSS Properties where we can give a higher weight to some known more preferred suggestions.

[0] :
Duplicate of this bug: 919817
Here is a script that was ran against a list of popular websites done to come up with a default weighting for the CSS dictionary:

Relevant webkit bug:
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.