-
Notifications
You must be signed in to change notification settings - Fork 646
Allow debugging of different files with main function from the same directory #1229
Comments
When mode is not exec and the program points to a file and not directory, |
@ramya-rao-a Thanks for your reply. Unfortunately no. Let's think of a situation where we have a Since they are all in the same folder, and the current I am also taking this class where they put all the executable |
good point |
@MZhoume I believe we need to check for the existence of the Take the case of a main package with multiple files. Only one of them will have the main function and I believe delve can only "run" the file with the main function and not the others. Can you confirm? |
@ramya-rao-a Yes, However, |
The simplest way to do this is to update https://github.com/Microsoft/vscode-go/blob/0.6.69/src/debugAdapter/goDebug.ts#L283 to replace the below
with
The catch is that this will break the debugging feature for folks who have given file paths to the To solve this, we will have to parse the file, and add the check for the main function in the above PRs are welcome. |
Hi @ramya-rao-a, I'm interested in working on this issue (although it could be a little stale now)! I've had a look at the code and managed to set up my local environment for debugging the debugger. Thanks to your comments I have a good idea of the change I need to make to support this. Currently, the way I'd like to perform the file-parsing to detect the existence of the Before I get too deep into refactoring, does this sound like an approach you'd support for a PR? |
@chrislewisdev Yes, that sounds reasonable. I would suggest not to try to refactor and re-use the code in |
What is the status of this ticket? is there a plan to merge the PR soon? |
Above was my conclusion in Instead, below is the approach we would like to take to fix this issue:
PRs are still welcome. |
When "Start Debugging" or "Run without Debugging" runs without an explicit launch configuration (launch.json), we need to use the directory of the file as the program. That is consistent with the default GoDebugConfigurationProvider provides as the default DebugConfigurations. (${fileDirname}). Update microsoft#1229 and microsoft#3096
When "Start Debugging" or "Run without Debugging" runs without an explicit launch configuration (launch.json), we need to use the directory of the file as the program. That is consistent with the default GoDebugConfigurationProvider provides as the default DebugConfigurations. (${fileDirname}). Update microsoft#1229 and microsoft#3096
When "Start Debugging" or "Run without Debugging" runs without an explicit launch configuration (launch.json), we need to use the directory of the file as the program. That is consistent with the default GoDebugConfigurationProvider provides as the default DebugConfigurations. (${fileDirname}). Update #1229 and #3096
The fix associated with this issue is now available in the latest version of the extension When the |
Thanks again for this amazing extension.
Regarding the debugging adapter, it would be nice to be able for us to debug a single
.go
file.The
program
is only evaluated if the mode is set toexec
, but notdebug
. However,delve
supports debug specific file:del debug single.go
.Please let me know if that can be implemented. Thanks in advance!
The text was updated successfully, but these errors were encountered: