SketchUp / sketchup-ruby-debugger

Ruby API debugger for SketchUp 2014 and later.
MIT License
78 stars 34 forks source link

Rubymine doesn’t show value of string variables by debugging time #25

Open Rob-Schneider opened 4 years ago

Rob-Schneider commented 4 years ago

I can see it on Win10(64bit) RM2019 -> SUPro2019(english ver) with SURubyDebugger.dll 1.2.0.0 with national encoded symbols in string variables! for example instead dname="1ящик" Rubymine shows in ‘watch’ window dname="1" instead dname="полка" Rubymine shows dname="" other words national symbols has been cutted… But in result of script job in Sketchup all values are work correctly. Only not visible by debugging time in RM.

National symbols was cutted but digit stay in place. Usualy I can see wrong symbols when encoding incorrect. but this case different!

1 2 3 4 5

Perhaps something wrong with my settings! But the tests RM2019 with SU2016 and SURubyDebagger 1.0.2.0 - the variables printed correct.

You can use this script for repeat my case:

require 'sketchup'

module TESTEM
  @arr = %w(тест тест2 3 test)

  def TESTEM.met
    @arr.each do |val|
      puts val
    end
  end
end
thomthom commented 4 years ago

@BugraBarin - any idea of what could cause this regression? Something in SketchUp or in RubyMine?

We do have a known regression where the Ruby Console isn't displaying unicode characters correctly unless you do a puts of the string. Related?

BugraBarin commented 4 years ago

I'm not sure. Maybe a Ruby version upgrade broke it. ?

Rob-Schneider commented 4 years ago

... the tests RM2019 with SU2016 and SURubyDebagger 1.0.2.0 - the variables printed correct. 1 Hmmm. interesting. in SU2016 such as SU2019 you can see echo. The array repeatedly printed after .each puts. Pay attention... in SU2019 wrong encoded...(see the previous screenshot) in SU2016 -correctly. puts command working correctly both cases! I've used Ruby 2.7.0 both cases May be this info will help you.

thomthom commented 4 years ago

in SU2019 wrong encoded...(see the previous screenshot)

hm.. I don't see the encoding being wrong. I see strings created in the Ruby Console appear with UTF-8 encoding, which is what you expect.

However there is a bug there typing just the name of a string variable in the Ruby Console will not display it correctly in the Ruby Console. This is just a Ruby Console bug. The string is fine. It will display correctly if you do puts before the variable name. So there's something we're doing differently when we display the return value of the last eval vs puts.

image

I've used Ruby 2.7.0 both cases

What do you mean by this? Did you replace the Ruby interpreter DLLs for SketchUp?

Rob-Schneider commented 4 years ago

I've used Ruby 2.7.0 both cases

What do you mean by this? Did you replace the Ruby interpreter DLLs for SketchUp?

I've installed 1)RubyMine and 2)ruby 2.7.0 x64 with MSYS2 from https://rubyinstaller.org/downloads/ RM doesn't work without ruby as I understand... May be I should install less version ruby for compatibility?


thomthom commented 4 years ago

I think that might not matter. ...or, maybe in terms of code insight warnings...?