Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^3: Which IDE's show tooltips for Perl builtins? (Notepad++)

by davies (Prior)
on Jul 27, 2022 at 08:58 UTC ( [id://11145776]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Which IDE's show tooltips for Perl builtins? (Notepad++)
in thread Which IDE's show tooltips for Perl builtins?

I wonder how accurate the infos are if they adapt automatically to the current Perl version.

Above my knowledge grade, I fear. But the language support system is written using plugins, so it would be possible to write a different plugin for every Perl version and then select the one currently in use.

Will it also offer to insert a snippet with jump-points for the arguments?

Not in the version I am using, but that does not mean it could not be done using a different plugin, which may even exist. I haven't looked.

Regards,

John Davies

  • Comment on Re^3: Which IDE's show tooltips for Perl builtins? (Notepad++)

Replies are listed 'Best First'.
Re^4: Which IDE's show tooltips for Perl builtins? (Notepad++)
by pryrt (Abbot) on Jul 27, 2022 at 14:03 UTC
    I wonder how accurate the infos are if they adapt automatically to the current Perl version.

    I did a bulk conversion from the Perl 5.30 perlfunc.pod into the Notepad++ auto-completion file for Notepad++ in May 2020, which was a drastic improvement from the pre-v5.10 keywords available before (it didn't even have say!). (And recently, vinsworldcom and I collaborated on getting more of the pragmas into the auto-completion and syntax highlighting lists.) Since it's been a couple years now, I should probably go check for the changes from 5.30 to 5.36 and add those in.

    Above my knowledge grade, I fear. But the language support system is written using plugins, so it would be possible to write a different plugin for every Perl version and then select the one currently in use.

    Not exactly. The function auto-completion feature is built in to Notepad++, and that's what's providing the popups with the selectable variants (such as your example with split having four variants). The syntax highlighting is done by the Scintilla/Lexilla Perl lexer that is included in Notepad++. You could, in theory, change the autoCompletion\perl.xml every time you wanted to change Perl version, restarting Notepad++ after that change, but I'm not sure it's worth the effort. Regarding LSP, there are a couple of people that I know are working on LSP clients for Notepad++, though they haven't been officially released yet; but I don't think even those would be easy to customize to easily swap between Perl versions.

    Will it also offer to insert a snippet with jump-points for the arguments?
    Not in the version I am using, but that does not mean it could not be done using a different plugin, which may even exist

    Notepad++ doesn't have a built-in snippet-with-jump-point feature. There are plugins for that, including the QuickText plugin that vinsworldcom maintains.

      My use of terminology may be inaccurate, but it's certainly possible to add syntax highlighting for new languages. One example is markdown, for which there is an implementation at https://github.com/Edditoria/markdown-plus-plus. My thinking was that each version of Perl might have its own file, such as perl5036.xml, treating it as an independent language in the same way as markdown. This would avoid the need to reboot for different languages. But I may have misunderstood something. This is still above my knowledge grade.

      Regards,

      John Davies

        Yes, you are correct; I hadn't thought of doing it that way. You could make a separate User Defined Language (UDL) for each version of Perl, and define a separate autocompletion file for each of those Perl-version UDLs. Since the UDL features aren't as powerful as the built-in lexers, you would then be sacrificing some of the syntax-highlighting capabilities and subtleties in order to gain the specific results in the auto-completion suggestions. Knowing those tradeoffs, and understanding the cost (time and effort) involved in creating all those UDL and autocompletion files, any particular user could make the decision of which way to go for themselves.
        > My thinking was that each version of Perl might have its own file, such as perl5036.xml,

        These static files tend to age very badly and maintenance is no fun ° ...

        My idea - and I've discussed this recently with haj, who currently maintains cperl-mode - is to have CPAN-modules which return the necessary code intelligence.

        The IDE would just need to initialize at startup - best with caching - what it finds in @INC.

        If via LSP or a native API should be up to the IDE plugin maintainer.

        Like this switching between Perl versions would be easy, just install the necessary modules via cpanm.

        I'm just in the process to write such a module using core modules. And attempt to build a proof of concept with emacs and a web demo in JS.

        Cheers Rolf
        (addicted to the Perl Programming Language :)
        Wikisyntax for the Monastery

        °) e.g. emacs has built in GNU info browser, and cperl-mode offers to browse Perl docs via info, but the last available info file for download was for v5.08 IIRC.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11145776]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-04-24 03:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found