microsoft / microsoft/vscode-java-pack

Should support polyglot projects better

Open
#874 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

ai-triaged enhancement
Dominant language
TypeScript
Stars
352
Forks
166
Avg merge
17h 47m
Merged PRs (30d)
32

Description

Java projects are not automatically detected when a polyglot project is opened in VS Code. For example, microservice app (e.g. https://github.com/elgris/microservice-app-example) usually places each service into a separate folder, see the structure below. Since the root folder doesn't have any build file, Java extensions are not be activated automatically. Every time users have to open a Java file before using any Java feature, which is not convenient.

microservice
├── frontend
│   ...
│   └── package.json
├── backend
│   ...
│   └── pom.xml
└── README

To support polyglot project better, we can relax the activation event a little bit. For example, allow detection of build files from direct subfolders. VS Code activation events support glob pattern, which we can implement using workspaceContains:*/pom.xml. The glob pattern */pom.xml only scans two levels of directories and doesn't add much scanning cost.

    "workspaceContains:*/pom.xml",
    "workspaceContains:*/build.gradle",
    "workspaceContains:*/settings.gradle",
    "workspaceContains:*/build.gradle.kts",
    "workspaceContains:*/settings.gradle.kts",

This feature request applies to all Java extensions under Java pack.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Java extensions' activationEvents and compare their current workspaceContains patterns with the proposed direct-subfolder patterns. Verify the change with a polyglot workspace whose Java build files are one level below the root, and confirm Java features activate without first opening a Java file.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, typescript, vscode
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.