Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java options warning not handled #1188

Closed
Arthurm1 opened this issue May 24, 2023 · 0 comments · Fixed by #1228
Closed

Java options warning not handled #1188

Arthurm1 opened this issue May 24, 2023 · 0 comments · Fixed by #1228

Comments

@Arthurm1
Copy link
Contributor

steps

setup a build that causes javac to give a warning on an option setting.

In my case - I was using JDK 19 + Scala + javac option: "-source 17" which gives the following on compilation...

warning: [options] system modules path not set in conjunction with -source 17

Note there is no file or line number in this warning.

problem

The JavaSpecParser can't parse this type of warning and so returns:
Unexpected javac output: warning: [options] system modules path not set in conjunction with -source 17

The JavaSpecParser seems to ignore all subsequent errors if there are any.

This makes it quite difficult to work out why my app isn't compiling when I do have errors as Metals doesn't report any errors or highlight any issues with code. The only way I can tell that my app isn't compiling (and why) is to look in the Metals logs.

expectation

Ideally Zinc would interpret these kind of warnings and then go on to report any further warnings/errors.

JavaSpecParser seems to realise when it can't interpret an error. I'm wondering whether it would be better to report an error in this case. Maybe even with something like Zinc cannot interpret following error XXX - raise an issue. Currently, not reporting an error on failed parsing means compilation can fail silently. Or will that cause more problems than it fixes?

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 a pull request may close this issue.

1 participant