Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help needed for setting perl-debug up on nvim-dap #4

Closed
bmeneg opened this issue Aug 23, 2023 · 8 comments
Closed

Help needed for setting perl-debug up on nvim-dap #4

bmeneg opened this issue Aug 23, 2023 · 8 comments

Comments

@bmeneg
Copy link

bmeneg commented Aug 23, 2023

Hi @Nihilus118,

as we were discussing earlier on another discussion on perl-ide org, I started using this extension with nvim-dap, however, there're weird things happening. Using the following test script:

#!/usr/bin/perl
 
use v5.38;
use strict;
use warnings;

my $somevar = 112;

dosomething();
 
sub dosomething {
    print $somevar;    
}

I get the error on DAP (:DapShowLog):

[ DEBUG ] 2023-08-23T20:00:19Z-0300 ] ...g/.local/share/nvim/plugged/nvim-dap/lua/dap/session.lua:950 ]	1	{
  body = {
    category = "stderr",
    output = "Error parsing variable $EXECUTABLE_NAME: TypeError: (0 , unescape_js_1.default) is not a function\n"
  },
  event = "output",
  seq = 48,
  type = "event"
}
[ DEBUG ] 2023-08-23T20:00:19Z-0300 ] ...g/.local/share/nvim/plugged/nvim-dap/lua/dap/session.lua:950 ]	1	{
  body = {
    category = "stderr",
    output = "Error parsing variable $ARGV: TypeError: (0 , unescape_js_1.default) is not a function\n"
  },
  event = "output",
  seq = 49,
  type = "event"
}
...

Which goes on for every symbol found (even for $somevar), reporting as not a function.

[ DEBUG ] 2023-08-23T17:38:27Z-0300 ] ...g/.local/share/nvim/plugged/nvim-dap/lua/dap/session.lua:950 ]	1	{
  body = {
    category = "stderr",
    output = "Error parsing variable $somevar: TypeError: (0 , unescape_js_1.default) is not a function\n"
  },
  event = "output",
  seq = 12,
  type = "event"
}
[ DEBUG ] 2023-08-23T17:38:27Z-0300 ] ...g/.local/share/nvim/plugged/nvim-dap/lua/dap/session.lua:950 ]	1	{
  body = {
    variables = { {
        name = "$somevar",
        presentationHint = {
          kind = "data"
        },
        type = "UNDEF",
        value = "undef",
        variablesReference = 0
      } }
  },
  command = "variables",
  request_seq = 7,
  seq = 13,
  success = true,
  type = "response"
}

Even though I've some experience with LSP, that's the first time using DAP. So have an idea how DAP works, but I didn't have time to check out your extension code to see how the interactions with Perl debugger works.

Any advice is welcome :)

@Nihilus118
Copy link
Owner

Hi @bmeneg,

I will try to have a look at it this weekend even though I never worked with nvim-dap so far. The errors looks like the unescape_js package isn't installed properly. Did you run npm install in the base folder?

@bmeneg
Copy link
Author

bmeneg commented Aug 25, 2023

Yes, npm install seems just fine:

$ npm install

up to date, audited 465 packages in 2s

66 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

@Nihilus118
Copy link
Owner

I finally had the time to give this error a proper look. Adding one line to the tsconfig.json fixed the error for me.
Please pull the newest version of the master and try it out for yourself.

@WhoIsSethDaniel
Copy link

I no longer see the error.

@Nihilus118
Copy link
Owner

@bmeneg is it working out for you as well?

@bmeneg
Copy link
Author

bmeneg commented Aug 31, 2023

@Nihilus118 I didn't have the opportunity to test it yet, but I'll give it a try in a couple of hours and let you know.

@bmeneg
Copy link
Author

bmeneg commented Sep 1, 2023

@Nihilus118 really sorry for the late reply, but yeap! The issue was fixed with your last code change!
Many thanks for working on it. Time to test nvim-dap-ui with it :))

@bmeneg
Copy link
Author

bmeneg commented Sep 1, 2023

With that, I'm closing the issue.

@bmeneg bmeneg closed this as completed Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants