From 63e69bd312c958b0dd544148ef2e4fee5a2b4536 Mon Sep 17 00:00:00 2001 From: Gabriel Filion Date: Mon, 1 Feb 2021 14:30:08 -0500 Subject: [PATCH] Create a document with instructions on how to integrate with vimspector This is a self-contained set of instructions to get people up and running with vimspector using puppet-debugserver. --- editor-services/content/en/docs/vimspector.md | 114 ++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 editor-services/content/en/docs/vimspector.md 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. +