Hi,
I'm currently using Geany 1.33 (from Debian stable) and I'm very annoyed by the Symbols pane not showing properly class hierarchy when using the JavaScript class syntax, like:
class MyClass { constructor(param) {} otherFunc() {...} }
I'm only getting a single "class" symbol (for all classes) and cannot browse anything inside it.
Is this something fixed in recent versions of Geany (or any underlying library)? Is it possible to do anything to improve my current situation while staying with the Debian stable version or do I have to compile some sources?
Thanks for any help.
Claude
Hi,
Le 23/10/2020 à 08:46, Claude Paroz a écrit :
Hi,
I'm currently using Geany 1.33 (from Debian stable) and I'm very annoyed by the Symbols pane not showing properly class hierarchy when using the JavaScript class syntax, like:
class MyClass { constructor(param) {} otherFunc() {...} }
I'm only getting a single "class" symbol (for all classes) and cannot browse anything inside it.
Is this something fixed in recent versions of Geany (or any underlying library)?
It's improved since 1.35. JavaScript symbols tab will however never be perfect given how dynamic the language is, and how a lot of libraries are written in a way *not* to have symbols, but a single nameless entry point. But it you write symbols-friendly JS, it should work a whole lot better in 1.35 onward than it did in 1.33.
Is it possible to do anything to improve my current situation while staying with the Debian stable version or do I have to compile some sources?
You'll have to upgrade to at least 1.35; and unfortunately I don't think it's in the backports, so yes, you'll likely have to build it yourself. We've got instructions a bit everywhere, so you should easily get started :
- https://www.geany.org/download/git/ - https://wiki.geany.org/howtos/testing_git - …
Regards, Colomban
Le 23.10.20 à 12:21, Colomban Wendling a écrit : (..)
Is it possible to do anything to improve my current situation while staying with the Debian stable version or do I have to compile some sources?
You'll have to upgrade to at least 1.35; and unfortunately I don't think it's in the backports, so yes, you'll likely have to build it yourself. We've got instructions a bit everywhere, so you should easily get started :
Thanks, compiling worked like a charm (I used the 1.36.0 tag)! Now the classes are appropriately showing in symbols.
I also see now anonymous functions used with addEventListener('click', function () {...}); as
AnonymousFunction1 AnonymousFunction2 ... which is not really useful. I guess it's not possible to turn that off?
Claude
Le 23/10/2020 à 14:51, Claude Paroz a écrit :
[…] I also see now anonymous functions used with addEventListener('click', function () {...}); as
AnonymousFunction1 AnonymousFunction2 ... which is not really useful. I guess it's not possible to turn that off?
Not currently without hacking the code a bit. Something like the attached patch should do, but I don't guarantee it doesn't have some corner case side effects on other tags.
Regards, Colomban
Le 23.10.20 à 16:48, Colomban Wendling a écrit :
Le 23/10/2020 à 14:51, Claude Paroz a écrit :
[…] I also see now anonymous functions used with addEventListener('click', function () {...}); as
AnonymousFunction1 AnonymousFunction2 ... which is not really useful. I guess it's not possible to turn that off?
Not currently without hacking the code a bit. Something like the attached patch should do, but I don't guarantee it doesn't have some corner case side effects on other tags.
Thanks for this patch. I'll let you judge if this has any merit being included in the main source tree. Anyway, I guess that using a bit less anonymous functions in JS might not hurt, after all :-)
Claude