override fun update()

in rider/src/main/kotlin/com/jetbrains/rider/plugins/unity/explorer/UnityExplorerFileSystemNode.kt [93:141]


    override fun update(presentation: PresentationData) {
        if (!virtualFile.isValid) return

        presentation.addText(name, SimpleTextAttributes.REGULAR_ATTRIBUTES)
        presentation.setIcon(calculateIcon())

        FileSystemExplorerCustomization.getExtensions(myProject).forEach {
            it.updateNode(presentation, file, this)
        }

        // Mark ignored file types. This is mainly so we can highlight that hidden folders are completely ignored. We
        // have lots of non-indexed files in Assets and Packages, but they still appear in Find in Files when we check
        // 'non-solution items'. Ignored file types are completely ignored, and don't show up at all.
        // Make it clear that the folder is ignored/excluded/not indexed
        val ignored = FileTypeManager.getInstance().isFileIgnored(virtualFile)
        if (ignored || descendentOf == AncestorNodeType.IgnoredFolder) {
            // TODO: Consider wording
            // We can usually still search for a file that is not indexed. An ignored file is completely excluded
            presentation.addText(UnityPluginExplorerBundle.message("label.ignored.no.index", SolutionViewPaneBase.TextSeparator),
                                 SimpleTextAttributes.GRAYED_ATTRIBUTES)
        }

        // Add additional info for directories
        val unityExplorer = UnityExplorer.getInstance(myProject)
        if (virtualFile.isDirectory && unityExplorer.showProjectNames) {
            addProjects(presentation)
        }

        // Add tooltip for non-imported files and folders. Also, show the full name if we're hiding the tilde suffix.
        if (isHiddenAsset(virtualFile) || descendentOf == AncestorNodeType.HiddenAsset) {
            var tooltip = if (presentation.tooltip.isNullOrEmpty()) "" else presentation.tooltip + "<br/>"
            if (!SolutionExplorerViewPane.getInstance(myProject).myShowAllFiles && isFolderEndingWithTilde(virtualFile)) {
                tooltip += virtualFile.name + "<br/>"
            }
            presentation.tooltip = tooltip +
                                   if (virtualFile.isDirectory) UnityPluginExplorerBundle.message(
                                       "tooltip.this.folder.not.imported.into.asset.database")
                                   else
                                       UnityPluginExplorerBundle.message("tooltip.this.file.not.imported.into.asset.database")
        }

        if (ignored) {
            val tooltip = if (presentation.tooltip.isNullOrEmpty()) "" else presentation.tooltip + "<br/>"
            presentation.tooltip = tooltip + if (virtualFile.isDirectory)
                UnityPluginExplorerBundle.message("tooltip.this.folder.matches.ignored.file.folders.pattern")
            else
                UnityPluginExplorerBundle.message("tooltip.this.file.matches.ignored.file.folders.pattern")
        }
    }