Skip to content

Commit

Permalink
use ::Module for nesting
Browse files Browse the repository at this point in the history
This will fix ruby/vscode-rdbg#65
  • Loading branch information
ko1 committed Oct 24, 2022
1 parent 7f18c82 commit 2542a65
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/debug/server_cdp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,7 @@ def process_cdp args

def search_const b, expr
cs = expr.delete_prefix('::').split('::')
[Object, *b.eval('Module.nesting')].reverse_each{|mod|
[Object, *b.eval('::Module.nesting')].reverse_each{|mod|
if cs.all?{|c|
if mod.const_defined?(c)
mod = mod.const_get(c)
Expand Down
2 changes: 1 addition & 1 deletion lib/debug/server_dap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,7 @@ def process_dap args

def search_const b, expr
cs = expr.delete_prefix('::').split('::')
[Object, *b.eval('Module.nesting')].reverse_each{|mod|
[Object, *b.eval('::Module.nesting')].reverse_each{|mod|
if cs.all?{|c|
if mod.const_defined?(c)
mod = mod.const_get(c)
Expand Down
2 changes: 1 addition & 1 deletion lib/debug/thread_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ def show_consts pat, only_self: false
unless only_self
s.ancestors.each{|c| break if c == Object; cs[c] = :ancestors}
if b = current_frame&.binding
b.eval('Module.nesting').each{|c| cs[c] = :nesting unless cs.has_key? c}
b.eval('::Module.nesting').each{|c| cs[c] = :nesting unless cs.has_key? c}
end
end

Expand Down

0 comments on commit 2542a65

Please sign in to comment.