alex1701c / JetBrainsRunner

A Krunner Plugin which allows you to open your recent projects
GNU Lesser General Public License v3.0
55 stars 5 forks source link

IDEA in Flatpak does not open Project #27

Closed DanielNoga closed 2 years ago

DanielNoga commented 2 years ago

I tried to install IDEA from https://flathub.org/apps/details/com.jetbrains.IntelliJ-IDEA-Ultimate via Flatpak with just released version 2022.2 . I compiled this plugin on Leap 15.4 with Plasma 5.24, Qt 5.15 and KF 5.90.

Last opened files was not detected automatically. I tried to configure it manualy - last opened project search started to work, but I cannont open them via this plugin. IDEA itself from KDE menu works correctly.

Found /var/lib/flatpak/exports/share/applications/com.jetbrains.IntelliJ-IDEA-Ultimate.desktop based on StartupWMClass
========== Manually Configured Jetbrains Applications ==========
/var/lib/flatpak/app/com.jetbrains.IntelliJ-IDEA-Ultimate/current/active/export/share/applications/com.jetbrains.IntelliJ-IDEA-Ultimate.desktop
/home/daniel/.var/app/com.jetbrains.IntelliJ-IDEA-Ultimate/config/JetBrains/IntelliJIdea2022.2/options/recentProjects.xml
Application path map: 
IntelliJ IDEA Ultimate ==> /var/lib/flatpak/app/com.jetbrains.IntelliJ-IDEA-Ultimate/current/active/export/share/applications/com.jetbrains.IntelliJ-IDEA-Ultimate.desktop
========== Custom Configured Applications ==========
Config file found for IntelliJ IDEA Ultimate <application>
  <component name="RecentProjectsManager">
    <option name="additionalInfo">
      <map>
        <entry key="/home/web/q/c">
          <value>
            <RecentProjectMetaInfo frameTitle="c-parent – build.gradle" projectWorkspaceId="1cSOurJckccpbKoMYRRp3ybZukO">
              <option name="activationTimestamp" value="1659043736672" />
              <option name="binFolder" value="$APPLICATION_HOME_DIR$/bin" />
              <option name="build" value="IU-222.3345.118" />
              <option name="buildTimestamp" value="1658811692943" />
              <frame x="0" y="0" width="1920" height="1036" extendedState="6" />
              <option name="productionCode" value="IU" />
              <option name="projectOpenTimestamp" value="1659038974599" />
            </RecentProjectMetaInfo>
          </value>
        </entry>
        <entry key="/home/web/q/q-notifier">
          <value>
            <RecentProjectMetaInfo frameTitle="q-notifier – build.gradle.kts (q-notifier)" projectWorkspaceId="1fgQY3ouV05ny4kW2Ffxh3OHcAm">
              <option name="activationTimestamp" value="1659047009471" />
              <option name="binFolder" value="$APPLICATION_HOME_DIR$/bin" />
              <option name="build" value="IU-222.3345.118" />
              <option name="buildTimestamp" value="1658811700144" />
              <frame x="0" y="0" width="1920" height="1036" extendedState="6" />
              <option name="productionCode" value="IU" />
              <option name="projectOpenTimestamp" value="1659047009580" />
            </RecentProjectMetaInfo>
          </value>
        </entry>
        <entry key="/home/web/q/q-api-gateway">
          <value>
            <RecentProjectMetaInfo frameTitle="q-api-gateway" opened="true" projectWorkspaceId="1nNSZ4bOv4rWBoJJ04hxP5AjTqW">
              <option name="activationTimestamp" value="1659047020407" />
              <option name="binFolder" value="$APPLICATION_HOME_DIR$/bin" />
              <option name="build" value="IU-222.3345.118" />
              <option name="buildTimestamp" value="1658811670654" />
              <frame x="0" y="0" width="1920" height="1036" extendedState="6" />
              <option name="productionCode" value="IU" />
              <option name="projectOpenTimestamp" value="1659047500504" />
            </RecentProjectMetaInfo>
          </value>
        </entry>
      </map>
    </option>
    <option name="lastOpenedProject" value="/home/web/q/q-api-gateway" />
  </component>
</application>
IntelliJ IDEA Ultimate file content is empty 
========== Find Available Config Folders ==========
========== Filter Jetbrains Apps ==========
alex1701c commented 2 years ago

Last opened files was not detected automatically. I tried to configure it manualy - last opened project search started to work

Yeah, the flatpak packages seem to use different locations for the config than the other install methods.

IDEA itself from KDE menu works correctly.

Could you please provide the desktop file of idea? According to your logs this is /var/lib/flatpak/app/com.jetbrains.IntelliJ-IDEA-Ultimate/current/active/export/share/applications/com.jetbrains.IntelliJ-IDEA-Ultimate.desktop

DanielNoga commented 2 years ago
[Desktop Entry]
Categories=Development;IDE;
Exec=/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=idea com.jetbrains.IntelliJ-IDEA-Ultimate
GenericName=Capable and Ergonomic IDE for the Java Virtual Machine
Icon=com.jetbrains.IntelliJ-IDEA-Ultimate
Keywords=development;idea;ide;intellij;java;
Name=IntelliJ IDEA Ultimate
StartupNotify=true
StartupWMClass=jetbrains-idea
Terminal=false
Type=Application
X-Flatpak=com.jetbrains.IntelliJ-IDEA-Ultimate
alex1701c commented 2 years ago

Makes sense, I will try out the flatpak and work on a fix.

DanielNoga commented 2 years ago

I tested latest updates and both detection and opening works for IDEA with master and fix_flatpak_detection branch of subproject. But it looks Webstorm has different issue. Logs:

Found /var/lib/flatpak/exports/share/applications/com.jetbrains.IntelliJ-IDEA-Ultimate.desktop based on StartupWMClass
========== Manually Configured Jetbrains Applications ==========
/var/lib/flatpak/exports/share/applications/com.jetbrains.WebStorm.desktop
/home/daniel/.var/app/com.jetbrains.WebStorm/config/JetBrains/WebStorm2022.2/options/recentProjects.xml
Application path map: 
IntelliJ IDEA Ultimate ==> /var/lib/flatpak/exports/share/applications/com.jetbrains.IntelliJ-IDEA-Ultimate.desktop
WebStorm ==> /var/lib/flatpak/exports/share/applications/com.jetbrains.WebStorm.desktop
========== Custom Configured Applications ==========
Config file found for WebStorm <application>
  <component name="RecentProjectsManager">
    <option name="additionalInfo">
      <map>
        <entry key="/home/web/q/frontend-react">
          <value>
            <RecentProjectMetaInfo frameTitle="frontend-react – README.md" opened="true" projectWorkspaceId="1qFcJwk01lcroDtZvoUqjLuZBAn">
              <option name="activationTimestamp" value="1659207165031" />
              <option name="binFolder" value="$APPLICATION_HOME_DIR$/bin" />
              <option name="build" value="WS-222.3345.108" />
              <option name="buildTimestamp" value="1658513731783" />
              <frame x="260" y="20" width="1400" height="996" />
              <option name="productionCode" value="WS" />
              <option name="projectOpenTimestamp" value="1659205794891" />
            </RecentProjectMetaInfo>
          </value>
        </entry>
      </map>
    </option>
    <option name="lastOpenedProject" value="/home/web/q/frontend-react" />
  </component>
</application>
WebStorm file content is empty 
========== Find Available Config Folders ==========
WebStorm /home/daniel/.var/app/com.jetbrains.WebStorm/config/JetBrains/WebStorm2022.2
IntelliJIdea /home/daniel/.var/app/com.jetbrains.IntelliJ-IDEA-Ultimate/config/JetBrains/IntelliJIdea2022.2
IntelliJ IDEA Ultimate /home/daniel/.var/app/com.jetbrains.IntelliJ-IDEA-Ultimate/config/JetBrains/IntelliJIdea2022.2/options/  from alias
Config file found for IntelliJ IDEA Ultimate /home/daniel/.var/app/com.jetbrains.IntelliJ-IDEA-Ultimate/config/JetBrains/IntelliJIdea2022.2/options/recentProjects.xml
Config file found for IntelliJ IDEA Ultimate /home/daniel/.var/app/com.jetbrains.IntelliJ-IDEA-Ultimate/config/JetBrains/IntelliJIdea2022.2/options/recentProjects.xml
===== Recently used project folder for IntelliJ IDEA Ultimate=====
    /home/web/q/q-notifier
    /home/web/q/c
    /home/web/q/pcs
    /home/web/q/q-api-gateway

========== Filter Jetbrains Apps ==========

And desktop file:

[Desktop Entry]
Categories=Development;IDE;
Exec=/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=webstorm com.jetbrains.WebStorm
GenericName=The smartest JavaScript IDE
Icon=com.jetbrains.WebStorm
Keywords=development;javascript;webstorm;
Name=WebStorm
StartupNotify=true
StartupWMClass=webstorm
Terminal=false
Type=Application
X-Flatpak-Tags=proprietary;
X-Flatpak=com.jetbrains.WebStorm
DanielNoga commented 2 years ago

Thank you, this looks fixed now and I moved that WebStorm to separate issue

alex1701c commented 2 years ago

I will make a release once the webstorm issue is fixed too