Comments (5)
I'm confused on what it is exactly that you're asking for
from babel-sublime.
Sorry. This one is indeed a feature request, not a bug. I mean to say that it would be awesome if 'MyConstructor' in the following examples received a common scope like 'entity.name.constructor':
class MyConstructor {}
new MyConstructor()
MyConstructor
The second one already does get a targettable scope (entity.name.type.new) but the others don't. The last may be too opinionated, I don't know, but since the all-caps of MYCONSTANT is acknowledged as a naming convention that in itself is indicative of being a constant, it seems reasonable to me that this acknowledgement of naming conventions could be extended to MyConstructor (initial capital, followed by either all lowercase or mixed lowercase and uppercase).
from babel-sublime.
class MyConstructor {}
In this case, MyConstructor
gets entity.name.class
, which I think makes sense, since you're defining a class, not instantiating a constructor.
new MyConstructor()
Here, MyConstructor
gets meta.instance.constructor
, which I also think makes sense, for the opposite reason as above. You might not have noticed this, but if you try new ObjectBag.My.Constructor()
, the entire name is still meta.instance.constructor
- the periods are ignored.
MyConstructor
Heh yeah wayyy too opinionated. Consider that namespaces are often written with a capital too. Remember that the you can't get too specific with the naming because unlike syntax definitions (which are applied on a per-file basis), themes don't switch with file type. So, if your theme is too specific too one syntax, opening say an HTML file or Scala file, will look like crap.
Also, people have their opinions on self-instantiating constructor functions, but the fact is that ES6 classes can only be invoked with new
as per the spec.
from babel-sublime.
Well awesome, I somehow missed entity.name.class for the first case! That's the one I thought was more important, but I was mistaken that it was absent.
I totally agree re: use of new. I'm not sure why acknowledging the naming convention is "wayyy" too opinionated ("regular" opinionated would do I think) since it's an even more commonly agreed on convention than CAPCONSTANT, but I agree it wouldn't be possible to differentiate between actual classes and objects-as-namespaces that share this naming convention so I understand the reasoning.
from babel-sublime.
heh I'm kidding with the extra "yyy". Even the DOM API follows "CAPCONSTANT", so I'd call that a defacto standard π
from babel-sublime.
Related Issues (20)
- Babel issue HOT 1
- Inline comments breaking if comment begins with @ symbol HOT 5
- Version 11 broke syntax highlighting. HOT 15
- Object keys highlighting slightly incorrect in recent release HOT 5
- Question on how to short-circuit on ``` for fenced code blocks in Markdown HOT 5
- Sublime 4 Crashing HOT 4
- Possible highlighting error using a nested ternary HOT 3
- Highlighting error not using parentheses inside an if condition HOT 7
- Error loading syntax file: 'Packages/Babel/JavaScript (Babel).sublime-syntax' HOT 18
- ST4 Autocomplete does not consider state variables defined in a map HOT 1
- Missing Babel option in syntax selector. HOT 2
- Highlighting of `filter` in `styled-components` seems to breakβ HOT 3
- css Styled Component helper utility improperly highlighted HOT 3
- Functions with parameters on multiple lines are not highlighted properly. HOT 1
- JS #myPrivateClassMethod() breaks syntax highlighting HOT 6
- Object keys are now red instead of intended yellow on Monokai HOT 2
- Sublime 4149 generates "Error loading syntax file[...]: no such target" pop-up for "JavaScript (Babel)" HOT 3
- Interface in extends class is not well Colored HOT 4
- Object literal property has incorrect color in Sublime 4169
- support html`<b>babel</b>` html syntax in templates HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from babel-sublime.