vscode-java icon indicating copy to clipboard operation
vscode-java copied to clipboard

How do I map the Run Configuration from IntelliJ to VSCode?

Open xxc-zsz opened this issue 2 years ago • 4 comments

I want to have the same run configuration I have on Intellij the same as I do for VS Code. But I am not sure how to go about doing that. I tried the launch.json on VSCode but I am not sure what fields I have to put to make it work.

Anyone with experience with this?

Here is what I am referencing: enter image description here

Essentially when I click the Run Button on the top right of the intellij it runs that particular run configuration picture.

Is there a way for me to do the same on VSCode?

xxc-zsz avatar Jul 20 '22 07:07 xxc-zsz

  1. If .vscode/launch.json doesn't exist in your workspace, you could click the link "create a launch.json file" and Java Debugger will create a initial launch.json file with some base configuration for your Java application. image

  2. Type a "" in launch.json, VS Code will provide a list of completion suggestions on the supported configs. If you want to add environment variables for your program, you can type "env": { "key": "value"}. image

testforstephen avatar Jul 20 '22 09:07 testforstephen

I'm really sorry. I understand that, but I dont know what fields are compatible/I should put. The screenshot is those fields, but when I put "gradle" as key and value "dee_api_gw", it does nothing. So im not sure what to put.

xxc-zsz avatar Jul 22 '22 00:07 xxc-zsz

If you're talking about how to add environment variables, the env is exactly for that. Could you pls share your launch.json configuration?

testforstephen avatar Jul 22 '22 01:07 testforstephen

I think @xxc-zsz wants to run Gradle task :test for project dee_api_gw, and wants to save the action. AFAIK Tasks is for that. You probably want to install Gradle extension for richer features. /cc @CsCherrYY

Eskibear avatar Jul 22 '22 06:07 Eskibear