GROOVY-12411: Add a first-party Language Server Protocol implementation (groovy-lsp) - #2936
daniellansun wants to merge 1 commit into
Conversation
JMH summary — classic (commit
|
| Group | Speedup | Calibrated | n |
|---|---|---|---|
| bench | 0.964 × | 1.005 × | 124 |
| core | 1.029 × | 0.992 × | 108 |
| grails | 1.018 × | 1.054 × | 80 |
No benchmark is ≥1.5× slower than its 90-day baseline.
Runner calibration (this run vs baseline hardware): bench 0.96× (27 rulers) · core-ag 0.99× (3 rulers) · core-hz 1.12× (3 rulers) · grails-ad 0.95× (3 rulers) · grails-ez 0.98× (3 rulers)
Baseline: dev/bench/jmh/<part>/classic/data.js on gh-pages, trailing 90 days. Daily dashboard · Per-suite raw data
JMH summary — indy (commit
|
| Group | Speedup | Calibrated | n |
|---|---|---|---|
| bench | 1.527 × | 1.039 × | 124 |
| core | 3.614 × | 3.623 × | 108 |
| grails | 2.405 × | 2.545 × | 80 |
⚠️ 4 benchmarks at least 1.5× slower than the 90-day baseline:
org.apache.groovy.bench.AryBench.groovyCS ( {"n":"1000000"} )— 2.93× slower (calibrated)org.apache.groovy.bench.StaticMethodCallIndyBench.staticChain_groovyCS— 1.73× slower (calibrated)org.apache.groovy.perf.MethodInvocationBench.benchmarkPolymorphicCallSite— 1.56× slower (calibrated)org.apache.groovy.bench.dispatch.CallsiteBench.dispatch_3_polymorphic_groovy— 1.54× slower (calibrated)
⚠️ Runner speed differs ≥15% from the historical baseline hardware for: bench. Raw speedups are not meaningful for those parts — use the calibrated column.
Runner calibration (this run vs baseline hardware): bench 1.47× (27 rulers) · core-ag 0.95× (3 rulers) · core-hz 1.08× (3 rulers) · grails-ad 0.96× (3 rulers) · grails-ez 0.93× (3 rulers)
Baseline: dev/bench/jmh/<part>/indy/data.js on gh-pages, trailing 90 days. Daily dashboard · Per-suite raw data
|
I am wondering about a few things in this:
Yeah, I know, a wild mix of specific and very broad questions. I am not against the idea at all; I just want to understand more clearly why this PR came into existence in the first place and what you see its role being. |
Thanks for taking the time to unpack this — the mix of questions is fair, and I should have been clearer about scope from the start. 1-based columns. That is GROOVY-12085 in the compiler AST (1-based Unicode code points). It is not an LSP coordinate change. The protocol stays 0-based in the encoding negotiated at What this is for, and what it is not. It is a Groovy language core for LSP, not a workspace/IDE. It is meant to stay current with the in-tree compiler so editors (and later AI tools) get diagnostics, completion, hover, navigation, and conservative rename on Rename vs hover when The other servers. Prominic How to use it. Yes, it is intended for direct use in an IDE or editor: start Vision. Both: a standalone first-party Groovy language server that an editor can run today, and a small compile + protocol loop that other Apache-2.0 Groovy LSPs (and groovy-mcp) can extend instead of forking. It is not a replacement for the JDT/groovy-eclipse stack, and it will not grow into a full IDE. Happy to go further on any of these if that still feels thin. |
3fb2138 to
56fc0c7
Compare
b0b1e58 to
292fc1b
Compare
✅ All tests passed ✅🏷️ Commit: 292fc1b Learn more about TestLens at testlens.app/docs. |
|
|
Sorry for taking a while, but this topic here broad and it took me a while to do some research. And you made further changes anyway.
I think it is a healthy approach to not to try to solve these. But again I am wondering about "its role being". You say no If I am wrong here, then I would like to hear more. Your vision was not giving much information in that respect - only a groovy-mcp, for which I currently fail to see the need of an extension mechanism. Well to make things shorter:
Again, do not get me wrong. I am not pushing back on the PR idea in general. I am trying to work the picture out. The picture of what this PR wants to be and what it does not want to be. Only after I have a sharp image I can actually see if the PR goes in that direction or not. If for example the idea is "just" a groovy-mcp, then I would drop the extension mechanism. Which is a suggestion I would only be able to do once I have a more complete and sharper picture. |
|
AI read:
|
|
@blackdrag Thank you for taking the time — and for pushing on “what this is,” not only on the diffs. The sentence you quoted is outdated. Joint compilation is in groovy-lsp now; what we still refuse is IDE- or build-tool-driven joint work (Gradle/Maven Tooling API, JDT, cross-language rename). That mix of claims was confusing. Here is a sharper picture of what this PR is trying to be. What it is. A compiler-backed Language Server for Groovy: same in-tree What it is not. Not a replacement for Groovy-Eclipse / IntelliJ / edt. Not GDSL, not Gradle/Maven invocation, not DAP, not a test runner, not identifier-scan rename. Not a full Java language server (no Java completion/format/Java-only rename). IDE use. I agree with your limits. This will not match a serious plugin on large projects, custom compiler configuration, or cross-language rename. The client must push classpath/source paths; if those differ from the IDE, the LS will differ too. A lean editor can use it; a full Groovy+Java IDE still wants edt/JDT. We should not advertise it as more than that. Reuse by other LSPs. Prominic could in principle be replaced for a small Groovy-only editor. groovyls (GDSL, forced STC, Aether) and edt (JDT) are not going to sit on this tomorrow. That reuse story was a hypothesis, not something we have evidence for. I should not have leaned on it as a reason for the design. The extension mechanism. You are largely right. The built-in That pass does not need to be a If the picture we want is “compiler-backed Groovy LS, optional joint types, conservative edits,” I am happy to fold STC into core and drop or shrink the incubating SPI rather than keep a seam nobody is using yet. I would rather have that be an explicit choice than leave the mechanism looking like a vision we cannot back. Happy to adjust the PR description and the code in that direction if this reading matches what you wanted to pin down. |
|
@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 |



https://issues.apache.org/jira/browse/GROOVY-12411