-
Notifications
You must be signed in to change notification settings - Fork 809
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LSIF confusion #680
Comments
I think my main source of confusion here is to do with the imports example. The file is set to |
I'm confused about the cross-projet GTD too. Different from TS, for the Java project, a lot of projects are managed by Maven/Gradle. The external dependencies are in the form of |
Sorry for the long delay. I push a change today about how the monikers work. In principal they stay the same, but the do have some details which help to explain how this will work. The two big changes are:
In addition a moniker can be linked to a package information which can carry version information. With the the Java problem can be solved as follows:
I would actually go with the second solution since it makes the dump self contained. Basically it will contain the Java jar declarations as virtual documents. Let me know if this helps? |
@dbaeumer Thank you for the reply. The idea of the virtual document looks great! A new question from my side is that: will there be a spec for the virtual document part? For example, how should it be stored with the dump file. Guessing the same problem also exists in other languages, like C# maybe. |
Hey @jdneo, the spec for this is to add a property |
@arjun27 Yes, that answers my questions. Thank you for your help. 👍 |
Hi @dbaeumer, Sorry I was working on some other stuff the days before and just started to revisit the Java LSIF these days. Regarding the moniker, it's clear that in the One thing I'm still confusing is about the Thanks. //cc @arjun27 |
@jdneo yes, a exported symbol should have a moniker as well. The moniker can of course only have a This being said we are working on a new version of the LSIF spec which will ease this since it will support moniker mapping. So the Java exporter can make all moniker java specific and then a second tool can map them for example to Maven specific monikers including package information. |
Thank you @dbaeumer for the explanation. Does that mean: Both the import and export moniker can point to the By saying |
@jdneo yes, two monikers can point to one package information.
I am in the process of implementing it right now. Will post something in the LSIF repository when available. |
Thank you @dbaeumer for your information. May I ask when the new spec will be updated? Just an estimated approximate time could be helpful! Thanks. |
Beginning of July :-) |
@dbaeumer Perhaps I missed this, but I could not find any reference to when a client should use LSIF vs server.
|
@Avi-D-coder the main use case for LSIF is right now read-only browsing. The experience shows that generating the file is as expensive as starting a LS for single projects. A win can only be seen of multi project workspaces where the user edits leaf projects in the dependency tree. |
Closing the issue. I see that LSIF has potential aside rea-only scenarios but it is nothing I am actively working on right now. |
I am trying to implement a program which generates the LSIF files as specified in #623 but am struggling to understand how cross-package references are supposed to work.
Question 1
In my mental model, what should happen is that each package generates its own LSIF file. Called
lsif.json
which contains the indicies for a specific package. Then in a local project, I generate alsif.json
file which includes theselsif.json
files from whereever they are stored.However, is it intended that all these
lsif.json
files are combined together so that there is one lsif.json file for a project which copies in thelsif.json
files from dependencies?Question 2: URIs
For a single file which exists on disk it is clear the URI should be something like:
However, if an external package distributes an LSIF file what should it declare its URI as?
In the first case our decision is forced because vscode requests information about
file://...
from the language server. Is this a situation to set the URI to a URL or embed the module content in usingdata
?Question 3: Confusing example from imports section
In the following example, the
observablemap.d.ts
module is imported but the node76
is not usedanywhere in the example so it's not clear what the point of it is. Can this please be clarified?
cc @dbaeumer
Could you also please provide complete
.json
dumps of the examples in the specification as it's hard to verify if the JSON produced is correct when only fragments are included.The text was updated successfully, but these errors were encountered: