jonobr1 / two.js

A renderer agnostic two-dimensional drawing api for the web.
https://two.js.org
MIT License
8.29k stars 454 forks source link

[Enhancement] Code completion hint for `Two.Renderer.setSize()` method #683

Open cdaein opened 1 year ago

cdaein commented 1 year ago

It's not really a bug, but I am not getting code completion (VSCode IntelliSense) when using Two.Renderer.setSize() method in TypeScript.

Renderer gets completion hint:

Screenshot 2023-01-06 at 2 44 40 PM

setSize doesn't:

Screenshot 2023-01-06 at 2 44 52 PM

and after writing the method, no documentation appears:

Screenshot 2023-01-06 at 2 45 05 PM
jonobr1 commented 1 year ago

Hmm, those completion hints are incorrect. Renderers don't have settings or SketchSettings. I'll take a look into this and it should be easy to add the completion hints for methods and properties to the renderers. Thanks

cdaein commented 1 year ago

thanks for the reply. those settings and SketchSetting are the what I defined, so no issues with them. 🙂

jonobr1 commented 1 year ago

This patch should fix your issue: https://github.com/jonobr1/two.js/pull/684