Open aldem opened 4 years ago
Regarding XS, check this one: https://github.com/Camelcade/Perl5-IDEA/issues/1576#issuecomment-617873987
And tricky pp subs may not be handled if plugin don't know about them. I'm implementing things, but you know, it's a perl. Plugin won't ever be perfect for every possible syntax.
Imports and exports are hardcoded in the plugin for some modules requested by users.
What about snapshotting differences in symbol tables before and after module load - after parsing, i.e. use the result as the last resort? This should work for any module type type, in theory.
I thought about that. But such table should be rebuilt too often. But as optional thing, probably viable.
Even if it will be done on demand (Tools/Perl5/Re-Generate...) it could help a lot.
Btw, for now you may generate it yourself by adjusting https://github.com/Camelcade/Perl5-IDEA/blob/master/plugin/scripts/xs_parser_simple.pl
Sorry I'm not well-versed with Perl, but can you clarify if your last comment means there's some way to resolve this problem?
And if so, what is it? Thanks.
It can solve XS problems (it should at least). Described action runs the script which attempts to introspect installed XS modules and built a stub file with empty declarations. There is no way atm to automatically solve tricky declarations problems. If they are from some wide-used library, you may submit an issue and i'll try to implement support for it.
Not sure if this is already known issue, but I could not find a ticket... sorry if this is already covered :)
Digest::MD5
subs likemd5
,md5_hex
are not resolved and reported as undefined. There are other modules with similar issues but right now I could not remember which.What is interesting - subs are available when auto completing imports:
but not when trying to call them, i.e.
Digest::MD5::
does not show anything for completion:while reference to
md5
alone (when imported explicitly) does autocomplete:More intriguing is that explicit reference as `Digest::MD5::md5() is recognized properly (despite there is no autocomplete):
And finally... a bit different issue is with
AnyEvent
, some subs likecondvar
are not visible too - those which are instantiated "magically" through direct or indirect manipulation of symbol tables or similar tricks - I guess this could be only catched by snapshotting symbol tables (like with xsubs).