Handling Duplicate Markers in GLSP and Langium Integration #1487
-
Hi Team, I am currently working with Langium and Theia, where I am implementing validation on the Langium model to be displayed on the GLSP node. In Theia's ProblemManager, both GLSP and Langium are registering markers, causing each error to appear twice in both the navigator and the problem view. One possible solution is to restrict markers based on the owner, but this doesn't seem to be the most optimal approach. How can we prevent GLSP from registering diagnostics in Theia? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @kapishsingla, Overriding the method and skipping the marker manager connection should do the trick: protected override initializeContainer(container: Container): void {
connectTheiaContextMenuService(container, this.contextMenuServiceFactory);
} |
Beta Was this translation helpful? Give feedback.
Hi @kapishsingla,
if you want to disable the GLSP marker registration you have to override the
initializeContainer
method in your diagram configuration. By default the implementation connects to the marker manager there (https://github.com/eclipse-glsp/glsp-theia-integration/blob/f1c67da319255e367ae92c22f65222149357b340/packages/theia-integration/src/browser/diagram/glsp-diagram-configuration.ts#L97)Overriding the method and skipping the marker manager connection should do the trick: