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

Fixes for tokenization of Kernel methods ending in ? or ! #136

Merged
merged 3 commits into from
Mar 11, 2016

Conversation

hgoodman
Copy link
Contributor

This is a bug fix for some Kernel methods ending with a ? or ! not being tokenized. Plus, iterator? is synonymous with block_given? (although "mildly deprecated" according to Ruby docs) so I included a test to ensure that they have the same scope, disregarding whatever that scope is in case it changes in the future.

For the sake of clarity, I added the tests and fixes as separate commits instead of squashing. Let me know if that's considered a good practice.

@50Wliu
Copy link
Contributor

50Wliu commented Feb 14, 2016

Let me know if that's considered a good practice.

Yep, definitely! I'll leave this open for a few days because I don't know Ruby, and if no one finds anything wrong with it, then I'll merge.

@hgoodman
Copy link
Contributor Author

Good call @50Wliu! I don't consider myself an expert either, but I'm learning more every day.

@hgoodman
Copy link
Contributor Author

I just did a squash to clean up commit history. Nothing has actually changed.

50Wliu added a commit that referenced this pull request Mar 11, 2016
Fixes for tokenization of Kernel methods ending in ? or !
@50Wliu 50Wliu merged commit dc63842 into atom:master Mar 11, 2016
infininight pushed a commit to textmate/ruby.tmbundle that referenced this pull request Jul 14, 2016
This is to better match the scope given to `block_given?` which is synonymous with `iterator?` (although "mildly deprecated" according to Ruby docs). Discussed in atom/language-ruby#136
noniq added a commit to die-antwort/textmate-bundles that referenced this pull request Jul 16, 2016
PHP.tmbundle: 0398e3c..a5663f6

  * 010cc1c Allow <?php ?> snippet to work in any document (Michael Sheets)

    This works anywhere in a PHP document and only at the very start of any
    other document. Along with the recent firstLineMatch changes in TextMate
    this means using the snippet on the first line of an untitled document
    will automatically set the document language to PHP.

    Due to this change the ⌃> shortcut has been removed.

  * c3dd29e Add `<?php` to firstLineMatch (Michael Sheets)

  * 9cfcc6d Reduce specificity of injection scope (Michael Sheets)

    This allows the PHP grammar to be included in languages that do not
    match the `text.html.php` scope.

Ruby.tmbundle: dc7741c..261253b

  * 261253b Use ^⌘E for “Execute Line / Selection as Ruby”. (Stefan Daschek)

    The default (^⇧E) overrides “Select to EOL”.

  * fd42e0f Use ⇧^H for “Documentation for Word”. (Stefan Daschek)

    ^H now used by DashMate. Also mention ri in command name.

  * 1c33374 Make Ctrl-" toggle only between single and double quotes. (Stefan Daschek)

    Treat %Q{...} as one of the 'more esoteric quote styles' (i.e. convert
    it to double quotes if Ctrl-" is used on it.

  * 0e8c1c4 Remove Ctrl-Shift-w keybinding (should call 'Wrap Selection' even in Ruby mode) (Stefan Daschek)

  * 1094f3f Add .vagrantplugins to fileTypes (Kit Sunde)

  * da02341 Adding `private def` to folding rules (Simon Courtois)

    This commit adds folding for the following method definition syntax:

       private def some_method
         # code here
       end

  * 9daa7dc Add Brewfile to fileTypes (Misty De Meo)

  * e1ff600 Add Dangerfile fileType (Macklin Underdown)

    https://github.com/danger/danger

  * 5d68373 Added arb to fileTypes for ruby language (Oscar Barrett)

  * 1d33d62 Don't allow [ characters inside a character-class (Michael Sheets)

    This was previously allowed but returns an error in ruby.

  * 61ada97 Add pre-defined variable $-w (Michael Sheets)

    List of variables taken from:

    http://docs.ruby-lang.org/en/2.3.0/globals_rdoc.html

  * 5932b27 Add support for `private_class_method` (Jordon Bedwell)

    It's a real thing:
    http://ruby-doc.org/core-2.0.0/Module.html#method-i-private_class_method

  * 1cec56d Add support for Ruby 2.3's new "safe navigation operator" (Solomon White)

    https://bugs.ruby-lang.org/issues/11537

  * c2d44b0 Improve punctuation scope of blockpipe arguments (Michael Sheets)

  * 5fa1aed Fixes blockpipe formatting (Marco A. Mena)

    Discussed in atom/language-ruby#123, fixes atom/language-ruby#93

  * 6a26751 Cleanup info.plist (Michael Sheets)

    Remove outdated keys.

  * ea72103 Add refine snippet (refine→) (Eli Clemente Gordillo Foster)

  * 28a5c28 Add refinement methods (Eli Clemente Gordillo Foster)

    Add support for the refinement methods using and refine.

  * f2322b7 Change stabby lambda token to match lambda scope (Marco A. Mena)

  * 28911d4 Add stabby lambda (->) operator (Marco A. Mena)

    Fixes atom/language-ruby#117

  * d62dfcd Give symbols in method argument a symbol hashkey scope (Marco A. Mena)

  * a09cba6 Fix for multiple method arguments as symbols with parentheses (Marco A. Mena)

  * ade64e7 Fixed def method *args formatting (Marco A. Mena)

    Fixes atom/language-ruby#69

  * 2f4eaaa Distinguish :: separators for methods/constants (Nikhil Narula)

    `::` isn't always a method separator in ruby, it also allows you to
    access module hierarchies and other constants. Constants are signified
    by starting with a capital letter.

    Discussed in atom/language-ruby#101

  * 4e8cbf2 Prefer `::` over consecutively matching two `:` (Nikhil Narula)

    Discussed in atom/language-ruby#101

  * b20afae Fix require special highlighting on method calls (Nikhil Narula)

    `require` should only be highlighted as a special method if it's not
    called on an object. Use negative look-behind to check if it's preceded
    by `.` or `::`.

    Discussed in atom/language-ruby#100

  * 27a3ada Fix comparable operator symbol highlighting (Nikhil Narula)

    Now correctly matches `:<=>` instead of only matching the `:<=` portion.

  * 350b38f Support Emacs file mode comments (Tobias H. Michaelsen)

    Files starting with a comment line of the form:

        # -*- ruby -*-

    should be recognized as Ruby source. This “standard” originates from
    [Emacs], but is also used by others.

    [Emacs]:
    http://www.gnu.org/software/emacs/manual/html_node/emacs/Choosing-Modes.html

  * f28dec9 Support &&= as augmented assignment (Agent Antelope)

    This is to match ||=, |=, and &=.

  * 04cbd46 Allow symbols to start with $ (Michael Sheets)

    Discussed in atom/language-ruby#59. Handled in a different manner to
    only allow `$` as the first character similar to `@` usage.

  * 2ae484f Scope self as variable.language.self (Kevin Sawicki)

    Discussed in atom/language-ruby#54

  * 005bcab Change iterator? to `keyword.control.pseudo-method` (Henry Goodman)

    This is to better match the scope given to `block_given?` which is
    synonymous with `iterator?` (although "mildly deprecated" according to
    Ruby docs). Discussed in atom/language-ruby#136

  * 92c77b6 Correct matching of autoload?, iterator?, and exit! (Michael Sheets)

    A word boundary at the end of this match was preventing the rule from
    matching correctly.

  * 0472ab7 Add kernel methods as `support.function.kernel.ruby` (Spencer Steffen)

    Discussed in atom/language-ruby#27

  * 35becc0 Allow ^ and !~ as method names (Michael Sheets)

    Mentioned in atom/language-ruby#23, list taken from [method syntax
    documentation](http://ruby-doc.org/core-2.3.0/doc/syntax/methods_rdoc.html).

  * 295b5ce Add != to method name regexes (Kevin Sawicki)

    Fixes atom/language-ruby#23

Shell Script.tmbundle: e257337..74dfde4

  * 74dfde4 Inject into scope meta.embedded_bash (for use in Markdown code blocks). (Stefan Daschek)

  * 47cf94b Use ⇧^H for “Documentation for Word”. (Stefan Daschek)

    ^H now used by DashMate.

  * 9acbd91 Remove keybinding for 'Execute Line and Replace With Result'. (Stefan Daschek)

    We use ^R for RSpec (run in terminal), instead.

  * 887a69b #function-definition: Don't match illegal characters (Martin Kühl)

Source.tmbundle: 525d1db..35030cd

  * 74adace Support underscore prefix when toggling _camelCase to _snake_case (Allan Odgaard)

    The support is for arbitrary prefixes but since cycling from snake_case
    would eat the underscores, it meant that previously the transformation
    could not be undone by continuing the cycling.

    This commit changes the ruby requirement to 2.0 but almost 99% of
    TextMate users are now on OS X 10.9 or higher (according to software
    update checks).

  * 092a20a Comments: Exclude from Paragraph Selection (Adam Strzelecki)

    This sets excludeFromParagraphSelection to true for comment.line scope.

    Previously when reformatting paragraph comment lines were selected as
    paragraph lines, this have led to mixing comment content into
    reformatted paragraph content breaking the syntax of reformatted code,
    eg.:

      some very long ... line of text
     # some comment
     some other long ... line of text

    As an effect we got:

      some very long ...
     ... text # some comment some other ...
     ... line of text

    The problem described above was especially visible when using ⌃Q to
    Reformat block of Git commit message, when below of the typed text there
    was a Git default comment. Also this problem could be noticeable by
    authors using LaTeX.

    Doing Select Paragraph ⌃⌥P again will select the comment as well.
sanssecours pushed a commit to sanssecours/ruby.tmbundle that referenced this pull request Sep 20, 2016
This is to better match the scope given to `block_given?` which is synonymous with `iterator?` (although "mildly deprecated" according to Ruby docs). Discussed in atom/language-ruby#136
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants