microsoft / vscode-maven

VSCode extension "Maven for Java"
https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-maven
Other
181 stars 88 forks source link

Errors and warnings not updated after remedying source file issue #939

Closed chris-miner closed 1 year ago

chris-miner commented 1 year ago

Describe the bug I created an error in a file. The mojo responsible for generating sources from this file reported errors and warnings. These errors and warnings were displayed in the "problems" tab. I fixed the issue, but the display was not updated. I created a new error in the file and this was added to the list of problems. Old fixed issues continued to be displayed.

To Reproduce Steps to reproduce the behavior:

  1. create an error in a source file
  2. wait for the file to be processed via maven plugin
  3. note the errors and warnings
  4. fix the problem
  5. notice that the errors and warnings are not updated to reflect the new status.

Expected behavior I expected to see no errors listed for the repaired file

Environments (please complete the following information as much as possible):

Screenshots If applicable, add screenshots to help explain your problem.

Additional context the mojo that reports errors is the antlr4-maven-plugin version 4.9.3 From the command line the errors are not reported after remedying the file. I'm really not sure what the chain of events is that goes from running the mojo in maven and getting the output to show up in VS Code, so I don't know if this is a vs code problem, a maven plugin problem, or a problem with the underlying mojo.

Eskibear commented 1 year ago

Not sure whether the error is reported by this Maven extension. A screenshot of the "problems" tab containing the detailed error message would help me to check.

chris-miner commented 1 year ago

Here's a screen shot of the problems generated by my incorrect source file:

Screen Shot 2023-02-19 at 08 20 50

After I correct the problem and save the file, the problems view is unchanged. Here's the table view of those results:

Screen Shot 2023-02-19 at 08 24 26

Notice that the warnings about 'implicit definition of token' are reported for the pom.xml file rather than the Hello.g4 file. The pom.xml file has nothing to do with tokens. Also notice that the pom.xml warnings match the line number of the Hello.g4 errors.

chris-miner commented 1 year ago

I found an issue on the vscode project which seems related: vscode.languages.getDiagnostics appears to return old diagnostics in some circumstances #54359

Eskibear commented 1 year ago

From the "Source" column, you can see none of the errors/warnings are reported by this extension. AFAIK those under pom.xml are reported by Java extension, that you might open an issue in https://github.com/redhat-developer/vscode-java And those under hello.g4 seem to be reported by some antlr extension?

BTW, the issue you found above is long time ago, that I don't think it's related.

chris-miner commented 1 year ago

Thanks! I assumed errors+warnings from the maven mojo would bubble up through the maven extension to the vs code ui somehow. I do know where the antlr ones come from — I disabled plugins until the errors went away.

I'll look for the source of the issue elsewhere.