Aerilius / sketchup-console-plus

A better Ruby Console and IDE for integrated development in SketchUp.
MIT License
42 stars 16 forks source link

Highligher for array of points? #10

Closed thomthom closed 7 years ago

thomthom commented 7 years ago

Often you have arrays of points, representing polygons.

Do you think it'd be possible to detect such arrays in the output buffer and create a highlighter for that? Hover over each point is nice to pick out individual points, but maybe if you hovered over the array brackets it displayed everything?

Challenge is that some points you want to just display a point set, some times segments. Maybe simple toggle modes in the visualizer?

Aerilius commented 7 years ago

It would be feasible to add a regexp for arrays of points (containing nothing but points). But then you also want to know which coordinates correspond to a specific visualized point.

but maybe if you hovered over the array brackets it displayed everything?

That is a good idea.

thomthom commented 7 years ago

I need to poke into your visualisation engine for this extension. I expect when I start poking more into this I'll want to add more visualizers. (For the new InstancePath etc.)

I'd rather send our PRs than open requests.

Aerilius commented 7 years ago

It would probably be best to have a better extensible highlighter infrastructure (use registered highlighters instead of a if conditions). It's a bit tricky, because it is scattered in several places:

Arrays cannot be recognized by regular expressions because they stretch over multiple html elements (multiple tokens). I have some working code that uses a different approach and traverses the html nodes.

Aerilius commented 7 years ago

Added branch feature-highlight_array

Aerilius commented 7 years ago

Merged feature branch with commit eb18ea953fc552b1a9fe1433f67606da39886a68