Skip to content

Commit e418dd6

Browse files
committed
move xml printing details to xml_printer
1 parent b204643 commit e418dd6

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

lib/ruby-debug-ide/commands/expression_info.rb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,7 @@ def self.encoding
4343
incomplete = false
4444
end
4545

46-
@printer.print_pp <<-EOF.gsub(/\n */, ' ').gsub(/>\s+</m, '><').strip
47-
<expressionInfo
48-
incomplete="#{incomplete.to_s}"
49-
prompt="#{last_prompt.gsub('"', '&quot;')}"
50-
indent="#{last_indent.to_s}">
51-
</expressionInfo>
52-
EOF
46+
@printer.print_expression_info(incomplete, last_prompt, last_indent)
5347
end
5448

5549
class << self

lib/ruby-debug-ide/xml_printer.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,11 @@ def print_expressions(exps)
220220
def print_expression(exp, value, idx)
221221
print "<dispay name=\"%s\" value=\"%s\" no=\"%d\" />", exp, value, idx
222222
end
223+
224+
def print_expression_info(incomplete, prompt, indent)
225+
print "<expressionInfo incomplete=\"%s\" prompt=\"%s\" indent=\"%s\"></expressionInfo>",
226+
incomplete, CGI.escapeHTML(prompt), indent
227+
end
223228

224229
def print_eval(exp, value)
225230
print "<eval expression=\"%s\" value=\"%s\" />", CGI.escapeHTML(exp), value

0 commit comments

Comments
 (0)