Repository navigation
Implement catalog binding support with async entry selection (requires LemMinx 0.40.0) - #2306
angelozerr wants to merge 1 commit into
Conversation
| : false); | ||
| }) | ||
| .excludeInactive() | ||
| .collectAll((w, ls) -> CompletableFuture.completedFuture(ls)) |
|
Note that we are finalizing the release of SimRel 2026-12 next Wednesday and will need to produce a release of WWD to contribute toward that. So the runway for getting changes in is very short and any changes now will effectively be untested by consumers. I can't judge the riskiness of the changes. |
|
@merks I am aware about that and there is a major problem with pom.xml where formatting is not enabled. I did the fix in LemMinx 0.40.0 but before doing the release (hope today), I wanted to check that LemMinx 0.40.0 will not break WWD because there are so many changes. So my idea is to implement all features in WWD that we have in vscode-xml to check that nothing is broken and new features works in WWD. This PR has no risk since it is a new feature. I need to clean it few but I think it should be soon ready, but without 0.40.0 you cannot play with it. I am integrating all features provided by 0.40.0 like: |
|
That all sounds good! I was aware of the formatting problem. |
|
I just merged the change to update the target platform to LemMinX 0.40.0. |
Thanks! I have several pending PRs and I will create again another PRs. Could you tell me what you think it will be super nice to have, just to know the priority. I will try to do my best to implement the most LemMinx 0.40.0 features, but I will need your review :) |
I expect your judgement is likely better informed than mine. 🤓 Do what you believe will be of value to the most people! |
|
@akurtakov please review this PR |
There was a problem hiding this comment.
🟡 Changes recommended
The pinned LemMinX version cannot support Catalog mode, unescaped contributed URLs can invalidate the catalog, and asynchronous callbacks can fail after dialogs close.
4 open issues
What changed in this PR
Adds catalog-based grammar binding to the XML association workflow, alongside local files and remote URLs. The feature requires LemMinX 0.40.0.
Changes:
- Adds an asynchronous catalog picker with filtering, progress feedback, and disambiguated labels.
- Reorganizes grammar-association classes and removes blocking server discovery.
- Generates system catalog entries from WTP public entries with
webURLattributes.
| File | Description |
|---|---|
org.eclipse.wildwebdeveloper.xml/src/org/eclipse/wildwebdeveloper/xml/internal/ui/preferences/XMLPreferenceInitializer.java |
Updates the dialog import after relocation. |
org.eclipse.wildwebdeveloper.xml/src/org/eclipse/wildwebdeveloper/xml/internal/ui/preferences/XMLCatalogs.java |
Generates system entries for contributed web URLs. |
org.eclipse.wildwebdeveloper.xml/src/org/eclipse/wildwebdeveloper/xml/internal/ui/messages.properties |
Adds catalog selection and validation messages. |
org.eclipse.wildwebdeveloper.xml/src/org/eclipse/wildwebdeveloper/xml/internal/ui/Messages.java |
Exposes the new localized messages. |
org.eclipse.wildwebdeveloper.xml/src/org/eclipse/wildwebdeveloper/xml/internal/commands/AssociateGrammarHandler.java |
Removes the handler from its former package. |
org.eclipse.wildwebdeveloper.xml/src/org/eclipse/wildwebdeveloper/xml/internal/commands/associate/GrammarFileSelectionDialog.java |
Extracts the workspace grammar picker. |
org.eclipse.wildwebdeveloper.xml/src/org/eclipse/wildwebdeveloper/xml/internal/commands/associate/CatalogEntrySelectionDialog.java |
Adds asynchronous catalog loading and selection. |
org.eclipse.wildwebdeveloper.xml/src/org/eclipse/wildwebdeveloper/xml/internal/commands/associate/CatalogEntryLabelProvider.java |
Styles entries and disambiguates catalog filenames. |
org.eclipse.wildwebdeveloper.xml/src/org/eclipse/wildwebdeveloper/xml/internal/commands/associate/BindableCatalogEntry.java |
Defines the catalog entry data model. |
org.eclipse.wildwebdeveloper.xml/src/org/eclipse/wildwebdeveloper/xml/internal/commands/associate/AssociateGrammarHandler.java |
Fetches entries and submits catalog binding commands asynchronously. |
org.eclipse.wildwebdeveloper.xml/src/org/eclipse/wildwebdeveloper/xml/internal/commands/associate/AssociateGrammarDialog.java |
Adds Catalog mode, browsing, and selection validation. |
org.eclipse.wildwebdeveloper.xml/plugin.xml |
Registers the relocated command handler. |
Review effort: Balanced
| // If public entry has webURL, also create a system entry for it | ||
| String webURL = element.getAttribute("webURL"); | ||
| if (webURL != null && !webURL.isEmpty()) { | ||
| catalogFile.append("<system systemId=\"").append(webURL).append("\" uri=\"").append(uri) |
| if (selectedCatalogEntry != null) { | ||
| catalogEntriesFuture.thenAccept(entries -> { | ||
| getShell().getDisplay().asyncExec(() -> { | ||
| if (!getShell().isDisposed()) { |
| entriesFuture.whenComplete((loadedEntries, ex) -> { | ||
| getShell().getDisplay().asyncExec(() -> handleCompletion(loadedEntries, ex)); | ||
| }); |
b8fb865 to
129b8c8
Compare
- Add CatalogEntrySelectionDialog: quick-open style dialog for selecting bindable catalog entries, populated asynchronously via CompletableFuture - Add CatalogEntryLabelProvider: styled display of entries with entry type, identifier, and gray-colored catalog filename (disambiguated by path segments when needed) - Implement AssociateGrammarDialog with Catalog mode: radio button to switch between Local/Remote and Catalog modes, Browse button that fetches entries asynchronously with progress indicator - Modify AssociateGrammarHandler: fetch catalog entries only when user opens dialog, no blocking server calls in handler, fresh fetch each dialog open to reflect catalog changes - Add webURL support in XMLCatalogs: for WTP catalog contributions with webURL attributes on public entries, generate additional system entries pointing to web URLs Signed-off-by: azerr <azerr@redhat.com>
129b8c8 to
1c4dc68
Compare
There was a problem hiding this comment.
🟡 Changes recommended
A direct argument cast can crash grammar-association commands, while unescaped URLs can make the generated XML catalog malformed and prevent unrelated mappings from loading.
4 open issues
1 resolved since last review
Review effort: Balanced
|
|
||
| @Override | ||
| public Object execute(ExecutionEvent event, Command command, IPath path) throws ExecutionException { | ||
| String uri = (String) command.getArguments().get(0); |


Here a demo:
catalog entries, populated asynchronously via CompletableFuture
and gray-colored catalog filename (disambiguated by path segments when needed)
Local/Remote and Catalog modes, Browse button that fetches entries asynchronously
with progress indicator
no blocking server calls in handler, fresh fetch each dialog open to reflect
catalog changes
attributes on public entries, generate additional system entries pointing to web URLs