sdedic opened a new pull request #3881:
URL: https://github.com/apache/netbeans/pull/3881


   This PR is more a preparation for possibly better error reporting and/or 
assistive features. I've noticed that Gradle internally reports (sometimes !) 
file and location of the error. Especially unknown property or syntax errors 
have such annotations. Then the errors are internally yet richer than reported 
in the console. I.e. unresolved artifact errors track which URL(s) gradle tries 
to download the artifact etc.
   
   This PR changes the protocol between Gradle Tooling Plugin and the NetBeans 
Gradle Projects module - exceptions are now sent including the file/line 
annotations and with the complete exception chain. The IDE then formats the 
output appropriately.
   
   String "problems" were replaced by `GradleReport` structures, they are 
copied from the wire Report structures. ProjectProblemProvider was updated 
appropriately, as well as gradle caches (reports are saved/cached).
   
   Then I converted `GradleReport` to editor hints. Since the Gradle does not 
use Parsing API to analyze the text, delivering the hints to the editor was 
somewhat tricky: once the first Gradle project activates, a listener is hooked 
to EditorRegistry and annotations are refreshed (or obtained) as soon as an 
editor became active. This code should not load at all if Gradle projects are 
not used in the IDE session. No fixes are offered for the hints - this is a big 
room for improvement still.
   
   Outline of changes:
   - bugfix: Gradle regsitered PlainEditorKit for its files, which is 
essentially a NbEditorKit; internals were ripped a long time ago (and 
PlainEditorKit extends NbEditorKir). By registering NbEditorKit, one can get 
eventually rid of dependency on plain text editor. The motivation was, in fact, 
that vsnetbeans does not distribute plain editor and hints didn't work without 
that change.
   - feature: use `Report` or `GradleReport` to communicate exceptions from 
Gradle daemon to IDE
   - enhancement: use richer problem chain to report project problems
   - feature: convert `GradleReport` to editor error hints. 
   - feature: convert `GradleReport` to LSP Diagnostics for LSP clients.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to