Aerilius / sketchup-console-plus

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

Use yard directly in SketchUp? #2

Open Aerilius opened 7 years ago

Aerilius commented 7 years ago

Currently we rely for type inference on return types extracted from yardoc documentation. These extracts (in the apis directory) also contain description and parameter information to generate documentation tooltips.

thomthom commented 5 years ago

Have a look at solargraph: https://github.com/castwide/solargraph

It does this - uses YARD to power it's code-insight and auto-complete. You see it in action in editor extensions like for VSCode: https://github.com/castwide/vscode-solargraph

Example project setup for VSCode using Solargraph and the SketchUp Ruby API stubs: https://github.com/SketchUp/sketchup-extension-vscode-project

Aerilius commented 5 years ago

I have considered it.

It would multiply the size of this extension and require starting and properly shutting down the language server as a separate background process. It would be interesting to look into how to integrate it with information about live references in SketchUp's Ruby ObjectSpace.

It would be cool, but the effort is probably rather worth it if more people actually used it / knew about it. Currently, Ruby Console+ seems not to be the/a tool mentioned in education.

thomthom commented 5 years ago

It would be interesting to look into how to integrate it with information about live references in SketchUp's Ruby ObjectSpace.

In my experience ObjectSpace can be slow. I used it once in code that ran in a validation proc and it caused SketchUp to consume 100% of that CPU (while still being responsive though.)

Currently, Ruby Console+ seems not to be the/a tool mentioned in education.

I got plans to mention it in a developer blog article at some point. Want to focus more on educating extension developers about all the tools out there. This one has some unique features I want to highlight. (All too often I write small scripts to visualize data - only to remember that Console+ does have some of it already.)