microsoft / lsif-node

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

Create LSIF dumps by querying arbitrary language servers #134

Closed vberlier closed 11 months ago

vberlier commented 3 years ago

All the LSIF implementations I came across are tightly coupled to a specific underlying tool. I was wondering if it would be possible to create LSIF dumps by going through the language server protocol. The idea is that the you would be able to plug any existing language server and the LSIF utility would act as a client and progressively crawl the entire codebase. I understand it would probably be a lot less efficient than current implementations like lsif-tsc but it would open up LSIF to a lot of languages for free. I think a language agnostic LSIF utility would be very useful. I want to know if it's something that has already been considered, or if it already exists and I just missed it somehow.

dbaeumer commented 3 years ago

We tried this and it is extremally slow for find all references.

vberlier commented 2 years ago

I see. My motivation for this would be using LSIF as a source of truth for a generic utility that can display hover information on code examples, similar to what twoslash currently does for typescript. I started investigating how I could do this for Python in a discussion on the Pyright repo, and it looks like the sourcegraph team will revisit https://github.com/sourcegraph/lsif-py at some point and make it work with Pyright (it only works with Jedi currently). This should cover my most immediate use-case but I'd still be interested in a generic language server crawler/scrapper. Even if it's slow it would make LSIF instantly available to dozens of languages, and depending on the use-case (e.g.: running it once when building docs) it would probably be fine for a lot of projects. If something like lsif crawl --stdout pyright-langserver -- --stdio isn't completely off the table I could look into it next week.

dbaeumer commented 11 months ago

The feature has not gain any traction in the community. I therefore close the issue. Still a big Thank You to you for taking the time to create this issue! To learn more about how we handle feature requests, please see our documentation.

Happy Coding!