Skip to content

Commit 0030b1d

Browse files
committed
DAP: cut off dap_eval method
1 parent 8303164 commit 0030b1d

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

lib/debug/server_dap.rb

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,14 @@ def value_inspect obj, short: true
737737
end
738738
end
739739

740+
def dap_eval b, expr, _context, prompt: '(repl_eval)'
741+
begin
742+
b.eval(expr.to_s, prompt)
743+
rescue Exception => e
744+
e
745+
end
746+
end
747+
740748
def process_dap args
741749
# pp tc: self, args: args
742750
type = args.shift
@@ -874,12 +882,7 @@ def process_dap args
874882

875883
case context
876884
when 'repl', 'watch'
877-
begin
878-
result = b.eval(expr.to_s, '(DEBUG CONSOLE)')
879-
rescue Exception => e
880-
result = e
881-
end
882-
885+
result = dap_eval b, expr, context, prompt: '(DEBUG CONSOLE)'
883886
when 'hover'
884887
case expr
885888
when /\A\@\S/

0 commit comments

Comments
 (0)