Skip to content

Implement catalog binding support with async entry selection (requires LemMinx 0.40.0) - #2306

Open
angelozerr wants to merge 1 commit into
eclipse-wildwebdeveloper:masterfrom
angelozerr:associate_catalog_entry
Open

angelozerr wants to merge 1 commit into
eclipse-wildwebdeveloper:masterfrom
angelozerr:associate_catalog_entry

Conversation

@angelozerr

@angelozerr angelozerr commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Here a demo:

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

: false);
})
.excludeInactive()
.collectAll((w, ls) -> CompletableFuture.completedFuture(ls))
@merks

merks commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

@angelozerr

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.

@angelozerr

Copy link
Copy Markdown
Contributor Author

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

@merks

merks commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

That all sounds good! I was aware of the formatting problem.

@merks

merks commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

@angelozerr

I just merged the change to update the target platform to LemMinX 0.40.0.

#2308

@angelozerr

angelozerr commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor Author

@angelozerr

I just merged the change to update the target platform to LemMinX 0.40.0.

#2308

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

@merks

merks commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Could you tell me what you think it will be super nice to have, just to know the priority

I expect your judgement is likely better informed than mine. 🤓 Do what you believe will be of value to the most people!

@angelozerr
angelozerr marked this pull request as ready for review November 28, 2026 08:19
@angelozerr

Copy link
Copy Markdown
Contributor Author

@akurtakov please review this PR

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 webURL attributes.
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()) {
Comment on lines +105 to +107
entriesFuture.whenComplete((loadedEntries, ex) -> {
getShell().getDisplay().asyncExec(() -> handleCompletion(loadedEntries, ex));
});
@angelozerr
angelozerr force-pushed the associate_catalog_entry branch from b8fb865 to 129b8c8 Compare November 30, 2026 10:14
- 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>
@angelozerr
angelozerr force-pushed the associate_catalog_entry branch from 129b8c8 to 1c4dc68 Compare November 30, 2026 14:39
@merks
merks requested a balanced review from Copilot December 1, 2026 10:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants