LogtalkDotOrg / logtalk-for-vscode

Logtalk for VSCode extension
MIT License
5 stars 0 forks source link

Editor errors/warnings do not clear themselves #7

Closed unthingable closed 2 months ago

unthingable commented 3 months ago

v0.21.0, Logtalk 3.80.0-b01

Could be user error, but not finding a way to get errors/warnings to clear after fixing them, aside from reopening the editor or reloading window. Example below.

After vscode::make(_, 'all') (e.g. Logtalk: Make - Reload): image

After fixing the error and repeating Make - Reload(or any other Logtalk action available in menu, including killing the Logtalk process and repeating Logtalk: Load directory): image despite vscode::make reporting complete success:

...
% [ .../loader.lgt loaded ]
% (0 warnings)
% Reloaded all Logtalk source files modified or that required
% recompilation due to a change to the compilation mode
true.
unthingable commented 3 months ago

Another interesting effect: after reopening editor, introducing a new error/warning and triggering reload, the old error annotations on already fixed errors will reappear like it's reading them from some persistent buffer.

pmoura commented 3 months ago

Try the latest Logtalk and Logtalk for VSCode git versions. For convenience, I attach here the VSIX file.

logtalk-for-vscode-0.22.0.vsix.zip

pmoura commented 3 months ago

Another interesting effect: after reopening editor, introducing a new error/warning and triggering reload, the old error annotations on already fixed errors will reappear like it's reading them from some persistent buffer.

Made some progress in that editing a file (to fix a warning/error) and saving it, clears the issue from the "Problems" pane. But then when doing e.g. a make old fixed problems are re-added to the "Problems" pane although they are no longer part of the diagnostics collection. It's like VSCode is doing a merge of some cached diagnostics with the updated diagnostics instead of replacing them.

pmoura commented 3 months ago

Bug found and fixed. Try with the latest Logtalk git version:

logtalk-for-vscode-0.22.0.vsix.zip

unthingable commented 3 months ago

That's excellent news, thank you! Sorry, been heads down porting a project, haven't had time to check it out yet.

pmoura commented 3 months ago

Still a bug somewhere that I'm chasing. Thus, not yet 0.22.0 final.

pmoura commented 3 months ago

Latest (requires latest Logtalk git version):

logtalk-for-vscode-0.22.0.vsix.zip

Let me know if notice any remaining issue in the extension handling of diagnostics as you edit/fix them and reload the code.

unthingable commented 3 months ago

Confirmed: errors now clear! 🎉

Remaining awkwardness: Logtalk Linter output window (in the OUTPUT tab) doesn't clear, makes it difficult to tell which warnings are still current.

And of course, if vscode::* tasks could be made to run in the background and not steal focus to the Terminal (unless they specifically need to show output, like running tests, but even then the focus stealing is annoying), that would be heaven.

pmoura commented 3 months ago

Confirmed: errors now clear! 🎉

My experience as well. Thanks for confirming. Note that, when fixing a error or warning and saving the changed file, all diagnostics for that file will be cleared (as the VSCode save event doesn't provide details on the changes). Reloading the changed file restores diagnostics for unfixed errors and warnings.

Remaining awkwardness: Logtalk Linter output window (in the OUTPUT tab) doesn't clear, makes it difficult to tell which warnings are still current.

Already fixed at c1fffc2e17c5c45fe51562ab05ed0b3391fb589a. The linters no longer create and write to channels in the "OUTPUT" pane. The original code resulted in a large number of duplicates there and the "PROBLEMS" pane now reliably show all relevant information.

And of course, if vscode::* tasks could be made to run in the background and not steal focus to the Terminal (unless they specifically need to show output, like running tests, but even then the focus stealing is annoying), that would be heaven.

Planned in a way. The user can always choose to hide the terminal. The issue is mainly stealing focus and thus un-hiding the terminal in cases where that may not be useful.

logtalk-for-vscode-0.22.0.vsix.zip

pmoura commented 3 months ago

Better usability by only showing the terminal if hidden when advisable by the command:

logtalk-for-vscode-0.22.0.vsix.zip

pmoura commented 2 months ago

Closing as the original issue is now fixed.