You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# typed: true[1].map(&:ev)# ^ completion: even?, ...# Note that Sorbet treats this like this:[1].mapdo |*__block_pass__|
__block_pass__[0].ev(*__block_pass__[1,2147483647])end
Observed output
begin
<emptyTree>
class <emptyTree><<C <root>>> < (::<todo sym>)
def self.<static-init><<static-init>$156>(<blk>)
begin
[1].map() do |*<block-pass>$2$1|
::<Magic>.<call-with-splat>(<block-pass>$2$1.[](0), :ev, ::<Magic>.<splat>(<block-pass>$2$1.[](1, 2147483647)), nil)
end
[1].map() do |*__block_pass__$2|
::<Magic>.<call-with-splat>(__block_pass__$2.[](0), :ev, ::<Magic>.<splat>(__block_pass__$2.[](1, 2147483647)), nil)
end
<emptyTree>
end
end
end
<emptyTree>
end
editor.rb:3: Method ev does not exist on Integer https://srb.help/7003
3 |[1].map(&:ev)
^^^
Got Integer originating from:
editor.rb:3:
3 |[1].map(&:ev)
^
editor.rb:8: Method ev does not exist on Integer https://srb.help/7003
8 | __block_pass__[0].ev(*__block_pass__[1, 2147483647])
^^
Got Integer originating from:
editor.rb:8:
8 | __block_pass__[0].ev(*__block_pass__[1, 2147483647])
^^^^^^^^^^^^^^^^^
Errors: 2
Expected behavior
At the position indicated by the ^ completion assertion, Sorbet should be able to produce a list of completion items that starts with even?
Note that really supporting this well might involve making Sorbet recover better from programs like these:
[1].map(&:)
Right now Sorbet's parse result for this program doesn't keep around anything that we might be able to use to recover the fact that there's a block pass (&) here.
We might be able to make Sorbet parse this like
[1].map(&:'')
But that might be a pretty big yak shave, so we don't need to block the completion feature on it.
The text was updated successfully, but these errors were encountered:
jez
added
enhancement
New feature or surprising current feature
IDE
Relating to Sorbet's LSP server or VS Code extension
labels
Apr 17, 2024
Input
→ View on sorbet.run
Observed output
Expected behavior
At the position indicated by the
^ completion
assertion, Sorbet should be able to produce a list of completion items that starts witheven?
Note that really supporting this well might involve making Sorbet recover better from programs like these:
Right now Sorbet's parse result for this program doesn't keep around anything that we might be able to use to recover the fact that there's a block pass (
&
) here.We might be able to make Sorbet parse this like
But that might be a pretty big yak shave, so we don't need to block the completion feature on it.
The text was updated successfully, but these errors were encountered: