-
Notifications
You must be signed in to change notification settings - Fork 411
Description
I'm attempting to migrate from Intellij IDEA to VSCode, and everything's gone mostly well to be honest except for one minor thing. The Use classpath of module setting in Intellij doesn't appear to directly map to projectName as implied here. Intellij allows me to specify a dot path to a particular folder in my app structure, while projectName restricts to only the base package name.
For example, here's my folder structure for a Spring Boot app:
app
└── src
├── main
| ├── java
| | └── com.hello.world
| └── resources
| └── application.yml
└── test
├── java
| └── com.hello.world
└── resources
└── application.yml
Note: app is only one of the many projects found in the root folder. Though it should be the only one relevant to this issue.
And here's my launch.json:
{
"configurations": [
{
"type": "java",
"request": "attach",
"name": "Debug (Attach)",
"hostName": "localhost",
"port": 8083
},
{
"type": "java",
"request": "launch",
"name": "Debug (Launch)",
"console": "integratedTerminal",
"cwd": "${workspaceFolder}",
"mainClass": "com.hello.world.Application",
"projectName": "app"
}
]
}
The issue I'm having, if you haven't guessed already, is the Java Debugger appears to be searching for classes and settings from application.yml via the path app which includes classes and settings found in the test folder. I'd like it to only search the app/main path instead.
I accomplish this in Intellij by setting Use classpath of module to RootFolderName.app.main where RootFolderName maps to the top-level gradle project. I'm forced to set projectName only to app which breaks my application in some respects because it applies unwanted settings automatically from the test folder.
Also note that I am generally a beginner with respect to some terminology within the Java world, so if some explanations seem off that's why. I'm very keen to solve this issue! Would anyone be able to point me in the right direction from here?
Environment
- Operating System: Mac OS 10.14.6
- JDK version: 11.0.4
- Visual Studio Code version: 1.40.1
- Java extension version: 0.8.0
- Java Debugger extension version: 0.23.0