From e43c34a1371f084b708640f29093f9a1150c0681 Mon Sep 17 00:00:00 2001 From: cyrilvrousos-tas Date: Tue, 1 Aug 2023 09:14:40 +0000 Subject: [PATCH] Fix LSP UUID quick fix bug --- .../xsmp/ide/quickfix/XsmpcatIdeQuickfixProvider.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/org.eclipse.xsmp.ide/src/org/eclipse/xsmp/ide/quickfix/XsmpcatIdeQuickfixProvider.java b/org.eclipse.xsmp.ide/src/org/eclipse/xsmp/ide/quickfix/XsmpcatIdeQuickfixProvider.java index eb3b8795..26646494 100644 --- a/org.eclipse.xsmp.ide/src/org/eclipse/xsmp/ide/quickfix/XsmpcatIdeQuickfixProvider.java +++ b/org.eclipse.xsmp.ide/src/org/eclipse/xsmp/ide/quickfix/XsmpcatIdeQuickfixProvider.java @@ -14,6 +14,7 @@ import org.eclipse.emf.ecore.EObject; import org.eclipse.xsmp.validation.XsmpcatIssueCodesProvider; +import org.eclipse.xsmp.xcatalogue.Metadatum; import org.eclipse.xsmp.xcatalogue.Type; import org.eclipse.xsmp.xcatalogue.VisibilityElement; import org.eclipse.xsmp.xcatalogue.VisibilityKind; @@ -31,12 +32,16 @@ public void generateUUID(DiagnosticResolutionAcceptor acceptor) { acceptor.accept("Generate UUID", e -> { + if (e instanceof Metadatum) + { + e = e.eContainer(); + } + if (e instanceof Type) { ((Type) e).setUuid(UUID.randomUUID().toString()); } }); - } @QuickFix(XsmpcatIssueCodesProvider.HIDDEN_ELEMENT)