Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use yard directly in SketchUp? #2

Open
Aerilius opened this issue Aug 4, 2017 · 3 comments
Open

Use yard directly in SketchUp? #2

Aerilius opened this issue Aug 4, 2017 · 3 comments
Labels

Comments

@Aerilius
Copy link
Owner

Aerilius commented Aug 4, 2017

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.

  • We would not have to generate the extracts using yard2hash.rb and could directly load any custom .yardoc.
  • DocProvider.get_info_for_doc_path(doc_path) could be replaced by YARD::Registry.at(doc_path)
  • Yard supports inheritance in its lookups, which our type inference by documentation does not have yet.
  • Ease of installation? We would depend on a gem that needs to be installed first.
  • Memory consumption? It would load much more code into SketchUp and add more complexity.
@thomthom
Copy link

thomthom commented May 3, 2019

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
Copy link
Owner Author

Aerilius commented May 3, 2019

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
Copy link

thomthom commented May 3, 2019

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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants