Skip to content

Commit 9cbd7d2

Browse files
committed
"include <file>" command added
1 parent 5d9a1f2 commit 9cbd7d2

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
module Debugger
2+
class IncludeDir < Command # :nodoc:
3+
self.control = true
4+
5+
def regexp
6+
/ ^\s*include\s+(.+?)\s*$/x
7+
end
8+
9+
def execute
10+
file = @match[1]
11+
12+
return if file.nil?
13+
file = realpath(file)
14+
15+
if Command.file_fiter_supported?
16+
Debugger.file_filter.add(file)
17+
print_dir_included(file)
18+
else
19+
print_debug("file filter is not supported")
20+
end
21+
end
22+
23+
class << self
24+
def help_command
25+
'include'
26+
end
27+
28+
def help(cmd)
29+
%{
30+
file-filter include file - adds dir to list of included dirs
31+
}
32+
end
33+
end
34+
end
35+
end

lib/ruby-debug-ide/xml_printer.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,10 @@ def print_variable(name, value, kind)
184184
CGI.escapeHTML(name), kind, CGI.escapeHTML(safe_to_string(value)))
185185
end
186186

187+
def print_dir_included(file)
188+
print("<fileIncluded file=\"%s\"/>", file)
189+
end
190+
187191
def print_breakpoints(breakpoints)
188192
print_element 'breakpoints' do
189193
breakpoints.sort_by{|b| b.id }.each do |b|

0 commit comments

Comments
 (0)