Perl Navigator Language ServerProvides syntax checking, autocompletion, perlcritic, code navigation, hover for Perl. Implemented as a Language Server using the Microsoft LSP libraries along with Perl doing the syntax checking and parsing. Works on Windows, MacOS, and Linux. The vscode extension includes everything needed to work, no additional installation should be necessary. Works on almost any version of Perl, tested all the way back to Perl 5.8. Has full support for multi-root workspaces, single file editing, and multiple open windows. Install the vscode extension from here: https://marketplace.visualstudio.com/items?itemName=bscan.perlnavigator Currently Implemented Features:
Visual Studio Code DemoVscode InstallationInstall the VSCode extension and it should just work. All required dependencies are bundled with the extension. Please file a bug report if the Perl Navigator does not work out of the box. Perl::Critic and perlimports are not currently bundled and need to be installed independently, but the remaining features (e.g. navigation, autocomplete, syntax check) do not require it. Perl pathsIf you have a nonstandard install of Perl, please set the setting Perl Critic CustomizationYou should specify a Perl::Critic profile via Perl Tidy CustomizationIt is recommended to set Perlimports CustomizationPerlimports offers additional diagnostics when imports can be cleaned up. When perlimports is enabled, "Format Document" and "Format Selection" will run perlimports in addition to perltidy.
By default, perlimports is not enabled, but the diagnostics (linting) can be enabled with Building For VSCode/VSCodiumIn addition to node.js and npm you will have to install vsce, a tool for packaging (among other things) extensions in the .vsix format used by both VSCode and VSCodium by running the following:
At this point all that's left to do is install the resulting .vsix file (located in the current directory) in VSCode or VSCodium by navigating to the Extensions pane and choosing "Install from VSIX...". Installation For Other EditorsCurrently, this is not yet packaged for other editors but you can build from source. You'll need to have node.js and npm installed.
Sublime TextSublime Text requires the following minimum settings under LSP settings (modify depending on your install location and editor)
EmacsYou can use perl navigator with either lsp-mode or eglot. Eglot is built-in starting with emacs version 29. Emacs eglotThe following is a sample configuration file to use the navigator with emacs and a custom perl location. This config uses company-mode, but is not required.
Emacs lsp-modeYou can also use lsp-mode with emacs if you prefer. You can use something similar to the following configuration. Additional details here
NeovimNeovim requires nvim-lspconfig. An optional, but highly recommended, set of plugins is mason and mason-lspconfig which you can use to automatically install Perl Navigator. The simplest configuration is the following:
A configuration with a number of options set looks like:
coc.nvimThe configuration can be added directly to coc-settings (
Or the coc-perl client extension can be used, simplifying overall configuration.
A simple configuration to enable PerlNavigator, after installing coc-perl (
KateFor the Kate editor, you'll need to
Raku / Other ProjectsFor those interested in a Raku language server, check out: https://github.com/bscan/RakuNavigator Licenses / AcknowledgmentsThe Perl Navigator is free software licensed under the MIT License. It has a number of bundled dependencies as well, all of which have their respective open source licenses included. This work is only possible due to Class::Inspector, Devel::Symdump, Perl::Critic, PPI, Perl::Tidy, perlimports, Sub::Util, Perl itself, Microsoft LSP libraries, and ideas from Perl::LanguageServer and PLS. |