Closed Bug 1493675 Opened 4 years ago Closed 4 years ago

Autocomplete popup is annoying when typing `function`


(DevTools :: Console, defect, P1)



(firefox64 fixed)

Firefox 64
Tracking Status
firefox64 --- fixed


(Reporter: nchevobbe, Assigned: nchevobbe)



(Whiteboard: [boogaloo-mvp])


(2 files)

**Steps to reproduce**
1. Open the console
2. Type `func`
3. The autocomplete popup is displayed with `Function` (note the uppercase F).
4. Hit enter

**Actual results**

My input is now `Function`, which might be fine, but actually, I wanted to declare a new function, so I have to go back to the first letter and replace it with a lowercase f.


There's 2 way of fixing this:
 - quick and ugly: filter out "Function" from result when the input is all lowercase
 - nicer: return all the keywords from the autocomplete. Since lowercase items are displayed first, `function` will come before `Function` and the STR will work as I intended.

I'm leaning towards the second solution as it would be a really nice thing to have. But we may not have enough time to put this into 64, and if so, it would be nice to have a quick fix for that.
Whiteboard: [boogaloo-reserve]
So, it looks like there's no existing API to retrieve the list of JS keywords.
The list lives in, and is then processed with a python script [1] (see usage [2]) to generate the file being used by the engine [3]

We could use a similar approach to generate a JS file with all the keywords, which we could then easily use in DevTools code.

Duplicate of this bug: 1494743
Priority: -- → P2
Assignee: nobody → nchevobbe
Priority: P2 → P1
This patch adds a file containing an arrau of all the
JS keywords, extracted from js/src/frontend/ReservedWords.h.
The webconsole autocomplete service then load this array, and
send the matching keywords to the client.
Later, this file will be automatically generated at build time (
See Bug 1499005) in order to be kept in sinc with what the engine
Whiteboard: [boogaloo-reserve] → [boogaloo-mvp]
This list is generated from /js/src/frontend/ReservedWords.h,
which is already used on the platform to generate list of js
reserved words.
This list will be used in the console autocomplete code to
expose those keywords to the user.
Attachment #9017917 - Attachment description: Bug 1493675 - Generate an array of the javascript keywords; r=ochameau. → Bug 1493675 - Generate an array of the javascript keywords; r=arai.
Pushed by
Generate an array of the javascript keywords; r=arai.
Send JS keywords from webconsole's autocomplete service; r=julienw.
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 64
You need to log in before you can comment on or make changes to this bug.