microsoft / lsif-node

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

Question: to what extent is it possible to generate LSIF simply by querying an LSP server? #128

Closed keyboardDrummer closed 3 years ago

keyboardDrummer commented 3 years ago

I get the impression LSIF index generating tools are commonly created next to an already existing LSP server for a language. What is the reason we can't re-use the LSP server to create the LSIF index?

Given a documentSymbol request it seems possible to query what symbols are available in a file, and from there we can make definition, references and other requests to populate most of the LSIF index.

What are the reasons it's difficult/impossible to generically wrap an LSP server to generate an LSIF index?

I can imagine issues like:

Are any of the above an issue, or others?

dbaeumer commented 3 years ago

@keyboardDrummer using an existing LSP server to create an index is totally possible. The LSP specification even has moniker support now. The reason for having a separate tool is mainly speed. Generating all references with an LSP server takes usually forever.

However the long term goal is to have it integrated into the compiler / language server tool chain so that you don't need to install yet another tool.

OK to close?

keyboardDrummer commented 3 years ago

Makes sense, feel free to close :)