Doesn't have completion/docs for core Ruby modules/classes
Operating System
Ubuntu
Ruby version
3.2
Project has a bundle
- [X] Has bundle
Ruby version manager being used
rbenv
Description
Since I started trying to use it, I've never seen the Ruby-LSP extension have autocomplete or docs (as portrayed in the documentation) for core Ruby modules/classes. I recorded this screencast of setting up a brand new Hello World ruby project in a vanilla VSCode Ruby devcontainer to demonstrate:
https://app.screencast.com/nxu9LQIS0YUWO?conversation=RU4ol9HhxOHuW72wMGEoFh
Steps:
- Make a new directory
- open the directory in VSCode
- Create a new Ubuntu Ruby devcontainer for the project
- Ensure deprecated Ruby extensions are disabled and uninstalled
- Ensure Shopify Ruby and Ruby-LSP extensions are installed and enabled
- Create new Ruby file
- Attempt to use autocomplete/intellisense for core Ruby classes like
IO,Kernel,File...
I feel like I must be doing something wrong, but I've poked around in settings and in the documentation and for the life of me I can't figure out what it is.
Our indexer doesn't handle classes defined in C code yet, which is why they are missing. Constants coming from stdlib should be present as long as they're defined in Ruby.
We are still exploring which path forward will lead to the best results. We can index RBS files, which contain all core definitions.
However, there are gems with native extensions in the ecosystem that do not export RBS files, which would cause us to miss their declarations. We can try indexing the C files from the native extensions using something similar to what RDoc does, but it may still require authors to include the call-seq comments that inform the indexer about declarations.
This issue is being marked as stale because there was no activity in the last 2 months
+1 for this feature. I was just about to create an issue ticket.
Indexing classes and modules from the Core library via RBS has been shipped in v0.17.3.
Indexing Core methods and constants is next. You can follow the progress in https://github.com/Shopify/ruby-lsp/issues/1335.