Skip to content

Commit

Permalink
Do not print empty value attr for variable if not needed
Browse files Browse the repository at this point in the history
In case RubyMine-specific protocol extensions are enabled we do not need to print value attr at all
  • Loading branch information
os97673 committed Dec 10, 2014
1 parent e40ead9 commit 1f6c943
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [0.4.24.beta5](https://github.com/ruby-debug/ruby-debug-ide/compare/v0.4.24.beta4...v0.4.24.beta5)

* do not print empty value attr in case RubyMine-specific protocol extensions are enabled

## [0.4.24.beta4](https://github.com/ruby-debug/ruby-debug-ide/compare/v0.4.23...v0.4.24.beta4)

* Performance optimisation for variable representation [RUBY-16055](https://youtrack.jetbrains.com/issue/RUBY-16055)
Expand Down
2 changes: 1 addition & 1 deletion lib/ruby-debug-ide/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Debugger
IDE_VERSION='0.4.24.beta4'
IDE_VERSION='0.4.24.beta5'
end
4 changes: 2 additions & 2 deletions lib/ruby-debug-ide/xml_printer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def print_variable(name, value, kind)
end
value_str = handle_binary_data(value_str)
escaped_value_str = CGI.escapeHTML(value_str)
print("<variable name=\"%s\" %s kind=\"%s\" value=\"%s\" type=\"%s\" hasChildren=\"%s\" objectId=\"%#+x\">",
print("<variable name=\"%s\" %s kind=\"%s\" %s type=\"%s\" hasChildren=\"%s\" objectId=\"%#+x\">",
CGI.escapeHTML(name), build_compact_value_attr(value), kind, build_value_attr(escaped_value_str), value.class,
has_children, value.respond_to?(:object_id) ? value.object_id : value.id)
print("<value><![CDATA[%s]]></value>", escaped_value_str) if Debugger.rm_protocol_extensions
Expand Down Expand Up @@ -371,7 +371,7 @@ def build_compact_value_attr(value)
end

def build_value_attr(escaped_value_str)
Debugger.rm_protocol_extensions ? '' : escaped_value_str
Debugger.rm_protocol_extensions ? '' : "value=\"#{escaped_value_str}\""
end

instance_methods.each do |m|
Expand Down

0 comments on commit 1f6c943

Please sign in to comment.