Skip to content

Commit

Permalink
Fix LSP UUID quick fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrilvrousos-tas committed Aug 1, 2023
1 parent 988ec71 commit e43c34a
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)
Expand Down

0 comments on commit e43c34a

Please sign in to comment.