Open rkshthrmsh opened 1 year ago
There's a TODO for supporting numbers for Module.id
here: https://github.com/helix-editor/helix/blob/39052433edd4dcbd3a9714e6e3036cbd46ebc959/helix-dap/src/types.rs#L314
I believe I have a fix (will PR) for the "String || Number" problem, but I seem to have a different bug. Could you, @rkshthrmsh, provide your languages.toml
config for the debugger? Do you still get to the above error when you try to run :debug-start
, or do you now get an error even sooner than that one?
Using the debug config provided by @RmStorm, I get the error "No such file (...) "<directory-open-in-helix>/{0}"
. I think the {0}
is supposed to be converted into the path of the open file, but instead its being interpreted literally.
In @RmStorm's config, if I replace args = { mode = "debug", program = "{0}" }
with args = { mode = "debug", program = "run.py" }
, so that I am now hardcoding the filename run.py
, I can successfully run the debug.
Hi @thomasaarholt, here's my languages.toml
:
[[language]]
name = "python"
[language.debugger]
name = "debugpy"
transport = "stdio"
command = "python3"
args = ["-m", "debugpy.adapter"]
[[language.debugger.templates]]
name = "source"
request = "launch"
completion = [ { name = "entrypoint", completion = "filename", default = "." } ]
args = { mode = "debug", program = "{0}"}
Hardcoding the file name, as you mentioned, did not have any effect for me. The program was still suspended by my terminal, and the terminal still got messed up. I tried providing the full path to the file as well. Was there something else you tried?
I've opened #7637, since I at least experience the {0}
in multiple debuggers (rust and python). I think its either a regression, or something wrong with my system. It would be nice for me to get confirmation if its the latter.
I still get a messed-up terminal when things crash, but if I replace {0}
with run.py
(my script's name), and run hx -v run.py
followed by :debug-start
, I get one step further in the debugging process, and the error messages are different in the log (:log-open
). I'm able to fix this second error in my bugfix PR (not submitted yet), but I still do have more errors that are similar.
The first error (using {0}
) is:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/thomas/codes/test-fabrica/{0}'
The second error, using run.py
is:
2023-07-15T17:49:22.828 helix_dap::transport [ERROR] err: <- Parse(Error("invalid type: integer `0`, expected a string", line: 0, column: 0))
Make sure you are on a new-ish build of helix. You can see the logs using :log-open
and scroll to bottom.
I still get a messed-up terminal when things crash
Can confirm, though it's only at the beginning. It seems as though Helix was being forcefully suspended with Ctrl+Z, causing some terminals like Kitty to freak out. I then used fg
to return to Helix, and debugging kind of works. I did apply a patch for correctly parsing Module.id as well.
Any update on this? Would love to spend some more time in Helix, but as a Python developer the lack of support for debugpy is holding me back slightly.
I have the same problem. In the meantime I use helix in combination with the pudb debugger in a tmux session. Works for me quite well.
Since there was no progress on this issue I proposed my solution for problem with parsing. Helix still breaks terminal on hitting any breakpoint, but I believe this might be one step forward solving underlying issue
I currently use Helix for my main work, but as I need to debug a lot of python code I have to have Jetbrains in addition. Now I'm struggling with poetry issues due to a Jetbrain bug so I have to do side-IDE hopping to compensate :smile:
I'm very interested in this, but I don't know rust. Does anyone know the specific places that has to be changed to support this? Anyone more experienced that knows how we could make it easier for us nuubs to jump in and contribute to this part? Could we instead of supporting ints, just transform integers into strings beforehand somehow?
While trying to integrate debugpy, it seems that Helix is unable to parse the
stackTrace
response. This is possibly because Helix is attempting to interpretModule.id
and / orStackFrame.moduleId
as a string instead of a number, which is what debugpy returns. The DAP spec recommends either of these types for those fields. Here is a log from Helix:Related issue in debugpy repo: https://github.com/microsoft/debugpy/issues/1227