Skip to content
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

Doesn't have completion/docs for core Ruby modules/classes #1772

Closed
1 task done
avdi opened this issue Nov 24, 2023 · 5 comments
Closed
1 task done

Doesn't have completion/docs for core Ruby modules/classes #1772

avdi opened this issue Nov 24, 2023 · 5 comments
Labels
bug Something isn't working pinned This issue or pull request is pinned and won't be marked as stale transferred This issue was transferred from vscode-ruby-lsp

Comments

@avdi
Copy link

avdi commented Nov 24, 2023

Operating System

Ubuntu

Ruby version

3.2

Project has a bundle

  • 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:

  1. Make a new directory
  2. open the directory in VSCode
  3. Create a new Ubuntu Ruby devcontainer for the project
  4. Ensure deprecated Ruby extensions are disabled and uninstalled
  5. Ensure Shopify Ruby and Ruby-LSP extensions are installed and enabled
  6. Create new Ruby file
  7. Attempt to use autocomplete/intellisense for core Ruby classes like IO, Kernel, File...
@avdi avdi added the bug Something isn't working label Nov 24, 2023
@avdi avdi changed the title Doesn't have completion/docs for core Ruby modules Doesn't have completion/docs for core Ruby modules/classes Nov 24, 2023
@avdi
Copy link
Author

avdi commented Nov 24, 2023

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.

@vinistock
Copy link
Member

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.

Copy link
Contributor

This issue is being marked as stale because there was no activity in the last 2 months

@github-actions github-actions bot added the Stale label Jan 27, 2024
@vinistock vinistock added pinned This issue or pull request is pinned and won't be marked as stale and removed Stale labels Jan 29, 2024
@aamehedi
Copy link

aamehedi commented Feb 5, 2024

+1 for this feature. I was just about to create an issue ticket.

@st0012 st0012 transferred this issue from Shopify/vscode-ruby-lsp Mar 18, 2024
@st0012 st0012 added the transferred This issue was transferred from vscode-ruby-lsp label Mar 18, 2024
@vinistock
Copy link
Member

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 #1335.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pinned This issue or pull request is pinned and won't be marked as stale transferred This issue was transferred from vscode-ruby-lsp
Projects
None yet
Development

No branches or pull requests

4 participants