Closed Bug 1761627 Opened 2 years ago Closed 2 months ago

Figure out how to best emit LSIF from searchfox

Categories

(Webtools :: Searchfox, task)

task

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: asuth, Unassigned)

References

Details

As teased by :khuey in https://twitter.com/khuey_/status/1506401296575655936, pernosco is now gaining LSIF-ingesting super powers that are likely to be super helpful. While I think our goal should be to make sure in-tree mozilla-central tooling can produce usable LSIF directly on its own in a rapid fashion (ex: XPIDL compiler, IPDL compiler, WebIDL compiler) for the benefit of writing code in realtime in VS code or other LSP-enabled text editors, it likely makes sense for searchfox to be able to emit LSIF to contribute any higher level cross-referencing, such as might be produced via bug 1727789 and its goal of semantic linkage.

Key notes:

  • The moniker mechanism is how LSIF binds its span-centric graph representation to implementation-specific symbols.
  • LSIF is a normalized graph representation that conceptually corresponds to a combination of searchfox's crossref database for the graph internals combined with the "source" records stored on a per-file basis (and which are then rendered into HTML) to define the token spans and bind them into the graph.
    • This means that searchfox's approach of storing analysis records in files corresponding to the location of the underlying files/tokens references doesn't really work for LSIF because it's expected that everything in the file will then referer to graph nodes that needs to be (immediately) available. Anything consuming the LSIF would still need to read in a central LSIF file, or have consumed all of the individual per-file LSIF files. Because of the graph structure it likely would not be clear how to distribute the internal graph nodes; it's not as clear cut as our C++ structured records unambiguously existing at the point of definition.

Having a better understanding of how VS code extensions, the Language Server Protocol, and SCIP interact as well as funding realities, I think it makes sense to WONTFIX this.

Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.