Closed Bug 1895653 Opened 10 months ago Closed 9 months ago

Linkify relative path of import/export declaration

Categories

(Webtools :: Searchfox, enhancement)

enhancement

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: arai, Assigned: arai)

References

Details

Attachments

(1 file)

Followup of bug 1895316
import and export declarations can use relative path, and that's not covered by bug 1895316.
It would be nice to also linkify them.

require() can also use relative path, but it might be difficult given the argument is not a complete relative path (lacks extension etc)

Depends on: 1896165

There are 3 ways to implement this, based on bug 1896441:

  • (1a) in js-analysis.js, when relative path is found in import/export, load the URL mapping and resolve the relative path on the corresponding URLs, and generate analysis item with URL_* symbol, and let replace-aliases.py replace the URL_* item with FILE_* items
  • (1b) in js-analysis.js, when relative path is found in import/export, load the URL mapping and resolve the relative path on the corresponding URLs, and re-map the URLs to files, and generate analysis item with FILE_* symbol (do not rely on replace-aliases.py given the data is already available)
  • (2) in js-analysis.js, when relative path is found in import/export, generate analysis item with special RELPATH_* symbol, and in replace-aliases.py, replace the RELPATH_* item with FILE_* items

This is definitely your call, but if you're looking for opinions, Option 2 feels most clean/consistent/flexible. That said, it would be potentially weird for the RELPATH symbols to make it past alias processing, so that might be something where it would be important to make sure they get dropped if not normalized there.

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

Attachment

General

Created:
Updated:
Size: