PerlNavigator
PerlNavigator copied to clipboard
Provide Hover Documentation For Perl's Inbuilts
Basically what the title says.
At least in my case (Neovim 0.10.1) there's no hover documentation for inbuilts like die
, warn
, shift
, push
, etc. - basically all inbuilts, as far as I'm aware.
Would be cool if it was possible to look those docs up somehow.
Depending on how PR #142 evolves, this should be fairly straightforward to implement. Luckily, the official docs provide sources for the docs themselves -- and they just happen to be written in POD, who would've thought? ;) For example, the source for perlfunc is perlfunc.txt.
One possible solution would be to "vendor" these .txt
files together with the server and parse them into PodDocuments
(see PR #142) during startup, so that they don't need to be re-parsed on every textDocument/hover
event.
Then, when a symbol's name isn't found in the POD of the current file, fall back to the POD docs of the inbuild Perl stuff and try to find it in there.
Having the lookup of inbuilts be a "fallback" mechanism would also be compatible with e.g. WWW::Mechanize
, which provides its own die
and warn
subs. That way those would still be found before the inbuilt die
and warn
functions.
Once PR #142 is resolved, I'll happily tackle this too.