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

Publish scalameta parser diagnostics for Scala 3 #2807

Merged
merged 1 commit into from May 20, 2021

Conversation

tgodzik
Copy link
Contributor

@tgodzik tgodzik commented May 18, 2021

Previously, when the build was not imported and the fallback version set to Scala 3.0.0, we would get parsing errors in sbt files. Now, we added an explicit check to avoid it.

Fixes #2549

Comment on lines 405 to 409
val isNotSbt = !uri.getPath.endsWith(".sbt")
if (isNotSbt)
CompilerInterfaces.parseErrors(driver, uri, params.text)
else
Nil.asJava
Copy link
Member

Choose a reason for hiding this comment

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

I've checked scala2 PC and this method has an empty implementation and does nothing.

I'm wondering why we use it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Scala 3 parser diagnostics seem to be nicer, but maybe we can just remove it altogether?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed them, it should also fix some other issues

@tgodzik tgodzik changed the title Do not publish Scala 3 diagnostics for sbt files Do not publish Scala 3 parsing errors May 19, 2021
@tgodzik tgodzik changed the title Do not publish Scala 3 parsing errors Publish scalameta parser diagnostics for Scala 3 May 19, 2021
@tgodzik tgodzik requested a review from dos65 May 19, 2021 15:56
Copy link
Member

@dos65 dos65 left a comment

Choose a reason for hiding this comment

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

LGTM!

Let's unify the parsing errors are presented to the user, the Scalameta parser is much better now and it should make it a bit faster.

Also, this would cause issues in sbt files if the build was not imported and the fallback version set to Scala 3.0.0.
@tgodzik tgodzik enabled auto-merge May 20, 2021 09:29
@tgodzik tgodzik disabled auto-merge May 20, 2021 10:13
@tgodzik tgodzik merged commit b1c37db into scalameta:main May 20, 2021
@tgodzik tgodzik deleted the fix-sbt-warnings branch May 20, 2021 10:13
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.

Duplicate diagnostics getting reported from Dotty and Bloop
2 participants