Now Published as VSCode Extension!
The newest (v0.3.4) release now appears in VSCodeās Extension āMarketplaceā, to allow for easy install and update. To install ā in Visual Studio Code ā use Shift + ā + X to bring up āExtensionsā in VSCode, then search for āRouterOS LSPā and this plugin will appear. Next, hit the āInstallā button, where it will prompt you itās pre-release from an unverified developer. This method allows the extension to be updated as fixes and new features are add.
Once the LSP is nstalled to VSCode in all case it must configured to use a RouterOS device via REST API to get
/console/inspect
data. In VSCode you can bring up āSettingsā using ā + , then search for āRouterOS LSPā. There the ābaseUrlā (https:// ā without trailing / or path), āusernameā, and āpasswordā must be set. The README.md explains more on configuration ā like using a RouterOS account with less permissions since only
/console/inspect
is used and NO writes are done by the LSP.
Improvements
Made some improvements from the prototype (v0.1.x), so weāre at the 0.3.x chain. As described in #1 post, the RouterOS LSP can be downloaded from GitHub Releases, and the README.md for the project has installation and other details. Also there is new CHANGES.md that details the known issues and has a version changelog.
While other fixes to various behaviors⦠some notable changes include:
Fidelity to RouterOS Colors
LSPās semantic tokens are now matched one-to-one with RouterOS āhighlightsā used in CLI. So the default color scheme (at least for NeoVim and VSCode) should roughly match RouterOS color scheme. The semantic tokens also let the user customize specific parts like a ācmdā, ādirā, āargā, etc. as desired. It does not yet colorize types like āipā, ānumā, āarrayā, etc yet ā
/console/inspect
does not provide those, so theyād need to be inferred by regex (not done).[/i]
Better NeoVim Support
The provided example Lua script (nvim-routeros-lsp-init.lua) to load LSP into NeoVim has been expanded and ācorrectedā in a few places. The example now adds semantic tokens support to use same coloring as VSCode (and RouterOS). It also by default enables āautocompleteā, which always show the completion options if / : = are typed. This makes NeoVim (nvim) act a bit like RouterOS āhotlockā feature. As such, it can be disabled by changing the āhotlockā to false in āsettingsā at top of the Lua script. Since example setup Lua avoids person preferences (so there is no ā+Space configured), to let user customize as needed, completion can always be done using āX then āO (for āomnicompā) even when āhotlockā is disabled.
Logging and Performance Improvements
Completions, syntax checking, and more all make a REST call to RouterOSās /console/inspect. So reducing the number of calls needed has a big impact on performance. In the current release, the number of calls are reduced, more could be done like caching or avoiding duplicative calls. Also the new release does ācleanupā the logs to avoid using large ādumpā, so easier to trace (including # REST calls). To access the logs in VSCode, use Shift + ā + X to bring up the āOutputā panel, and select āRouterOS LSPā from dropdown. For NeoVim, see their docs on accessing LSP logs
