[POM-leading for DSLs] Dynamic capabilities#1117
Open
toinehartman wants to merge 43 commits into
Open
Conversation
222849f to
43787d2
Compare
DavyLandman
added a commit
that referenced
this pull request
Jun 22, 2026
1. Set document selectors for capabilities, such that capabilities can only be triggered on documents that support them. Especially useful when registering multiple languages. 2. Dynamically register semantic highlighting capability (to test the former change, and make a start with registering all capabilities dynamically). 3. Instead of toggling the language for open editors, request a refresh of the open editors via LSP. This prevents races where requests can come in while the file is 'closed'. This PR is a preparation to easily enable #1117.
2fdc776 to
45b8638
Compare
f001c98 to
52aeaaa
Compare
52aeaaa to
76aeb65
Compare
76aeb65 to
62ffc76
Compare
This reverts commit 2f5646c.
…010-pom-leading-for-dsls/1079-dynamic-capabilities
DavyLandman
approved these changes
Jul 2, 2026
DavyLandman
left a comment
Member
There was a problem hiding this comment.
Looks nice! Just some small points.
| public class CompletableFutureUtils { | ||
| private CompletableFutureUtils() {/* hidden */ } | ||
|
|
||
| public static final CompletableFuture<Void> NOOP = CompletableFuture.completedFuture(null); |
Member
There was a problem hiding this comment.
while this is nice, it has no exec bound to it? isn't that a problem?
|
|
||
| private CompletableFuture<Void> registerCapability(Registration r) { | ||
| var c = currentRegistrations.computeIfAbsent(r.getMethod(), k -> new CopyOnWriteArraySet<>()); | ||
| // Lock on the registrations for this method for a moment |
Member
There was a problem hiding this comment.
can we explain why we lock? who else might be doing this registration?
and why we lock for so long?
My concern is that the exceptionally handler that manipulates c is executed outside the lock (and not relocking).
| return client.unregisterCapability(new UnregistrationParams(List.of(u))) | ||
| .exceptionally(t -> { | ||
| logger.error("Exception while unregistering {} ({})", u.getMethod(), u, t); | ||
| c.addAll(cs); |
Member
There was a problem hiding this comment.
same here, no lock here, is that fine? and if so, let's explain why.
…010-pom-leading-for-dsls/1079-dynamic-capabilities
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Implement dynamic capabilities for POM-leading servers.
Closes #1079.