Skip to content

Prompt to add the folder to source path if the running file isn't on classpath - #688

Merged
Jinbo Wang (testforstephen) merged 3 commits into
masterfrom
jinbo_classpath
Oct 14, 2019
Merged

Jinbo Wang (testforstephen) merged 3 commits into
masterfrom
jinbo_classpath

Conversation

@testforstephen

@testforstephen Jinbo Wang (testforstephen) commented Oct 12, 2019 •

Copy link
Copy Markdown
Contributor

Signed-off-by: Jinbo Wang [email protected]

It requires microsoft/java-debug#302
Close #470

When the Java file isn't on the source path of any project, JDT doesn't build it to .class. Run it via codelens or context menu, the runtime will throw class not found error. One improvement is to provide a fix option to ask user to add the parent folder to Java source path.

if (parentPath === parentUri.fsPath) {
parentPath = path.basename(parentFsPath);
}
const ans = await vscode.window.showWarningMessage(`The file ${fileName} isn't on the classpath, the runtime may throw class not found error. `

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"in" or "on" the classpath?

@testforstephen Jinbo Wang (testforstephen) Oct 12, 2019 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JDT api called it isOnClasspath, i would keep it consistent.

@testforstephen
Jinbo Wang (testforstephen) deleted the jinbo_classpath branch October 14, 2019 04:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disable code lens for the java file not in the project's classpath

2 participants