I made a plugin with the brand new Script Editor API Beta Feature to handle Roact code completions. Note that you will have to manually enable the beta feature first for the plugin to work!
Things it completes
Static members of the Roact library
Code snippets for filling in lifecycle methods:
→
Understands private fields:
Understands props / state fields:
Fills in Instance types in createElement:
Knows Instance and Component props in createElement bodies:
Can auto-fill all props for convinience:
→
Enjoy, and let me know if I missed anything you had hoped for!
This is amazing! It was very annoying to deal with huge stack traces trying to understand what you did wrong… then it turned out to be simply a typo. Definitely something every Roact user should have installed.
Just a bit confused on how to enable the new autocomplete API. I have ‘Script Editor API’ beta enabled and even ‘AutocompleteAPI’ flag forced on, still getting relevant errors.
As I said, its related to the autocomplete APIs missing, and I cannot to get them to work. ‘AutocompletionItemKind is not a valid member of Enum’ is the error I’m getting. You don’t need to worry about this as it’s not your fault, just cleared up a misunderstanding.
Sounds like you’re running a significantly out of date copy of Studio. Have you updated recently? These APIs are hot off the press so if you last updated a couple weeks ago you may not have them.
It wasn’t possible until literally a few weeks ago, so you’re not out of the loop!
i noticed when you use a different variable name than the name you supplied to extend, the autocomplete doesnt work. theres no support for setState method auto complete as well. Context’s dont auto complete Provider/Consumer and the render callback and value property doesnt get detected in the property field. with portals they dont support auto complete for the target property.
Hey, i have an issue with he autocomplete, how did you get it to replace the current line you are typing with the new code. Using RegisterAutocompleteCallback does not replace the current line, it just makes a new one ontop.