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

Completion of require_relative path is wrong when Dir.pwd != __dir__ #766

Open
tompng opened this issue Nov 18, 2023 · 1 comment
Open

Comments

@tompng
Copy link
Member

tompng commented Nov 18, 2023

Description

Prepare these directory and files

$ mkdir foo
$ echo binding.irb > foo/foobar.rb
$ echo "require'./foo/foobar.rb'" > main.rb

Then execute ruby main.rb

$ ruby main.rb
From: /Users/tomoya.ishida/Desktop/tmp/foo/bar.rb @ line 1 :

 => 1: binding.irb

irb(main):002> require_relative 'f
                                'foo/foobar

The completion should be 'foobar, not 'foo/foobar.
require_relative will load relative path from __dir__, not from pwd.

Result of irb_info

Ruby version: 3.2.2
IRB version: irb 1.9.0 (2023-11-11)
InputMethod: RelineInputMethod with Reline 0.4.0
Completion: Autocomplete, RegexpCompletor
RUBY_PLATFORM: arm64-darwin22
LANG env: ja_JP.UTF-8
East Asian Ambiguous Width: 1

Terminal Emulator

Terminal.app

Setting Files

No

@tompng
Copy link
Member Author

tompng commented Dec 29, 2023

Solved in TypeCompletor(repl_type_completor 0.1.2), problem remains in RegexpCompletor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant