borela / naomi

Sublime Text enhanced syntax highlighting for JavaScript ES6/ES7/ES2015/ES2016/ES2017+, Babel, FlowType, React JSX, Styled Components, HTML5, SCSS3, PHP 7, phpDoc, PHPUnit, MQL4. Basic: Git config files.
Other
558 stars 18 forks source link

Goto Symbol (ctrl+r) doesn't work for methods of anonymous object #175

Closed YuriGor closed 5 years ago

YuriGor commented 5 years ago
test({
  myMethod:function(){
    console.info("I want this method be listed in functions list too!");
    console.warn("In native 'JavaScript' syntax it is!");
  }
});

Ctrl+R doesn't work for code sample above. It's a most most used construction for ExtJS app:

Ext.create('Ext.Button', {
    text: 'Click me',
    renderTo: Ext.getBody(),
    handler: function() {
        alert('You clicked the button!');
    }
});

Babel syntax package does not respect such methods too, this is why I tried to switch to Naomi.

borela commented 5 years ago

Fixed https://github.com/borela/naomi/releases/tag/v4.2.5

YuriGor commented 5 years ago

Still doesn't work image

YuriGor commented 5 years ago

For test I installed Naomi from latest master from github

YuriGor commented 5 years ago

also this is from sublime's console:

Packages/Naomi/syntaxes/naomi.fjsx15.sublime-syntax: context Packages/Naomi/syntaxes/fjsx15/destructuring/object/property.sublime-syntax#meta-destructuring has a scope name, but is unreachable, so the name will never be used

As I remember, same warning was before this commit too.

borela commented 5 years ago

Clean the cache directory to force sublime to recompile the syntaxes:

And restart sublime.

image

Packages/Naomi/syntaxes/naomi.fjsx15.sublime-syntax: context Packages/Naomi/syntaxes/fjsx15/destructuring/object/property.sublime-syntax#meta-destructuring has a scope name, but is unreachable, so the name will never be used

You can ignore that warning for now, I do use that context in an external file, the problem is that the sublime's syntax system was not planned to work with multiple files like I did, that'll be fixed when I finish the build system where the files will be concatenated into a single one, it should also improve the speed.

YuriGor commented 5 years ago

I closed subl, emptied /home/gor/.config/sublime-text-3/Cache and started subl, still doesn't work (

YuriGor commented 5 years ago

may be some other plugin do this, native js syntax stopped to work too, need to investigate

YuriGor commented 5 years ago

I removed some packages including babel, now Naomi started to work, but incorrect: image For each method it shows two lines, first one is function name and second is parentheses compare with native JS: image

borela commented 5 years ago

Yes, the meta.declaration.function scopes were incorrect and causing the issue, I sent a patch to the master branch, this should be the result:

image

borela commented 5 years ago

I also tagged the commit https://github.com/borela/naomi/releases/tag/v4.2.6, so if you are using the package control's version instead of clonning, you should see the update in ~2 hours.

YuriGor commented 5 years ago

I tested fresh version from github, now it works correctly, thank you!

borela commented 5 years ago

Thank you for reporting this issue, I knew something odd was happenning but was only able to pin point the issue after your report. Feel free to open more of them as soon as you find more bugs.

YuriGor commented 5 years ago

Ok, I already have issue about coloring, but need some time to prepare screenshots to show difference with native JS syntax highlighting for different color schemes: looks like object field names was categorized some incorrect way. In native JS syntax they are semi-white both in monokai and candyman but with Naomiin they are yellow as string in monokai or green in candyman (look screenshots above for example) I'd better open new issue to add some details if I'll find them