Skip to content

Commit 1f6c943

Browse files
committed
Do not print empty value attr for variable if not needed
In case RubyMine-specific protocol extensions are enabled we do not need to print value attr at all
1 parent e40ead9 commit 1f6c943

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

ChangeLog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## [0.4.24.beta5](https://github.com/ruby-debug/ruby-debug-ide/compare/v0.4.24.beta4...v0.4.24.beta5)
2+
3+
* do not print empty value attr in case RubyMine-specific protocol extensions are enabled
4+
15
## [0.4.24.beta4](https://github.com/ruby-debug/ruby-debug-ide/compare/v0.4.23...v0.4.24.beta4)
26

37
* Performance optimisation for variable representation [RUBY-16055](https://youtrack.jetbrains.com/issue/RUBY-16055)

lib/ruby-debug-ide/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module Debugger
2-
IDE_VERSION='0.4.24.beta4'
2+
IDE_VERSION='0.4.24.beta5'
33
end

lib/ruby-debug-ide/xml_printer.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def print_variable(name, value, kind)
172172
end
173173
value_str = handle_binary_data(value_str)
174174
escaped_value_str = CGI.escapeHTML(value_str)
175-
print("<variable name=\"%s\" %s kind=\"%s\" value=\"%s\" type=\"%s\" hasChildren=\"%s\" objectId=\"%#+x\">",
175+
print("<variable name=\"%s\" %s kind=\"%s\" %s type=\"%s\" hasChildren=\"%s\" objectId=\"%#+x\">",
176176
CGI.escapeHTML(name), build_compact_value_attr(value), kind, build_value_attr(escaped_value_str), value.class,
177177
has_children, value.respond_to?(:object_id) ? value.object_id : value.id)
178178
print("<value><![CDATA[%s]]></value>", escaped_value_str) if Debugger.rm_protocol_extensions
@@ -371,7 +371,7 @@ def build_compact_value_attr(value)
371371
end
372372

373373
def build_value_attr(escaped_value_str)
374-
Debugger.rm_protocol_extensions ? '' : escaped_value_str
374+
Debugger.rm_protocol_extensions ? '' : "value=\"#{escaped_value_str}\""
375375
end
376376

377377
instance_methods.each do |m|

0 commit comments

Comments
 (0)