-
Notifications
You must be signed in to change notification settings - Fork 40
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
Add POD overview on hover in code and autocomplete #41
Comments
Thanks @antoinemarechal ! A first version is now in version 0.7.6, and.documentation is displayed on hover and autocompletion (see examples below). I did include the narrowing down to individual subroutines/methods. I avoided I wrote a perldoc extractor and a conversion from POD to Markdown entirely in Typescript. This also gives me full control over the display, which is convenient. For example I map Follow-on work could include support for parsing I'll close this ticket for now, but commentary, suggestions, and issues are more than welcome. Thanks! |
Hi, I want to revisit this and comment with my specific issue. I am not sure if this is a bug or not-a-feature-yet, but the POD documentation for a specific sub isn't really working. For module, it works amazing (as shown in the But for a sub like this: =head2 sessionkeeper
The session manager code
=head3 ARGS
=over 4
=item session_id
Integer Id of the session
=cut
sub sessionkeeper
{
my ($self, %args) = @_;
...;
} The hover documentation only includes the If I use LSP Hover, this is what I get (subroutine) sessionkeeper
#### sessionkeeper
The session manager code |
Hi @bhuynhdev, yes this is a current limitation. When looking up a subroutine, it only includes the POD sections with title that match the subroutine. Basically, it doesn't have any logic to say that a head3 probably belongs with the prior head2 section. In your example, the POD is all grouped together before the sub, but a common use case is all together at the end of the file. And then it's tricky to figure out which subsections are relevant for a specific sub. More details here: #134 and there is a pull request in progress to address this exact issue: #142 It won't solve everything because there's no real standard for how to organize POD, but I think it'll go a long way to improving the situation. |
Having the documentation at hand would be a nice addition. This should be achievable with the
perldoc
utility using variations ofperldoc -T -MPod::Simple::HTML <other arguments>
. The formatter would default to Pod::Simple::HTML but would be customizable in the extension settings.This feature could cover the
perlfunc
,perlapifunc
,perlvar
(respectively with the arguments-f
,-a
and-v
) and modules.Regarding the hover/autocomplete of module subroutines/constants/variables, it could just display the documentation of the whole module. As this level of granularity is not ideal, the process could be made a little more smart about those symbols. The idea would be to search after =headX or =item occurences followed by the symbol name in the POD and if results are found, the documentation would be scrolled to the first occurence. As the results might not be perfect, this could be an optional feature to toggle in the settings.
The text was updated successfully, but these errors were encountered: