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

Support configurable presentation of project names in test runner

Open austpaul opened this issue 9 months ago • 1 comments

When working with vscode workspaces having multiple folders/projects, it would be useful to have more options on how the project names are presented in the test runner. In a complex setup, you might have tens of folders/projects open as the same time with a mixture of gradle and maven projects. Organizations might have repository naming conventions resulting in lengthy names, which makes it challenging to navigate with the current behaviour in the test runner. In addition, maven and gradle project are currently presented differently.

Gradle project without project name defined in settings.gradle: "project directory name" (might be lengthy in itself)

Gradle project with project name defined in settings.gradle: "root project name-project directory name" (results in even lenghtier names)

Maven project: "project artifact id"

Proposed behaviour:

Make it configurable which value should be presented.

  • vscode workspace file "folder.name"
  • file system folder name (typically same as the repository name)
  • maven project name or artifactId / gradle rootProjectName
  • a combination of the above

It would be especially nice to be able to choose the vscode workspace folder name, which allows for setting short context specific names.

An alternative is to introduce a default order of selection

  1. vscode workspace folder name if defined
  2. maven project name / gradle root project name if defined
  3. file system folder name

The maven plugin has a similar concept for the format of project node names.

Image Image

austpaul avatar Apr 19 '25 19:04 austpaul

Hi @austpaul, I'm an AI Support assistant here to help with your issue. While the team reviews your request, I wanted to provide some possible tips and documentation that might help you in the meantime.

Suggested workarounds

  • Rename folders in a .code-workspace file to control the folder display name:

    • VS Code will use the name field in each workspace folder entry when available
    • See Multi-root Workspaces: https://code.visualstudio.com/docs/editor/multi-root-workspaces#_saving-your-workspace
  • For Maven projects, you can customize the project node name in the Maven Explorer (not the Test Explorer) via the maven.explorer.projectName setting:

    • ${project.artifactId} / ${project.name} / ${project.artifactId}-${project.version}, etc.
    • Docs: https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-maven#settings

Next steps

  • To get this feature in the Java Test Explorer, please open an enhancement request against the Java Test extension: https://github.com/microsoft/vscode-java-test/issues/new?template=feature_request.md

duplicateUrls

**Other references with low confidence

  • Have run configurations and tests use Gradle (#1235)

    • Discussion on creating Gradle run configurations; doesn’t address test-runner naming
  • Improve test debug configuration (#102 comment)

    • Mentions configuring test project but focused on debug watches/evaluations
  • Simplify the test message (#1393)

    • About trimming stack traces in test messages, not project naming

The team will respond to your issue shortly. I hope these suggestions are helpful in the meantime. If this comment helped you, please give it a 👍. If the suggestion was not helpful or incorrect, please give it a 👎. Your feedback helps us improve!

github-actions[bot] avatar Nov 13 '25 01:11 github-actions[bot]