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

Specify the current directory of the debugger #54465

Closed
actboy168 opened this issue Jul 17, 2018 · 10 comments
Closed

Specify the current directory of the debugger #54465

actboy168 opened this issue Jul 17, 2018 · 10 comments
Assignees
Labels
api debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality on-testplan

Comments

@actboy168
Copy link

I am using a process to implement the debugger, like this

{
    "program": ".\\bin\\lua.exe",
    "args": [
        ".\\script\\main.lua"
    ]
}

For program, its relative path is based on the extension directory. But for args, its relative path is based on the vscode directory. This directory has no value for the extension, so I want to specify the current directory of the program.

@weinand
Copy link
Contributor

weinand commented Jul 17, 2018

@actboy168 what does your JSON snippet from above show?
A part of the extension's package.json or a launch config from the launch.json?

@weinand weinand added the debug Debug viewlet, configurations, breakpoints, adapter issues label Jul 17, 2018
@actboy168
Copy link
Author

package.json

@weinand
Copy link
Contributor

weinand commented Jul 17, 2018

why are you trying to "reach" outside of your extension folder for one argument (the .\\script\\main.lua)?

The program to debug comes as an argument via the "launch" request.

@actboy168
Copy link
Author

".\script\main.lua" is the code for my debugger, not the code to debug target.

@weinand
Copy link
Contributor

weinand commented Jul 17, 2018

If I remember correctly then a debug adapter executable is specified like this:

	"runtime": ".\\bin\\lua.exe",
	"program": ".\\script\\main.lua"

or even:

	"runtime": "lua",
	"program": ".\\script\\main.lua"

@actboy168
Copy link
Author

According to the docs, runtime only supports two options: node and mono.

https://github.com/Microsoft/vscode-docs/blob/master/docs/extensions/example-debuggers.md

@actboy168
Copy link
Author

actboy168 commented Jul 17, 2018

I think my package.json is ok. VSCode does create a lua.exe process and correctly applies args as a command line argument. The problem is that the current directory of this process is the directory of VSCode, and I want to change it.

@weinand
Copy link
Contributor

weinand commented Jul 17, 2018

The doc might be outdated. The implementation probably allows any runtime.
Please try it.

@actboy168
Copy link
Author

actboy168 commented Jul 17, 2018

OK, runtime is also work. But the current directory of the process is still the directory of VSCode.program will be rewritten as an absolute path based on the extension directory, which will solve some of my problems. But I still need to know where the extension directory is.

@weinand weinand added feature-request Request for new features or functionality api labels Sep 7, 2018
@weinand weinand added this to the September 2018 milestone Sep 13, 2018
@weinand
Copy link
Contributor

weinand commented Sep 17, 2018

This is fixed by the new API made available as part of #56646

@weinand weinand closed this as completed Sep 17, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality on-testplan
Projects
None yet
Development

No branches or pull requests

2 participants