includes word break characters
(https://github.com/ruby/irb/pull/523)
* Improve method completion for string and regexp that includes word break characters
* Remove completion-test's assert_not_include because candidates no longer include every possible methods
* Add comment about string's method completion regexp
Co-authored-by: Stan Lo <stan001212@gmail.com>
* Add comment about regexp's method completion regexp
Co-authored-by: Stan Lo <stan001212@gmail.com>
---------
aa8128c533
Co-authored-by: Stan Lo <stan001212@gmail.com>
It started to fail since totally unrelated changes. It suddenly gets
killed by SIGTERM only on this environment:
7578344307
For now, we have no idea how to fix this, so let me skip this until we
figure it out.
It's not really about different compilers. It seems confusing to have
this in compilers.yml.
This change only forks the entire workflow and modifies only matrix
entries.
We used `url` field for testing via git clone. Because `Gem::Specification#homepage` or
`Gem::Specification#metadata` could assign non-git url. Unfotunately, We should specify
clone URL for testing.
Current implementation tried to build installation artifact. But default gems
didn't provide normal gem files. So, It's always build failure.
7432842788
ERROR: Error installing pkg/bigdecimal-3.1.4.gem:
ERROR: Failed to build gem native extension.
No such file or directory @ dir_s_mkdir - /Users/runner/.rubies/ruby-head/lib/ruby/gems/3.3.0+0/gems/bigdecimal-3.1.4/ext/bigdecimal/.gem.20230225-2301-2mul99
Gem files will remain installed in /Users/runner/.rubies/ruby-head/lib/ruby/gems/3.3.0+0/gems/bigdecimal-3.1.4 for inspection.
Results logged to /Users/runner/.rubies/ruby-head/lib/ruby/gems/3.3.0+0/extensions/x86_64-darwin-19/3.3.0+0/bigdecimal-3.1.4/gem_make.out
2157aa8ec8
(https://github.com/ruby/irb/pull/529)
Consider completion for this example: `foo.bar.b`
Without type information, it is hard to know the return value of the `bar`
method, so the current implementation interates through `ObjectSpace` to
get all possible candidates for the second method.
In small projects, the performance and accuracy are acceptable. But in
bigger projects, the performance is unacceptable and the accuracy is mostly
poor.
So this commit drops the support for chained methods' completion.
The following script can sometimes trigger a crash:
```ruby
GC.stress = true
class Array
def foo(bool)
if bool
@a = 1
@b = 2
@c = 1
else
@c = 1
end
end
end
obj = []
obj.foo(true)
obj2 = []
obj2.foo(false)
obj3 = []
obj3.foo(true)
```
This is because vm_setivar_default calls rb_ensure_generic_iv_list_size
to resize the iv list. However, the call to gen_ivtbl_resize reallocs
the iv list, and then inserts into the generic iv table. If the
st_insert triggers a GC then the old iv list will be read during
marking, causing a use-after-free bug.
Co-Authored-By: Jemma Issroff <jemmaissroff@gmail.com>
When the test source directory path contains symbolic links, that
directory might be placed earlier in the result of
`IRB::InputCompletor.retrieve_gem_and_system_load_path`, than other
directories in the source tree that are expanded to the real path. In
that case, the test file in "csv" under the test directory of csv gem
instead of the library path will be the first candidate, in
`TestIRB::TestCompletion#test_complete_require_library_name_first`.
```
<"'csv"> expected but was
<"'csv/helper">.
```
```
/path/to/rubygems/test/rubygems/test_gem_commands_exec_command.rb:745: warning: ambiguity between regexp and two divisions: wrap regexp in parentheses or add a space after `/' operator
```
e6a538b5c8
If the main object of the context has `#delete` method, the following
warning is printed.
```
irb: warn: can't alias delete from irb_delete.
```
00b39be61f
passing will and closing notification can conflict and
`Ractor::Selector#empty?` can return wrong answer.
This patch fix it.
```
s = Ractor::Selector.new
s.add Ractor.new{10}
s.add Ractor.new{20}
r, v = s.wait
vs = []
vs << v
r, v = s.wait
vs << v
[*vs.sort, s.empty?]
#=> "[10, 20, false]" (expected "[10, 20, true]")
```