Nihilus118 / perl-debug-adapter

MIT License
11 stars 1 forks source link

Perl Debug Adapter

This debug adapter invokes perl -d and handles communication with VS Code.

It should work out of the box on Linux, Windows and Mac using VS Code. It also works inside Microsofts Remote Extensions Remote-SSH, Remote-WSL and Remote-Containers.

Setup

VS Code

Other Editors and IDEs

As this extension implements the Debug Adapter Protocol it should be usable with other editors and IDEs aswell. Feel free to try it out and report any bugs that may occur.

Manual Install

Build dependencies:

Runtime dependencies:

Build

To build (on Linux), clone this repository and run the following in the root of the repository:

npm install
npm run compile

The adapter can then be invoked with

node -- out/debugAdapter.js

Install

To manually install this package, run the build steps above, then

prefix="/usr/local" # or wherever you want

npm install -g --install-links \
  --prefix "$prefix"
# Make sure that users can traverse to read the js being run
find "$prefix/lib/node_modules/perl-debug-adapter" \
  -type d -execdir chmod 755 '{}' +

# Replace the (broken) executable generated by npm with a wrapper script
rm "$prefix/bin/perl-debug-adapter"
cat <<EOF >"$prefix/bin/perl-debug-adapter"
#!/bin/sh
exec node -- "$prefix/lib/node_modules/perl-debug-adapter/out/debugAdapter.js" "$@"
EOF
chmod 755 "$prefix/bin/perl-debug-adapter"

then the adapter can be invoked with just

perl-debug-adapter

if $prefix/bin is in your PATH.