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

Improper method-call scope applied #304

Closed
adamreisnz opened this issue Jan 18, 2016 · 4 comments
Closed

Improper method-call scope applied #304

adamreisnz opened this issue Jan 18, 2016 · 4 comments
Labels

Comments

@adamreisnz
Copy link

For the following code:

ss

The property client gets incorrectly marked as meta.method-call.js, the property benefits is just source.js
When I switch them around, both become meta.method-call.js:

ss

Seems to me they both should just be source.js or something like meta.property.js if that exists. Definitely shouldn't matter in what order they are placed.

A lot of buggy behaviour like this since the latest update to langauge-javascript, but I'm glad we're getting some more fine grained scoping.

@winstliu winstliu added the bug label Jan 18, 2016
@winstliu
Copy link
Contributor

Thanks for the report :)

@adamreisnz
Copy link
Author

Another situation where properties are being marked as method calls (top one):

ss

@MaximSokolov
Copy link
Contributor

Arguments are part of function call:

functionCall(...)
|          |^   ^  - punctuation.definition.arguments.begin/end
^----------^    |  - entity.name.function
^---------------^  - meta.function-call

meta.function-call is not supposed to be highlighted, it provides context:

.function-call, .method-call {
  & > .entity.name {...}

  & > .punctuation.definition {...}

  // it's not tagged so far
  // .variable.argument {...}
}

.function {
  & > .entity.name {...}

  & > .punctuation.definition {...}

  .variable.parameter {...}
}

Seems to me they both should just be source.js or something like meta.property.js if that exists.

Object keys don't have an own scope. Refs #287, #137

A lot of buggy behaviour like this since the latest update to langauge-javascript

Please create a new issue if you find bugs. Thanks!

Support for function/method calls added in #242

@adamreisnz
Copy link
Author

Thanks for the clarification @MaximSokolov, I will check my syntax stylesheet and remove highlighting of meta elements.

infininight pushed a commit to textmate/javascript.tmbundle that referenced this issue Jul 30, 2016
noniq added a commit to die-antwort/textmate-bundles that referenced this issue Aug 5, 2016
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.
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

3 participants