-
Notifications
You must be signed in to change notification settings - Fork 85
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
feat: set cwd for dlv based on program #99
base: main
Are you sure you want to change the base?
Conversation
14d7ebf
to
468c74a
Compare
This potentially resolves leoluz#85. vscode-go sets dlv cwd based on the value of program. Reference: https://github.com/golang/vscode-go/blob/master/extension/src/goDebugConfiguration.ts#L545
468c74a
to
9959cb5
Compare
efeafcf
to
36c06fd
Compare
36c06fd
to
b49e81a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mcoqzeug Thank you for removing plenary dependency.
I noticed that you are re-implementing file path logic that is already available as vim functions. The get_parent
function for example can be replaced by fnamemodify
(see https://stackoverflow.com/questions/16485748/how-to-get-the-parent-directory-of-a-path-string). Similar strategy can be used to extract the file extension with filename-modifier :e
(see https://vimhelp.org/cmdline.txt.html#filename-modifiers)
e609d2e
to
6c29287
Compare
Thank you, I'm just using this branch, and it works. Hope this will merge soon. |
This potentially resolves #85.
dlv.executable.cwd
based on the value ofdebug_config.program
. Ifprogram
is a directory, setcwd
toprogram
. Ifprogram
is a path to a go file, setcwd
to its parent directory.program
to absolute path.We probably don't need
config.delve.cwd
anymore.Reference: https://github.com/golang/vscode-go/blob/master/extension/src/goDebugConfiguration.ts#L545