Closed Bug 1895876 Opened 1 year ago Closed 1 year ago

Linkify resource:// and chrome:// URLs in HTML attributes

Categories

(Webtools :: Searchfox, enhancement)

enhancement

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: arai, Assigned: arai)

References

Details

Attachments

(2 files)

Currently HTML is not target of indexing, but we can reuse the XUL/XBL indexing done by js-analyze
the parser can also handle attributes, and we can linkify chrome/resource URLs there.

One thing to keep in mind when digging into HTML indexing is that we potentially can get a bunch of history/blame synergies if we use tree-sitter. Specifically, for my work on bug 1517978 I created cst_tokenizer.rs which uses tree-sitter's scheme-syntaxed query mechanism in order to allow us to bind tokens to a semantic context (example check output) and also know where the definitions/declarations are (example check output of the "outline" resulting from this).

In the (currently idle WIP) hyperblame effort we compute this information on a per-revision basis to let us do a better job of following token moves/evolutions that might otherwise be regarded as an addition/deletion pair by naive diffing logic. Additionally, it lets us summarize/cross-reference the history of the inferred semantic scopes. For HTML this might allow us to do something like "show me the history of this <form> element and its descendants through time" with that being high resilient to the form being moved around in the HTML document as long as we are able to infer a semi-stable identifier. (A concept of token evolution can allow for us to detect renames and compensate for them.)

I should emphasize that I think you're absolutely right that the existing js-analyze.js logic can probably be repurposed without too much work to get a lot of immediate wins, and for this specific bug I think it's clearly the right choice! I just want to make you aware of my plans there with hyperblame, as I expect as you implement this initial HTML functionality you may think about more sophisticated things we can do, and it would be great for you to be thinking in the back of your mind what might be able to integrate well with history or where you think there would be diminishing returns for investing additional effort into js-analyze.js.

Attached file GitHub Pull Request
Assignee: nobody → arai.unmht
Attached file GitHub Pull Request
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: