diff --git a/editor-services/content/en/docs/vimspector.md b/editor-services/content/en/docs/vimspector.md new file mode 100644 index 0000000..b69f9cb --- /dev/null +++ b/editor-services/content/en/docs/vimspector.md @@ -0,0 +1,114 @@ +# Using puppet-editor-services with Vim + +Vim has a debugging interface plugin called +[https://github.com/puremourning/vimspector](vimspector) that uses the +[https://microsoft.github.io/debug-adapter-protocol/](Debugger Adapter +Protocol) for communicating with language servers. + +It is thus possible to integrate vimspector with puppet-editor-services to +debug puppet catalog compilation for manifests. + +This document shows how to integrate vimspector with puppet-editor-services +once you already have the vimspector plugin installed. Please refer to the +plugin's README file for instructions on how to install it. + +Note that this document shows the same information as is present in +vimspector's wiki, but with more verbose instructions: + +https://github.com/puremourning/vimspector/wiki/languages#puppet + +## Create a gadget installer file + +First, we'll create a file that tells vimspector how to download and install +puppet-adapter-services and also how to run it. This file needs to be located +under the vimspector plugin directory: + + vimspector$ mkdir -p gadgets/custom + vimspector$ cat > gadgets/custom/cust_puppet-debugserver.json < 'DPkg::Pre-Install-Pkgs {"/usr/bin/apt-listbugs apt";};', + priority => 5, + } + +* `puppet-debugserver` currently doesn't have the ability to stop on entry. So + before starting a debugging session, you should set at least one breakpoint + somewhere in the code. +