I3oris / ic

REPL Interface wrapping Crystal Interpreter (crystal-i).
MIT License
49 stars 2 forks source link

Highlight issue for the inspect of object. e.g #<Proc(Nil):0x7f2fd9a5f600:closure>) #12

Closed zw963 closed 3 months ago

zw963 commented 2 years ago

Following is a screenshot:

image

Following is text version:

ic(1.6.1):pry> cli.class.commands
 => {"help" => Procodile::CliCommand(@name="help", @description="Shows this help output", @options=nil, @callable=#<Proc(Nil):0x7f2fd9a5f600:closure>), "kill" => Procodile::CliCommand(@name="kill", @description="Forcefully kill all known processes", @options=nil, @callable=#<Proc(Nil):0x7f2fd9afe780:closure>), "start" => Procodile::CliCommand(@name="start", @description="Starts processes and/or the supervisor", @options=nil, @callable=#<Proc(Nil):0x7f2fd770da00:closure>)}

thanks

I3oris commented 2 years ago

Thank you @zw963!

The coloration is correct, there is a hashtag so it's parsed as comment until the end of line. What is not correct is to use regular highlighter for inspect object. It should use a special highlighter that parse the structure and colorize it well (#<Type:0xaddress ivars>), which need to be created. I could maybe make it, but I need some time to do so though.