redhat-developer / redhat-developer/vscode-java

Compact source files should not cause package error when placed in subfolders

Open
#4,213 13 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I am a teacher and I want to use Compact Source files in my courses. But since the students will have many programs to write, I want to place them in subfolders. Right now, when I do that, I get a compile error that the package does not match the folder where the Compact Source file is located : The declared package "" does not match the expected package "sandbox" Java(536871240) .

Is it possible to add the relative path of the Compact Source implicitly to the classpath/sourcepath while compiling/running/debugging the file? So each time a Compact Source is detected, only the relative path to that file is added, not all path to all Compact Source in the project. An option could be useful, like "Implicitly add relative path of Compact Source to sourcepath : true/false".

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

Reproduce the Java(536871240) package error with a Compact Source file in a subfolder, then trace how Compact Source files are handled during compilation, running, and debugging. Done means the file works from its subfolder without the package-mismatch error, and only its relative path is added to the sourcepath when the behavior is enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, typescript, vscode
Domain
developer-experience, tooling
Issue type
Feature
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.