Skip to content
This repository was archived by the owner on Mar 5, 2021. It is now read-only.

[BUG] Syntax Highlighting doesn't work when fields are initialized within a class definition or when "extends Sup.Behavior" keyword is used #189

@notexplosive

Description

@notexplosive

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.

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions