-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Report the correct errors in the IDE and add test infrastructure for diagnostics #5484
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
Conversation
47a1e35
to
853f8ea
Compare
853f8ea
to
e51bd0f
Compare
e51bd0f
to
96167e6
Compare
Interesting. Because the code didn't pass frontend, it would never reach |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Could you also add a test for the pure expression in warning position
in the worksheets?
assertEquals(expectedParams, actualParams) | ||
|
||
this | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other "actions" in this file usually do
def foo(marker: CodeMarker, expected: ...) = doAction(new Foo(marker, expected))
Any reason for not following the same pattern?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly because there's no action (request sent to the server) involved here, the request is "didOpen" but it's done implicitly. But if you think this could be refactored, please do!
language-server/test/dotty/tools/languageserver/util/CodeTester.scala
Outdated
Show resolved
Hide resolved
language-server/test/dotty/tools/languageserver/util/CodeTester.scala
Outdated
Show resolved
Hide resolved
As it is now, the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise LGTM
It's not really useful and can be confusing.
This means that many tests were failing to compile previously, but we never noticed. FIXME: Somehow, this broke the documentation test in HoverTest (the @usecase part of the doc is missing from the output now)
In some situations (like when interpolating type variables) the logic changes depending on whether we have unreported errors or not. Before this commit, we assumed that any error in a StoreReporter was unreported, but this is wrong: the IDE, the REPL and other tools use a StoreReporter as their root reporter. This commit fixes this by making sure all the code that looks for unreported errors does so by calling `hasUnreportedErrors` and making that method return false when there is no outer reporter.
0c86a0b
to
38c6d46
Compare
Also do not reuse the compiler options used in the Dotty build for the tests, since they can influence their result (e.g. -Xfatal-warnings)
@Duhemm Good to merge ? |
No description provided.