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

Comments

Projects
None yet
2 participants
@actboy168

actboy168 commented Jul 17, 2018

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

This comment has been minimized.

Show comment
Hide comment
@weinand

weinand Jul 17, 2018

Member

@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?

Member

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 label Jul 17, 2018

@actboy168

This comment has been minimized.

Show comment
Hide comment
@actboy168

actboy168 Jul 17, 2018

package.json

actboy168 commented Jul 17, 2018

package.json

@weinand

This comment has been minimized.

Show comment
Hide comment
@weinand

weinand Jul 17, 2018

Member

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.

Member

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

This comment has been minimized.

Show comment
Hide comment
@actboy168

actboy168 Jul 17, 2018

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

actboy168 commented Jul 17, 2018

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

@weinand

This comment has been minimized.

Show comment
Hide comment
@weinand

weinand Jul 17, 2018

Member

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"
Member

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

This comment has been minimized.

Show comment
Hide comment
@actboy168

actboy168 Jul 17, 2018

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 commented Jul 17, 2018

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

This comment has been minimized.

Show comment
Hide comment
@actboy168

actboy168 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.

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

This comment has been minimized.

Show comment
Hide comment
@weinand

weinand Jul 17, 2018

Member

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

Member

weinand commented Jul 17, 2018

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

@actboy168

This comment has been minimized.

Show comment
Hide comment
@actboy168

actboy168 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.

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 this to the September 2018 milestone Sep 13, 2018

@weinand

This comment has been minimized.

Show comment
Hide comment
@weinand

weinand Sep 17, 2018

Member

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

Member

weinand commented Sep 17, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment