Add completion for require relative #1211
Labels
enhancement
New feature or request
good-first-issue
Good for newcomers
pinned
This issue or pull request is pinned and won't be marked as stale
We currently have completion for regular requires, which search the indexed files based on require paths. We can also provide
require_relative
completion, which would be a nice improvement.I think the implementation would be something like this:
CallNode
instead ofStringNode
ruby-lsp/lib/ruby_lsp/requests/completion.rb
Line 58 in e5a2c89
require
and execute the current implementationrequire_relative
, then we want torequire_relative "../something/"
, we need to expand it to the absolute path usingPathname
Dir.glob("#{absolute_path}/**/*.rb")
The text was updated successfully, but these errors were encountered: