matthiasblaesing opened a new pull request, #9249:
URL: https://github.com/apache/netbeans/pull/9249

   General improvements (lsp.client)
   ==================================
   
   To be able to sanely use rust-analyzer (the rust LSP implementation) the 
NetBeans lsp client implementation needs some adjustments:
   
   - lsp4j expects client implementation to provide at least a dummy 
implementation of `refreshDiagnostics`, failing to correctly work if that is 
not the case
   - it was observed that the rust lsp in many cases returns `null` as a result 
of LSP operations. The existing `null` guards were thus extended
   - icons in the lsp.client module were referenced but not actually present 
causing exceptions at runtime when they were to be used.
   - it was observed, that requests to apply document formatting might block if 
the language servers issues a `publishDiagnostics` call as part of the 
formatting.
   - The CSL task was executed independently of the presence of its 
prerequisites, overwriting the results of other tasks if necessary.
   
   Rust specific
   =============
   
   The cargo TOML support is updated to the current version of TOML to be able 
to parse project files using extended syntax.
   
   While NetBeans can provide parts of the IDE services based on custom 
implementations, the rust-analyzer LSP server provides extended support of the 
box. Compared with the built-in solution rust-analyzer has the drawback, that 
it is huge and platform dependent, so it can't be bundled with NetBeans.
   
   To provide both minimal rust support in all cases and improved editing 
support by using rust-analyzer the solution provided here will switch from 
internal support to rust-analyzer only if rust-analyzer is installed and 
configured.
   
   When a user now opens a rust file and rust-analyzer is not configured a 
warning is attached to the file (as is done for cpplite):
   
   <img width="495" height="148" alt="Bildschirmfoto vom 2026-03-06 21-14-19" 
src="https://github.com/user-attachments/assets/08cf2117-871c-430b-964e-9afd82e1d6bc";
 />
   
   But structure is still present:
   
   <img width="845" height="667" alt="Bildschirmfoto vom 2026-03-06 21-15-20" 
src="https://github.com/user-attachments/assets/e06df732-e0a5-409b-ad7a-862b0347be9d";
 />
   
   The icons used in the rust module were aligned with the other NetBeans icons 
from lsp.client and PHP support.
   
   The warning allows to directly jump into options to configure rust-analyzer:
   
   <img width="356" height="128" alt="Bildschirmfoto vom 2026-03-06 21-14-52" 
src="https://github.com/user-attachments/assets/823b230e-fad1-46f5-a84b-0266ea747f60";
 />
   
   <img width="845" height="667" alt="Bildschirmfoto vom 2026-03-06 21-15-20" 
src="https://github.com/user-attachments/assets/afb6627d-871e-4fc5-a333-0cebcc997ae8";
 />
   
   <img width="542" height="125" alt="Bildschirmfoto vom 2026-03-06 21-15-30" 
src="https://github.com/user-attachments/assets/0f913754-d84b-4d5e-b1b9-1b796de9ab4a";
 />
   
   With that done extended structure support is activated:
   
   <img width="468" height="487" alt="Bildschirmfoto vom 2026-03-06 21-17-23" 
src="https://github.com/user-attachments/assets/69685ce2-0d58-4ff6-88d4-41d75af81ff1";
 />
   
   Code completion is provided:
   
   <img width="948" height="652" alt="Bildschirmfoto vom 2026-03-06 21-18-09" 
src="https://github.com/user-attachments/assets/493dfd3d-7cfc-4789-8b18-cd222b21ca39";
 />
   
   and Find usages works:
   
   <img width="1577" height="393" alt="Bildschirmfoto vom 2026-03-06 21-20-43" 
src="https://github.com/user-attachments/assets/8988b780-51a0-4b57-843d-bdd013e27412";
 />
   
   <img width="649" height="282" alt="Bildschirmfoto vom 2026-03-06 21-20-34" 
src="https://github.com/user-attachments/assets/bb6c72a4-f73d-4f75-a8b2-16220b550003";
 />
   
   
   
   


-- 
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