paulk-asert commented on PR #2976:
URL: https://github.com/apache/groovy/pull/2976#issuecomment-6405025294

   Reviewed d1eb6ff07b. The installLanguageHost guard is in and I verified it 
with a real run: console launched from a classpath without 
groovy-lsp/lsp4j/Gson, with a script argument. Console.main returns normally, 
the script loads, the host stays unset, the regex highlighter is active, the 
Compiler Assistance item is disabled, and the saved preference is untouched. A 
second window behaves the same. groovysh on the same classpath: one warning, rc 
0.
   
   One cosmetic leftover on the console path: the terminal also shows a 
CachedClass "declared methods of ConsoleLanguageHost cannot be read" WARNING 
with a full NoClassDefFoundError stack trace. ConsoleLanguageHost.openInspect 
has a raw GroovyLanguageClient return type, so getDeclaredMethods fails while 
the host's metaclass is built in the constructor, before the guarded 
GroovyLanguageClient.open on line 113. groovysh avoids it because 
GroovyshLanguageSession only uses the engine types inside generics. Opening the 
client in attach() and handing it to the constructor (or otherwise touching 
GroovyLanguageClient before `new ConsoleLanguageHost`) makes the stack trace 
disappear; I tested that locally. Happy for that to land as a follow-up.
   
   On your two alternatives: I'd keep the current behaviour. Unchecked reflects 
the window's real state, and the shared preference should survive so a later 
launch with the jar present retries.
   
   Tiny doc nit: the highlighter fallback logs twice per window (constructor + 
BasicContentPane), not once.
   
   Good to merge into master for 7.0.


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