microsoft / lsif-node

Define an index format for Language Servers
MIT License
172 stars 37 forks source link

Edge from document to packageInformation #133

Open HKalbasi opened 3 years ago

HKalbasi commented 3 years ago

I want to split documents based on packages, and I think it is only possible via looking indirectly through one of exports, and if a document doesn't have exports we can't find its package. So an edge between document and packageInformation can be helpful.

By the way, packageInformation edge is a good candidate for N to 1 edges (outVs)?

dbaeumer commented 3 years ago

Need to think whether a document can belong to more than one package. A document can belong to more than one project.

HKalbasi commented 3 years ago

My thoughts: In languages I'm aware of, packages are mapped to folders, so at worse a file can belong to some nesting packages. If we assume that in every usecase, packages are subsets of each other (or isolated) it is enough to only link to innermost package. Furthermore if we assume that packages have exactly one folder, we can just add uri of the root (so dump would be less bloated) and let the consumers of lsif dump figure out which document is belong to which package, if they want, For example by adding a source vertex.