You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "albilu (via GitHub)" <gi...@apache.org> on 2023/04/16 09:04:09 UTC

[GitHub] [netbeans] albilu commented on issue #5822: LanguageServerProvider should be able to pass initialization options to Language Server

albilu commented on issue #5822:
URL: https://github.com/apache/netbeans/issues/5822#issuecomment-1510206058

   You can pass LSP configuration to the server from Netbeans like this: 
   ```java
   Gson create = new GsonBuilder()
                       .setObjectToNumberStrategy(ToNumberPolicy.BIG_DECIMAL).create();
   Map<String, Object> settings = create
                       .fromJson("{YOUR_JSON_SETTINGS_OBJECT}",
                               new TypeToken<HashMap<String, Object>>() {
                               }.getType());
   Map<String, Object> paramsObject = new HashMap<>();
   DidChangeConfigurationParams params = new DidChangeConfigurationParams(paramsObject);
   LSPBindings.getBindingsImpl(fileObject).getWorkspaceService()
                           .didChangeConfiguration(params);
   ```
   
   You can call the didChangeConfiguration method at any time assuming your LSP server support it


-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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