Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
YuriGor opened this issue Oct 10, 2018 · 13 comments
Closed

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

YuriGor opened this issue Oct 10, 2018 · 13 comments
Labels

Comments

@YuriGor
Copy link

YuriGor commented Oct 10, 2018

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 borela added the bug label Oct 10, 2018
@borela
Copy link
Owner

borela commented Oct 11, 2018

@YuriGor
Copy link
Author

YuriGor commented Oct 11, 2018

Still doesn't work
image

@YuriGor
Copy link
Author

YuriGor commented Oct 11, 2018

For test I installed Naomi from latest master from github

@YuriGor
Copy link
Author

YuriGor commented Oct 11, 2018

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
Copy link
Owner

borela commented Oct 11, 2018

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

  • OS X: ~/Library/Application Support/Sublime Text 3
  • Windows: %LOCALAPPDATA%\Sublime Text 3
  • Linux: ~/.config/sublime-text-3

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
Copy link
Author

YuriGor commented Oct 11, 2018

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

@YuriGor
Copy link
Author

YuriGor commented Oct 11, 2018

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

@YuriGor
Copy link
Author

YuriGor commented Oct 11, 2018

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
Copy link
Owner

borela commented Oct 11, 2018

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
Copy link
Owner

borela commented Oct 11, 2018

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
Copy link
Author

YuriGor commented Oct 11, 2018

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

@borela
Copy link
Owner

borela commented Oct 11, 2018

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.

@borela borela closed this as completed Oct 11, 2018
@YuriGor
Copy link
Author

YuriGor commented Oct 11, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants