-
Notifications
You must be signed in to change notification settings - Fork 237
Follow naming conventions #206
Follow naming conventions #206
Conversation
|
You've moved |
|
There it is. |
|
And just like that, I'm sold. 👍 |
|
Just realized the scope you've added is |
|
@simurai do you think this will cause any problems for syntax authors? This change doesn't affect One Light/Dark, but still wanted to check with you anyway :). |
|
Maybe it would be to make a separate scope for
.storage {
&.modifier {
color: @color1;
}
&.type {
color: @color2;
}
}
|
Nope. It's because it is |
Not really for syntax authors, more for users that got used to a certain color. But from the core themes, it looks like only Atom dark would be affected: So Atom dark could be adjusted to keep the same color. Or if Atom dark's intention is to show |
That's correct. Nothing we can do about it. At least after this PR users can change color for .js {
.storage.type {
&.var, &.let {
color: @color;
}
}
} |
|
Ok, I'll merge this then and see how it goes. |
👍 In case we get issues for Atom dark about it, we can change the color back to blue for |
|
Do you want change each theme where colors for |
I disagree with this. |
While I agree that having more subscopes increases customization possibilities, I think having a unique scope for each symbol is excessive. You should consider the impact it would have on the maintainability of the syntax definition. |
If you think these scopes are fundamentally the same, you can suggest new common subscope to atom/atom#8430 like
Don't understand. What do you mean by "maintainability of the syntax definition." Is |
|
When I see |
|
@MaximSokolov I would argue that |
|
@50Wliu A added a |
|
Yeah. Let's keep it at |
Why? These scope are optional. It wouldn't broke anything. |
|
Also It's not about |
It already broke language-html's specs (https://travis-ci.org/atom/atom/jobs/77525653#L243), and as we saw previously, it does (sometimes) change the syntax colors. You can see an effect of that here: #191 |
Unit tests should test only one module, correct?
I don't think it because of this PR.
Yes. |
It's because That exactly what I am trying to fix. Languages don't follow the convention. |
|
This PR will not be making it into Atom 1.0.8. The scope changes broke both language-html's specs and Atom core specs (the latter of which appear to be especially difficult to update). In the interest of getting 1.0.8 out as painlessly as possible, Atom's reverted back to the previous version of language-javascript. @MaximSokolov: /cc @atom/feedback |
In that case reverted back is a best solution. Agree. |
Yes. That's the problem. Most of languages don't follow "guidelines".
Don't forget how many language specific rules must add syntax theme developer to make theme looks the same for general languages. Otherwise syntax theme would be look different for languages don't following "guidelines".
It would be much harder to follow "guidelines" if we would wait until Atom 2.0. Would be released a lot of new syntax themes and languages. Most of theme/language developers don't known about grammar "guidelines". Even if they do, TextMate docs quite useless without examples. That means developers would copy code from general languages/themes. Would be a lot of languages/themes don't following "guidelines". Would be a lot of "wrong" colors. |
|
@MaximSokolov Do you contribute to any syntax definition? |
Do you mean to any language-*? I only fixed a small bug I saw most scopes of languages from atom repo when I worked on Atom grammar "guidelines" Some languages don't follow "guidelines" Also I known that syntax themes would look bad without a language specific rules Are you trying to say that I don't undestand much about languages' grammar? Maybe. If you have arguments against my suggestion it would be great if you will share them |
No, the discussion until now seem to show that you know what you're talking about 👌
I already did ;)
A grammar with a scope per keyword would be really verbose and it's already difficult to debug issues in current state. I'm all for well-defined scopes but I don't think we should sacrifice the syntax definition for the possibility to customize everything. |
|
Would the specs pass if It would also match how TextMate currently highlights |
|
No, both language-html and Atom currently test to make sure |
|
That's too bad. Why is it much more difficult to update the specs of Atom core? I agree whole-heatedly that common subscopes and adherence to a common set of guidelines is the only way to make syntax themes work just as well across all languages. I encouraged similar changes to atom/language-go and kevinsawiki/monokai. Go had a unique set of scopes that no other language used. The syntax theme had accordingly adopted a set of special rules to make Go highlight like other languages. The solution: common subscopes. |
I undestand that it's difficult . That's why I called these scopes optional. However:
Why do unit tests for language-html and Atom currently test to make sure var is scoped as storage.modifier.js? Seems like wrong usage of modular tests. We should discuss more important things:
|
I agree that those aren't the prettiest tests, but language-html tests to make sure that embedded JS works correctly (hence it needs to test for the JS scopes), and Atom needs to make sure grammars work, so it arbitrarily decided to use JS (and I think HTML in some other spots). Regarding the 'lose highlighting' part: .storage.modifier.js
{
color: ...
}So if |
Good example. Beginners have to edit their less files because of wrong color of Your example is synthetic. I agree with
I don't see any way to make languages follow guidelines and don't break syntax highlighting. Still I think it worth it. |
I think we all agree that it is worth it. Some of us just feel that the change has to be communicated (which takes time) so that people don't feel like we've pulled the rug out from under them or that Atom is broken. |
|
Still no suggestion. Just wait until Atom 2.0? |
|
That's not at all what I said. If you're intent on assuming the worst, there isn't anything I can do to dissuade you. |
Sorry for misunderstanding. I just want to known your opinion about what we have to do. |
|
Grammars and themes should both work from a well-designed, unified system. As for the rest of it, I'm working on some ideas. When I have more that I can share, I'll communicate it out. |
I guess it means yes. |
|
I mean what I said: Grammars and themes should both work from a well-designed, unified system. If I had meant "yes", I would have said that. |
With "small fixes" I mean:
So I think this PR still goes under the "small fixes", because most themes are not affected. Some are, like Monokai which is pretty popular, but if TextMate's version is the original, then Atom's port has been "wrong" from the beginning and now would get "fixed". Some users might get annoyed, but some might appreciate it. Having a new naming convention/specification before
Or communicate it to package/theme authors, but I think that's a hard sell trying to do it between major versions. How to go forward?
@MaximSokolov Your enthusiasm trying to improve the grammars and syntax highlighting is great. 👏 But I hope you agree that the impact of making big changes needs to be considered too. |
|
Well, if you will look at my proposed convention you will see that it differs from the TextMate convention just little. It has only one new root scope — So what I am going to do:
|
|
Even if we wouldn't change anything we still should have a convention. Many languages' symbols not tagged now. At least we won't have to change new symbols' scopes with clear documentation. |
JavaScript.tmbundle: 99ba400..36a1b92
* 36a1b92 Remove ⇧^H from other commands. (Stefan Daschek)
We use this shortcut for “Documentation …” commands only.
* d5ed27f Add snippet to insert `${}` in template strings (Michael Sheets)
Also add macro to overwrite the `}` at the end when applicable.
* 91bb821 Change documentation tags to keyword.other.documentation (Michael Sheets)
This matches what is used in JavaDoc.
* ce865b6 Do not allow documentation comments to start with `/***` (Michael Sheets)
Using more than two * is not allowed by JSDoc.
* f3426a8 Move interpolation and escapes into local repository (Michael Sheets)
* eac4b92 Add documentation tags from JSDoc (Michael Sheets)
Taken from atom/language-javascript.
* 6d25f14 Scope block documentation comments (Michael Sheets)
This matches the format used in JSDoc and YUIDoc, among others.
* b6abca7 Cleanup class match to allow use of entity.other.inherited-class (Michael Sheets)
* a50f59e Match extends as illegal when used out of context (Michael Sheets)
* 3837a13 Correct scope of object literal keys (Michael Sheets)
* b084705 Move object literal keys and function variables out of injections (Michael Sheets)
With the improvements to ternary-if blocks these rules no longer need
the special exclusion.
* 3b47329 Remove special handling inside of ternary-if (Michael Sheets)
With recent change to ternary-if capturing this is no longer required.
* fb14e45 Match ternary-if before operators (Michael Sheets)
This was broken previously. Now matches the area between `?` and `:` as
a capture group in some cases to prevent false positives with other uses
of `:` such as property notation.
* 1819a67 Add support for Unity3d WebGL native plugin types (Eric Laberge)
As per
http://docs.unity3d.com/Manual/webgl-interactingwithbrowserscripting.html
and https://unity3d.com/unity/whats-new/unity-5.2
* 0fdb380 Improve class name scope (entity.name.type.class) (CentricStorm)
* 1e4d217 Use begin/end match for curly brackets (Maxim Sokolov)
* 77f55f3 Add `gs` to fileTypes (Google Apps Script) (Spencer-Easton)
Google Apps Script is a JavaScript based scripting language for the
Google Apps platform, `.gs` is the file extension used.
* f137ff0 Match round brackets as a block (Maxim Sokolov)
Discussed in atom/language-javascript#304
* c1b8dae Add case snippet (Luke)
* bec006f Scope let and var as storage.type.var (Wliu)
Refs atom/language-javascript#206
* 74aae79 Add `json5` to fileTypes (JSON5) (Aseem Kishore)
JSON 5 is a strict subset of JavaScript and thus suitable for
highlighting with this grammar for now. Not backwards compatible with
standard JSON.
* 52f33fa Fix 'this', 'super' (Maxim Sokolov)
* d7abb8f Snippets: Convert snake_case to camelCase, remove comments (Petr Huřťák)
* ec4119b Improve function snippet (Petr Huřťák)
- `function_name` renamed to `functionName` because camelCase is more
common in JavaScript world
- removed `argument` while keeping tab stop
- improves writing of functions with no parameters
- does not change writing of functions with 1+ parameters
- removed comment `// body ...` because it sometimes slows us down when
we are not using tab stops, if we are using tab stops experience is the
same
http://i.imgur.com/6qsHRim.gif
* 7906456 Add `jscad` to fileTypes (OpenJsCad) (Eli Clemente Gordillo Foster)
* ba0cedc Don't tokenize numbers that follow a $ or _ (Wliu)
Fixes atom/language-javascript#234
* d7a2363 Capture regular braces before ending interpolation (Wliu)
Fixes atom/language-javascript#199
* 4e909c8 Reorder regex string rule to appear before operators (Michael Sheets)
This prevents the division operator from overriding.
* 1f13082 Remove `<>` operator (Maxim Sokolov)
* 4485afa Scope bitwise operators as `keyword.operator.bitwise` (Maxim Sokolov)
* c8b70b8 Scope comparison operators as `keyword.operator.comparison` (Maxim Sokolov)
* 9ebe5d2 Scope logical operators as `keyword.operator.logical` (Maxim Sokolov)
* 9db814e Scope bitwise assignment as `…assignment.compound.bitwise` (Maxim Sokolov)
* af3e4fe Scope compound assignment operators as 'assignment.compound` (Maxim Sokolov)
* c2b7b26 Scope `:` as `keyword.operator.assignment` (Maxim Sokolov)
* 5e65169 Scope `=` as `keyword.operator.assignment` (Maxim Sokolov)
* 1a9f038 Separate out `--`, `++` as `keyword.operator.(in|de)crement` (Maxim Sokolov)
* 2d8b6fc Separate out keyword.operator.arithmetic (Maxim Sokolov)
* 45a78c8 Require a `/` later in the line to start a regex string (Michael Sheets)
This is to prevent false positives with the `/` operator.
* 5881a9c Allow regexp strings to follow `=>` (Michael Sheets)
* 308e212 Add proxy auto-config (PAC) to fileTypes (Alexander J. Salas B)
* bae9b91 Don't confuse exported default object with named exports (Maxim Sokolov)
Fixes atom/language-javascript#244
* f1e0d94 Add ES6 'export' support (Maxim Sokolov)
* e80ffec Move operator match into repository item (Michael Sheets)
* 151ccc6 Move numeric literals into a repository item (Michael Sheets)
* 36a5ef0 Improve ES6 'import' support (Maxim Sokolov)
* 8c2fa72 Add export keyword (Michael Sheets)
* b5ee1d5 Highlight unescaped multiline strings as invalid (Michael Sheets)
Based on a commit originally from @pchaigno
* bf1fe66 Add extensions xsjs + xsjslib (Lars Hvam)
Javascript file extensions for SAP HANA XS engine, see
http://help.sap.com/hana/SAP_HANA_XS_JavaScript_Reference_en.pdf
Already part of
https://github.com/github/linguist/blob/master/lib/linguist/languages.yml
* 7e065ac Allow +/- in front of numeric literals (Wliu)
* c9afd5f Add const keyword to storage.modifier (Michael Sheets)
* c11c1e4 Add JSM file as an extension (Robert Helmer)
`.jsm` files are Javascript modules used by Firefox and extensions:
https://developer.mozilla.org/en-US/docs/Mozilla/JavaScript_code_modules
* 82e95ae Allow comments in function arguments (Michael Sheets)
Discussed in atom/language-javascript#113
* 5fcedf2 Move comment rules into repository item (Michael Sheets)
* d4af225 Support static class methods (Michael Sheets)
Mark other uses of static keyword invalid.
* 2d8bccf Match function keyword as illegal in unrecognized contexts (Michael Sheets)
* 62408c2 Match empty classes (Michael Sheets)
Also match keyword as it's being entered, match other uses as invalid.
* e04143e Update reserved keywords for ECMAScript 7 (Michael Sheets)
* 5167635 Update to 1.6.3 of JS Beautifier (Michael Sheets)
Fixes #46
* 86e3168 Add methods support (Alexey Malinin)
Discussed in atom/language-javascript#115
* 13e9469 Allow comments to follow import statements (Michael Sheets)
Discussed in AMalininHere/language-javascript-better#13
* 0041fa6 Rename parameter in try catch snippet from variable to e (Hurtak)
* 02d9e59 Remove useless statement variables from try snippet (Hurtak)
* ce05542 Change yield support (Alexey Malinin)
* 1fa024d Add ES6 class snippet (Alexey Malinin)
* c0fb3eb Add ES6 import support (Alexey Malinin)
* 2698196 Moved strings into repository block (Alexey Malinin)
* 48501e2 Add .es extension to fileTypes (Alexey Malinin)
* 51ff055 ES6 class support (Alexey Malinin)
* 4d5a3ac Add 'for of' snippet (Alexey Malinin)
* 1694aa1 Highlighting 'of' as operator for 'for of' cycles (Alexey Malinin)
In ES6 was created new 'for of' cycles
* fb80cda Support ES6 regular expression flags `u` and `y` (Mathias Bynens)
* 2994f99 Add support for new ES6 numeric literals (Mathias Bynens)
https://people.mozilla.org/~jorendorff/es6-draft.html#sec-literals-numeric-literals
BinaryIntegerLiteral ::
0b BinaryDigits
0B BinaryDigits
BinaryDigits ::
BinaryDigit
BinaryDigits BinaryDigit
BinaryDigit :: one of
0 1
OctalIntegerLiteral ::
0o OctalDigits
0O OctalDigits
OctalDigits ::
OctalDigit
OctalDigits OctalDigit
OctalDigit :: one of
0 1 2 3 4 5 6 7
* 93c99cd Add bitwise XOR (^) to the list of keywords (igor milla)
* 6795eb4 Add support for ES6 template strings (Stefan Daschek)
Discussed in and fixes #45
* 061136f Add + to character class for regex look-behind (Kevin Sawicki)
Closes atom/language-javascript#54
* c9e47c7 Treat with as a control keyword (Jason H)
Discussed in atom/language-javascript#44
* 8301ba1 Tokenize regular expressions when inside arrays (Kevin Sawicki)
Closes atom/language-javascript#40
* 3a280dc Fix not parsing ':' properly (Adrian Lee)
* d985a55 Support es6 files as javascript (Joe Fiorini)
The `ember-appkit-rails` library uses the `.es6` extension to support
ES6 modules. Adds support for this type.
* 27cf358 Add support for Streamline ._js files (Aseem Kishore)
https://github.com/Sage/streamlinejs
Like
atom/language-coffee-script@74b6b56.
* 7542f22 Add firstLineMatch for node and iojs (Michael Sheets)
Ruby.tmbundle: 261253b..899e298
* 8f4e77c Don't allow `=` as an arbitrary delimiter for % strings (Michael Sheets)
Allowing `=` to be used as a delimiter conflicts with the `%=` operator.
Fixes #95
* 6f856f5 Avoid exiting percent literals early (Michael Sheets)
A stray standard ending character would exit the literal early in a
literal with arbitrary delimiters. Example:
```ruby
%Q:The quick #{color} fox\n}jumps over the #{temperment} dog:
```
* 6dc051e Refine grammar of logical operators (esdoppio)
Fixes atom/language-ruby#138
* 06efe7d Remove the escaping of , ; (esdoppio)
Cleans up unneeded escaping
* 518437a Remove the escaping of - = (esdoppio)
Cleans up unneeded escaping
* 44bc21c Match 'do', no trailing spaces (esdoppio)
This allows for better word selection and movement.


Fixes #201