How to use the @theia/filesystem/lib/browser.FileStatNode.getUri function in @theia/filesystem

To help you get started, we’ve selected a few @theia/filesystem 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 / markers / src / browser / problem / problem-decorator.ts View on Github external
protected collectDecorators(tree: Tree): Map {

        const result = new Map();

        // If the tree root is undefined or the preference for the decorations is disabled, return an empty result map.
        if (tree.root === undefined || !this.problemPreferences['problems.decorations.enabled']) {
            return result;
        }
        const markers = this.appendContainerMarkers(tree, this.collectMarkers(tree));
        for (const node of new DepthFirstTreeIterator(tree.root)) {
            const nodeUri = FileStatNode.getUri(node);
            if (nodeUri) {
                const marker = markers.get(nodeUri);
                if (marker) {
                    result.set(node.id, marker);
                }
            }
        }
        return new Map(Array.from(result.entries()).map(m => [m[0], this.toDecorator(m[1])] as [string, TreeDecoration.Data]));
    }
github eclipse-theia / theia / packages / scm / src / browser / decorations / scm-navigator-decorator.ts View on Github external
protected collectDecorators(tree: Tree): Map {
        const result = new Map();
        if (tree.root === undefined || !this.decorationsMap) {
            return result;
        }
        const markers = this.appendContainerChanges(this.decorationsMap);
        for (const treeNode of new DepthFirstTreeIterator(tree.root)) {
            const uri = FileStatNode.getUri(treeNode);
            if (uri) {
                const marker = markers.get(uri);
                if (marker) {
                    result.set(treeNode.id, marker);
                }
            }
        }
        return new Map(Array.from(result.entries()).map(m => [m[0], this.toDecorator(m[1])] as [string, TreeDecoration.Data]));
    }
github eclipse-theia / theia / packages / git / src / browser / git-decorator.ts View on Github external
protected collectDecorators(tree: Tree, status: WorkingDirectoryStatus | undefined): Map {
        const result = new Map();
        if (tree.root === undefined || !this.enabled) {
            return result;
        }
        const markers = this.appendContainerChanges(tree, status ? status.changes : []);
        for (const treeNode of new DepthFirstTreeIterator(tree.root)) {
            const uri = FileStatNode.getUri(treeNode);
            if (uri) {
                const marker = markers.get(uri);
                if (marker) {
                    result.set(treeNode.id, marker);
                }
            }
        }
        return new Map(Array.from(result.entries()).map(m => [m[0], this.toDecorator(m[1])] as [string, TreeDecoration.Data]));
    }