-
Notifications
You must be signed in to change notification settings - Fork 151
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
Output index in lsif format #1050
Comments
Thank you for the feature suggestion! Do you know how the exported LSIF is used by online tools? For example, if we were to expose an executable command to index and dump the LSIF:
In terms of implementation, I think we should create an index exporting structure. Basically, we can have an abstract exporter that defines the interface and then we can create multiple exporters for LSIF, SCIP or any other formatter. That would also benefit caching (#1009 and #1040) since we could have a similar structure for importers. I'm thinking something like this: module RubyIndexer
class Exporter
extend T::Sig
extend T::Helpers
abstract!
sig { params(index: Index).void }
def initialize(index)
@index = index
end
sig { abstract.void }
def export; end
end
class LsifExporter < Exporter
def export
# Whatever needs to happen to generate the LSIF file
end
end
end |
The way I see it, there's two options:
This is usually handled by CI. For reference, here's how GitLab uses the index - https://docs.gitlab.com/ee/user/project/code_intelligence.html Sourcegraph also uses it for code navigation - https://docs.sourcegraph.com/code_navigation |
Thank you for the context. Yeah, indeed I think providing an executable for the indexer will make the most sense 👍. |
sourcegraph is now using scip and have an indexer already built https://github.com/sourcegraph/scip-ruby |
I have checked that this feature is not already implemented
Use case
Lots of tools online use the
lsif
file format to provide "smart" features related to a codebase. One of them is navigating around the codebase by clicking on class names in SCM tools (like GitLab). This project generates an index internally, used for navigating though the codebase, but it's not dumped to a file, and it doesn't use thelsif
format.Description
The index that
ruby-lsp
generates is dumped into alsif
file that I can use with other tools.Implementation
No response
The text was updated successfully, but these errors were encountered: