Repository navigation
Linux: symlinks are not resolved [breakpoints] #2
Description
Activity
Please open the logs(in $XDG_DATA_HOME/emmylua_dap/logs) to inspect the path used when adding a breakpoint, and print (debug.getinfo(1).source) inside files that are symbolic links.
to inspect the path used when adding a breakpoint
The
SetBreakpointsrequest points to the actual file, not the link.print (debug.getinfo(1).source) inside files that are symbolic links
It just shows
@symlink.lua(for the example I gave above)The issue was caused by inconsistent paths, but it can be fixed on the dap side.
add this code to your plugin.emmy = {} function emmy.fixPath(oldPath) return oldPath -- replace to symbolic link file end
add this code to your plugin.
emmy = {}
function emmy.fixPath(oldPath)
return oldPath -- replace to symbolic link file
endMight be me being dumb, but this does not seem to work.
Do you have access to a Linux machine? e.g., can you repro on your end?
add this code to your plugin.
emmy = {}
function emmy.fixPath(oldPath)
return oldPath -- replace to symbolic link file
endMight be me being dumb, but this does not seem to work.
Do you have access to a Linux machine? e.g., can you repro on your end?
I only have a Linux system on the internal network where I can't install anything. I can't verify this on Windows, but from the symptoms you described I already know how to handle it.
emmy is a global table accessed by emmylua_debugger to extend related logic, so first ensure emmy is defined on the global table, and you can add a print to the fixPath function to prove it is being called.
relation C++ code: https://github.com/EmmyLua/EmmyLuaDebugger/blob/9581ca555c6b96475da7c6d4c35a070f02310416/emmy_debugger/src/debugger/emmy_debugger.cpp#L622
Okay, the workaround works! Thanks for the suggestion.
For neovim users, this works:
_G.emmy = {} function _G.emmy.fixPath(oldPath) return vim.uv.fs_realpath(oldPath) -- replace to symbolic link file end
Hello,
Problem
I'm using
emmylua_dapto debug neovim plugins (with nvim-dap). Some of these plugins are symlinked. When I create a breakpoint in one of their files, it is completely ignored by emmylua. After unlinking the folder and copying the actual files over, breakpoints work normally.Expected Behavior
Symlinks are properly resolved
Reproduction
Playing around with neovim plugins is actually not needed at all. A bare
Should be able to repro