daniellansun commented on PR #2936:
URL: https://github.com/apache/groovy/pull/2936#issuecomment-5846117566

   > @daniellansun if you want to make this a configuration extension then I 
would limit the extension to it. I do not see GDSL being possible with this 
extension mechanism, forced-STC is imho configuration. The problem though 
persists. How are multiple configuration extensions handled? Assume for example 
one wants to force STC strict and another wants to force STC non-strict. Which 
one will be taken now? LSP4J supports `workspace/configuration` and 
`workspace/didChangeConfiguration` to handle configuration. If you truly want 
to support custom configuration then defining a format for that and supporting 
it would be what actually should be done. Also, if you still want to define 
extensions, then instead of an serviceloader mechanism, you can make those part 
of the configuration and thus have a configuration order that controls the 
order in which they would be applied. Just as an example... though I would not 
use that extension mechanism for configuration. A GDSL support for example co
 uld then be mentioned there. But I would try to solve as much as possible by 
configuration first. Configuration is normally more easy to extend as well.
   
   Thank you, Jochen. Agreed — configuration first, and not a
   ServiceLoader.
   
   The extension SPI is removed. Settings live in the `groovy` section
   of `workspace/didChangeConfiguration`. After `initialized`, if the
   client advertised `workspace.configuration`, the server also pulls
   that section via LSP4J `workspace/configuration`. The pull is
   asynchronous so the JSON-RPC reader is not blocked waiting for the
   reply.
   
   The format is:
   
   * `classpath` — extra jars and directories
   * `sourcePaths` — extra source roots
   * `grapeEnabled` / `astTestEnabled` — default `false`
   * any other `groovy.*` key — stored as a string; changing it forces
     a recompile. The core does not download or interpret those keys.
   
   There is no extension order. Forced STC would be another key on
   this map, not an extension; it is not in this cut. GDSL is not
   possible through a compile hook, and we are not using one for 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: [email protected]

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

Reply via email to