Skip to content

Commit 2542a65

Browse files
committed
use ::Module for nesting
This will fix ruby/vscode-rdbg#65
1 parent 7f18c82 commit 2542a65

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

lib/debug/server_cdp.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -998,7 +998,7 @@ def process_cdp args
998998

999999
def search_const b, expr
10001000
cs = expr.delete_prefix('::').split('::')
1001-
[Object, *b.eval('Module.nesting')].reverse_each{|mod|
1001+
[Object, *b.eval('::Module.nesting')].reverse_each{|mod|
10021002
if cs.all?{|c|
10031003
if mod.const_defined?(c)
10041004
mod = mod.const_get(c)

lib/debug/server_dap.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,7 @@ def process_dap args
911911

912912
def search_const b, expr
913913
cs = expr.delete_prefix('::').split('::')
914-
[Object, *b.eval('Module.nesting')].reverse_each{|mod|
914+
[Object, *b.eval('::Module.nesting')].reverse_each{|mod|
915915
if cs.all?{|c|
916916
if mod.const_defined?(c)
917917
mod = mod.const_get(c)

lib/debug/thread_client.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ def show_consts pat, only_self: false
568568
unless only_self
569569
s.ancestors.each{|c| break if c == Object; cs[c] = :ancestors}
570570
if b = current_frame&.binding
571-
b.eval('Module.nesting').each{|c| cs[c] = :nesting unless cs.has_key? c}
571+
b.eval('::Module.nesting').each{|c| cs[c] = :nesting unless cs.has_key? c}
572572
end
573573
end
574574

0 commit comments

Comments
 (0)