javamavenvisual-studio-codebamboo-specs

How to enable Intellisense for Bamboo Specs Java in VSCode


Is it possible to have Intellisense support for Bamboo Specs Java in VSCode? Here's what I have done so far.

  1. I have JDK, JRE and Maven installed and working.
  2. I have Java extension pack for VSCode installed and working.
  3. Created a basic Bamboo Specs template from Atlassian's instructions.
  4. Tested project with mvn test, which seems to download all dependencies provided in pom.xml file.

But when I open Bamboo Specs Java file (PlanSpec.java), the VSCode's Java plugin reports that Classpath is incomplete and I get no Intellisense on Bamboo Specs classes.

Without Intellisense creating and editing Bamboo Specs Java is a total pain, and I'm not in favor of using Eclipse or IntelliJ IDEA only for the sake of Bamboo Specs editing.


Solution

  • I figured it out. I had to pay attention to this note in plugin's warning description:

    You need to open a folder containing a pom.xml, build.gradle or at least default eclipse setting files, so that a complete classpath and project hierarchy can be set.

    So the solution is to open VSCode directly at the place where pom.xml is located, which is usually not the case with real projects/repositories. Usually we'd place Bamboo Specs and everything related to it (including pom.xml) in bamboo-specs subfolder of the repository root. So for the sake of editing Bamboo Specs we'll have to reopen VSCode in specs root, which is weird, but still better than running Eclipse or IntelliJ IDEA only for that.