So this has been a longstanding issue but it looks like no one has filed a proper bug for it.
Consider the following snippet
class biz {}
class foobar extends biz{
foo(){
let bar = 100
return bar
}
}
If you pasted this into Superpowers as it's own script, the return bar line would highlight bar because it recognizes bar is a variable that was declared within scope. This is good, I like this! (note: github does not do this aforementioned highlighting, you'll have to fire up SP and see for yourself)
However if I add private baz = 5; or some variant to the foobar class then this syntax highlighting breaks for some reason. (note: private baz; with no assignment does NOT break). However more troubling is that if I change the extends call to a class that contains a . like say Sup.Behavior it also breaks. Considering that most use cases involve extending from Sup.Behavior this is rather frustrating. As a workaround you can declare let SupBehavior = Sup.Behavior and then only extend from that and only assign to your private/public fields in awake() but that's kind of silly.
So this has been a longstanding issue but it looks like no one has filed a proper bug for it.
Consider the following snippet
If you pasted this into Superpowers as it's own script, the
return bar
line would highlightbar
because it recognizesbar
is a variable that was declared within scope. This is good, I like this! (note: github does not do this aforementioned highlighting, you'll have to fire up SP and see for yourself)However if I add
private baz = 5;
or some variant to thefoobar
class then this syntax highlighting breaks for some reason. (note:private baz;
with no assignment does NOT break). However more troubling is that if I change theextends
call to a class that contains a.
like saySup.Behavior
it also breaks. Considering that most use cases involve extending from Sup.Behavior this is rather frustrating. As a workaround you can declarelet SupBehavior = Sup.Behavior
and then only extend from that and only assign to your private/public fields inawake()
but that's kind of silly.Thank you.