For some .js files the symbols browser is empty.
No symbols: ![](http://i.imgur.com/y8pH8Lx.png)
Symbols appear when I comment-out some js code: ![](http://i.imgur.com/vypJ6cR.png)
Presented file is from Froala editor : https://github.com/froala/wysiwyg-editor
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.
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 only calling an anonymous function. I would say this is wanted behavior here.
The lack of the document structure in JS (symbols) is a great problem for me. I'd be happy to have this implemented.
@gruz you need to address the request to the [Universal Ctags](https://github.com/universal-ctags/ctags) project that Geany gets its parsers from.
@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.
I'm not sure how to check this. Please, give a hint.
build [universal-ctags](/universal-ctags/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.
OK, trying with only the part visible in your first screenshot suggests current U-CTags will give better (yet probably imperfect) results.
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](https://github.com/geany/geany/files/1952076/geany_symbol_test.js.txt)
@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.
Should be fixed by javascript parser update from #2018.
Closed #1329.
github-comments@lists.geany.org