Closed Bug 1801960 Opened 2 years ago Closed 2 years ago

Sticky highlighting and context menu don't work for private fields in ES modules

Categories

(Webtools :: Searchfox, defect)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: aminomancer, Assigned: asuth)

References

Details

Attachments

(2 files)

See UrlbarView.sys.mjs for example. If you hover over one of the private fields (properties prefixed with a hash #), it will not be highlighted and clicking it will not open the context menu. With ESMification, an increasing number of pseudo-private fields (properties prefixed with an underscore _) will probably be converted to real private fields, so Searchfox will be harder to use as that proceeds.

Assignee: nobody → bugmail
Status: NEW → ASSIGNED

The JS analysis was fine here, but the tokenizer didn't think a symbol could start with a #.

Thanks for filing this!

A fix has landed and I've kicked off a mozilla-central indexing run, so we should ideally have this working for m-c in less than 3 hours and working for all the other trees in less than a day. I'll keep an eye on the run I just kicked off in case something weird happens, but this was reasonably straightforward and part of why the problem wasn't noticed is that there were previously no checks because the JS analysis is in such a sorry state that we also just don't have a lot of checks for it. Please do let your manager know if you'd benefit from improved JS indexing, as there is a massive amount of potential improvement that we could accomplish with bug 1740290.

Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED

Awesome! That was the fastest landing I've ever seen 😂
Yeah I was reading through that bug a couple weeks ago, we do work with a lot of jsx/tsx files (e.g. this one) and I had seen your comment on bug 1756018. The sticky highlighting and context menu have been very useful so having that in jsx would be great.

So searchfox still shows "Search for the substring mainContainer" when clicking #mainContainer. Is this something blocked by the SCIP work in bug 1740290 or a simpler bug?

(I mean, it should search for #mainContainer, not mainContainer.)

Flags: needinfo?(bugmail)

That's the client side https://github.com/mozsearch/mozsearch/blob/65a428fa82005a7677b7dbd62dd413a1518dc89e/static/js/context-menu.js#L262. Note that we don't currently have any test infrastructure for actually viewing searchfox in a browser, so this would be a very easy fix for someone, as there's no tests to write! ;)

Flags: needinfo?(bugmail)
Attached file mozsearch PR (deleted) —

I quickly wrote and tested the change and have put up a pull request for Emilio to review.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: