Skip to content

Filter out hidden projects (like LightEdit mode files) #17

Closed
@artemy

Description

@artemy
          I see that LightEdit entries have a `hidden` attribute set to `true`, so I suppose IDE (and Toolbox) exclude them:
        <entry key="$APPLICATION_CONFIG_DIR$/light-edit">
          <value>
            <RecentProjectMetaInfo hidden="true">
              <option name="activationTimestamp" value="1732450057513" />
            </RecentProjectMetaInfo>
          </value>
        </entry>

To filter them out we can do something like this:

Index: recent_projects.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/recent_projects.py b/recent_projects.py
--- a/recent_projects.py	(revision 3323541b98730c7571a72c93e5e8c914e47fd2d1)
+++ b/recent_projects.py	(date 1732451510807)
@@ -107,7 +107,8 @@
 def read_projects_from_file(most_recent_projects_file):
     tree = ElementTree.parse(most_recent_projects_file)
     projects = [t.attrib['key'].replace('$USER_HOME$', "~") for t
-                in tree.findall(".//component[@name='RecentProjectsManager']/option[@name='additionalInfo']/map/entry")]
+                in tree.findall(".//component[@name='RecentProjectsManager']/option[@name='additionalInfo']/map/entry")
+                if t.find("value/RecentProjectMetaInfo[@hidden='true']") is None]
     return reversed(projects)
 
 
@@ -140,5 +141,6 @@
         print(f"The projects file for {sys.argv[1]} does not exist.")
         exit(1)
 
+
 if __name__ == "__main__":  # pragma: nocover
     main()

EDIT:
Indeed, LightEdit projects are always set to hidden https://github.com/JetBrains/intellij-community/blob/a2ea418b84f865b9c272a45ec7b8330096bc7ace/platform/platform-impl/src/com/intellij/ide/lightEdit/project/LightEditProjectManager.kt#L71

I tried setting the flag to false and I saw both IDE and Toolbox show them.

Originally posted by @artemy in #16 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions