redhat-developer / redhat-developer/vscode-java

Scala import cannot be resolved in Java project

Open
#554 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

compile
Dominant language
TypeScript
Stars
2.3k
Forks
546
Avg merge
20h 1m
Merged PRs (30d)
11

Description

I am working on a Java Play 2.6 project and wanted to switch from eclipse (ScalaIDE) to VSCode (because I use VSCode for everything else and I largely prefer to work with it rather than eclipse).

In Eclipse, I have no problem importing a Scala source ( scala.collection.Seq ) but in VScode, opening the same Eclipse project and having no problem with all other external librairies, it cannot resolve the scala.collection.Seq import. (more precisely it's the scala.collection import ).

When compiling my project in the console using sbt, I have no problem.
Also Eclipse is able to resolve that import. Maybe it has to do with the "Scala library container" exlipse plugins of ScalaIDE

Environment
  • Linux Ubuntu 16.04
  • JDK version: 1.8
  • Visual Studio Code version: 1.23.1
  • Java extension version: Language support for Java(TM) by Red Hat 0.26.0
Steps To Reproduce
  1. Create a Java play project using sbt
  2. Import it in ScalaIDE
  3. Create a class that imports scala.collection.Seq
  4. Open the project in VSCode.

Logs : No errors in the logs.

Contributor guide

Open the contributing guide

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 reproducing the issue with a Java Play 2.6 project created with sbt, then compare VSCode's dependency resolution with the working Eclipse and console builds. The issue is done when the Java project resolves the scala.collection.Seq import in VSCode without errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, scala, vscode
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.