Maven error/warnings refactored to use Parsing API. #3793
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Originally I was trying to bridge project problems to LSP. During the course I have realized that Maven's errors, underlined in the editor, are provided by
UpToDateStatusProvider
implementation - this one is in charge or reporting start/stop computations in annotation's gutter.The Provider however monitored on-disk file changes, so potential errors were only reported after file save, not (as usual) when a change to the opened document has been made by the user. This approach bypasses alll the machinery of Parsing API which is more suitable for tracking document changes and/or caret/selection in the live document. In addition, this approach wouldn't work in the LSP client scenario at all.
The StatusProvider implementation was broken anyway as for example StatusProvider kept the status
UP_TO_DATE_PROCESSING
if there was a non-empty selection ... TheUpToDateStatusProvider
+ hints is generally broken, see NETBEANS-6477. I will not fix that in this PR.The PR adapts Maven implementation to use Parsing API - this allows to react immediately, and since I provided a custom
ModelSource
(seeM2S
class) to maven processing, even the live editor content can be analyzed by the Maven library.Tests for this module were broken - test data file was missing; I've created some + added necessary env setup so the test passes now.
I've also discovered that Tasklist Maven integration is broken for some time - see NETBEANS-6476, will not fix in this PR either.