Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

constructor is no longer highlighted #191

Closed
mnquintana opened this issue Aug 5, 2015 · 8 comments
Closed

constructor is no longer highlighted #191

mnquintana opened this issue Aug 5, 2015 · 8 comments
Labels

Comments

@mnquintana
Copy link
Contributor

Although constructor is tokenized correctly, it now has no highlighting (in One Dark Syntax) as of Atom 1.0.4.

Example

class Overlay {
  constructor(map) {
    this.map = map;
  }

  getMap() {
    return this.map;
  }
}

My guess is that this has something to do with #184.

/cc @50Wliu

@mnquintana mnquintana added the bug label Aug 5, 2015
@winstliu
Copy link
Contributor

winstliu commented Aug 5, 2015

This is because one-dark doesn't generically color .entity (which would cover .entity.name.constructor and .entity.name.function, which is also used a lot), only .entity.name.type and .entity.other.inherited-class.
/cc @simurai

@simurai
Copy link
Contributor

simurai commented Aug 6, 2015

Coloring only .entity would affect other places.. for example in CSS the :: in ::before.

We could add .entity.name.constructor?

  1. Should it look the same as the getMap() function?
  2. Do other languages also define a .entity.name.constructor or is that only in JavaScript?

@mnquintana
Copy link
Contributor Author

Maybe it could also have .entity.name.function too?

@winstliu
Copy link
Contributor

winstliu commented Aug 6, 2015

I'm definitely open to a name change 😄. Don't have much experience with how to properly name these things.

@Victorystick
Copy link
Contributor

How do languages like Java, C etc. manage their constructors? Should JS do something similar?

Perhaps entity.name.function.constructor would work? Its syntax pretty much like any function (or method).

@winstliu
Copy link
Contributor

winstliu commented Aug 7, 2015

When #146 gets updated (I'm working on that right now), we'll also have .entity.name.property. What about adding .entity.name instead of just .entity?

And @Victorystick's/@mnquintana's suggestions sound good.

@MaximSokolov
Copy link
Contributor

Perhaps entity.name.function.constructor would work? Its syntax pretty much like any function (or method).

👍

@winstliu
Copy link
Contributor

Wow, I just keep forgetting to push my branch that fixes this to Github...PR'ing in a moment.

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

No branches or pull requests

5 participants