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

Javascript "no symbols found" #1329

Closed
xPrzybyLx opened this issue Dec 3, 2016 · 11 comments

Comments

Projects
None yet
7 participants
@xPrzybyLx
Copy link

commented Dec 3, 2016

For some .js files the symbols browser is empty.

No symbols:

Symbols appear when I comment-out some js code:

Presented file is from Froala editor : https://github.com/froala/wysiwyg-editor

@codebrainz

This comment has been minimized.

Copy link
Member

commented Dec 3, 2016

I think only top-level symbols are parsed, so when you comment out the wrapper, the following symbols go into the global namespace (or whatever JS calls it), where they are parsed by CTags.

@frederik-labbe

This comment has been minimized.

Copy link

commented Dec 19, 2016

jQuery-plugin-ish javascript is using an enclosure to prevent interferences from other definitions in the global scope. Therefore, from the global scope, this code doesn't expose any symbol at all. Practically, your script is only calling an anonymous function. I would say this is wanted behavior here.

@gruz

This comment has been minimized.

Copy link

commented Oct 5, 2017

The lack of the document structure in JS (symbols) is a great problem for me. I'd be happy to have this implemented.

@elextr

This comment has been minimized.

Copy link
Member

commented Oct 5, 2017

@gruz you need to address the request to the Universal Ctags project that Geany gets its parsers from.

@b4n

This comment has been minimized.

Copy link
Member

commented Oct 5, 2017

@gruz I'm in the process of updating Geany's JavaScript parser to current U-Ctags one. did you check if U-CTgas gives better results?

This said, unfortunately the dynamic nature of JavaScript makes it virtually impossible to get perfect symbols statically, the only way to really get perfect info would be to actually run the code (e.g. in case some code is dynamically extending classes or so). However yes, we can try and improve the results still.

@gruz

This comment has been minimized.

Copy link

commented Oct 5, 2017

I'm not sure how to check this. Please, give a hint.

@b4n

This comment has been minimized.

Copy link
Member

commented Oct 5, 2017

build universal-ctags and run ./ctags -o- yourfile.js and see the output.

Alternatively you could give us a link to the file (I can't fine a non-minified version on the GitHub you link) so we could test ourselves, or any minimal test case that reproduces your issue.

@b4n

This comment has been minimized.

Copy link
Member

commented Oct 5, 2017

OK, trying with only the part visible in your first screenshot suggests current U-CTags will give better (yet probably imperfect) results.

@klaxian

This comment has been minimized.

Copy link
Contributor

commented Apr 26, 2018

I've been running into this problem for quite some time as well. I have attached a minimal example. Does ctags not support ECMAScript 2015? Do you need anything else to resolve this? Thanks!

geany_symbol_test.js.txt

@elextr

This comment has been minimized.

Copy link
Member

commented Apr 26, 2018

@klaxian the version of ctags jscript in Geany currently does not support the class keyword. The current version in ctags appears to do so, somebody just needs to provide a pull request to incorporate the new parser and any associated changes needed in Geany symbol handling.

@b4n

This comment has been minimized.

Copy link
Member

commented Apr 28, 2019

Should be fixed by javascript parser update from #2018.

@b4n b4n closed this Apr 28, 2019

@b4n b4n added this to the 1.35 milestone Apr 28, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.