Hi Denis,

This is the VSCode extension: [Local Lua Debugger - Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=tomblind.local-lua-debugger-vscode). I found the documentation on this page really useful, especially the Tips section, so I would read carefully. There are lots of examples.

It has one setting only, the default version of lua you want the debugger's interpreter to use.

I have the following in my launch.json to run the debugger:

{
"type": "lua-local",
"request": "launch",
"name": "Lua Local: pandoc-argmap.lua",
"program": {
"command": "pandoc",
},
"args": [
"examples/example.md",
"-o",
"Output/example.html",
"--lua-filter pandoc-argmap.lua",
],
"env": {
"PATH": "X", // Not sure what debugger uses by default but I had to add mine here.
"LUA_PATH": "Y", // Not sure what debugger uses by default but I had to add mine here.
"LUA_CPATH": "Z", // Not sure what debugger uses by default but I had to add mine here.
},
"stopOnEntry": true, // use this when getting set up, set to false to have debugger stop on breakpoints only.
},

Then in VSCode debug mode run the launch profile.

The VSCode UI breakpoints work on normal lua code, but not pandoc lua filters, so you will instead have to use this code to stop the debugger:
require("lldebugger").start()

See the extension's documentation for customisation of this breakpoint snippet, and more complex scenarios.

This is just what worked for me. I'm pretty new to pandoc and lua, and haven't used VSCode a whole lot either, so there are probably other and better ways to do all this.

Thanks,

Mike

On Monday, 25 July 2022 at 10:44:03 UTC+1 denis...-NSENcxR/0n0@public.gmane.org wrote:

Hi Michael

 

That sounds interesting. Would you mind sharing your workflow. I would very much learn how that works for pandoc filters.


Best,

Denis

 

Von: pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <pandoc-...@googlegroups.com> Im Auftrag von Michael Hayes
Gesendet: Mittwoch, 13. Juli 2022 01:46
An: pandoc-discuss <pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Betreff: Re: Using lua filter include-files on pandoc 2.5 does not work

 

I've been using VSCode with the local lua debugger extension to debug pandoc lua filters, and it works great.

--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/aedaea34-387e-4726-bf36-8a34c94b3291n%40googlegroups.com.