atom/language-objective-c

Grammar fails to detect ObjC method calls

mountainstorm opened this issue · 1 comments

Prerequisites

Description

Objective-C grammar doesn't detect method calls. As a result it reports the wrong scopes and doesn't show the method argument names as highlighted.

It also doesn't detect "self" so there's probably some other bug as well.

This issue does not affect Sublime Text which uses a different grammar.

Steps to Reproduce

Put this code into your editor

@implementation ClassName

- (void)method:(void*) a
        defined: (void *) b
        here: (void*) c
{

    [self unhighlighted:a
          call:b];
}

@end

Notice that the call to -[ClassName unhighlighted:call:] isn't highlighted.

If you dump the scopes on lines 8/9 you get the following:

8 source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.definition.begin.bracket.square.c
9 source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.definition.end.bracket.square.c
9 source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.terminator.statement.c

So it's clear it's not being detected

Expected behavior:

We get a set of unique scopes for the method call and it's argument names

Actual behavior:

It doesn't

Reproduces how often:

100%

Versions

Version of the grammar in this repo

Additional Information

Nope

rsese commented

Thanks for the report - reproduced on macOS 10.14.6 with 1.42.0-nightly8:

obj-c-method-call