How to use the monaco-languageclient/lib/monaco-diagnostic-collection.MonacoDiagnosticCollection function in monaco-languageclient

To help you get started, we’ve selected a few monaco-languageclient examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github eclipse-theia / theia / packages / monaco / src / browser / monaco-languages.ts View on Github external
protected updateMarkers(uri: URI): void {
        const uriString = uri.toString();
        const owners = new Map();
        for (const marker of this.problemManager.findMarkers({ uri })) {
            const diagnostics = owners.get(marker.owner) || [];
            diagnostics.push(marker.data);
            owners.set(marker.owner, diagnostics);
        }
        const toClean = new Set(this.makers.keys());
        for (const [owner, diagnostics] of owners) {
            toClean.delete(owner);
            const collection = this.makers.get(owner) || new MonacoDiagnosticCollection(owner, this.p2m);
            collection.set(uriString, diagnostics);
            this.makers.set(owner, collection);
        }
        for (const owner of toClean) {
            const collection = this.makers.get(owner);
            if (collection) {
                collection.set(uriString, []);
            }
        }
    }