alex1701c / JetBrainsRunner

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

Apps found but projects not listed #39

Closed nahoj closed 11 months ago

nahoj commented 1 year ago

Hi, I just gave the plugin (v1.9.4) a try and I don't see my projects when I start typing in KRunner.

I'm using intellij-idea-community and pycharm-community installed by snap on Kubuntu 23.04.

Log file:

Application path map:
========== Find Available Config Folders ==========
AndroidStudio /home/me/.config/Google/AndroidStudio2021.1
PyCharmCE /home/me/.config/JetBrains/PyCharmCE2023.2
IdeaIC /home/me/.config/JetBrains/IdeaIC2023.2
========== Filter Jetbrains Apps ==========
alex1701c commented 1 year ago

The snap version works fine for me (KDE Neon based on Ubuntu 22.04). Could you please attach the ~/.config/JetBrains/PyCharmCE2023.2/options/recentProjects.xml file?

nahoj commented 1 year ago

Here it is. I removed a couple of private pieces of info but nothing crucial I believe.

recentProjects.xml.txt

alex1701c commented 1 year ago

When removing the check if the given project exists, KRunner shows projects with your given file.

Are you sure those files exist on disk?

nahoj commented 1 year ago

Could there be a trick with $USER_HOME$? Otherwise yes, I'm sure, for instance:

% ls -al ~/perso/soft/moreutils
total 188K
...
drwxrwxr-x  8 jg jg  4096 sept.  3 15:15 .git
-rw-rw-r--  1 jg jg    44 août  21 19:36 .gitattributes
drwxrwxr-x  4 jg jg  4096 sept.  3 15:18 .idea
...
nahoj commented 1 year ago

Remark: my ~/.config/JetBrains is a symlink to a directory located elsewhere. Could this be a problem?

alex1701c commented 1 year ago

user ~> ls -l ~/.config/JetBrains/PyCharmCE2023.2/options/recentProjects.xml lrwxrwxrwx 1 user user 29 Sep 4 16:11 /home/user/.config/JetBrains/PyCharmCE2023.2/options/recentProjects.xml -> /home/user/recentProjects.xml

Even with a symlink, it works fine. But it might be worth a try to not symlink it on your system.

The USER_HOME variable is expanded by the plugin and should thus not be an issue

nahoj commented 1 year ago

Yeah I tried putting the folder in place of the symlink and it didn't work.

alex1701c commented 11 months ago

Sorry, I overlooked you having responded. I am a bit confused by this not working, maybe try out disabling the check if the files exist.

src/jetbrains-api/JetbrainsApplication.h line 72:

bool checkIfProjectsExist = false; // for test purposes
nahoj commented 11 months ago

Hey, I made the change and used install.sh, same result:

Application path map:
========== Find Available Config Folders ==========
AndroidStudio /home/jg/.config/Google/AndroidStudio2021.1
PyCharmCE /home/jg/.config/JetBrains/PyCharmCE2023.2
IdeaIC /home/jg/.config/JetBrains/IdeaIC2023.2
CLion /home/jg/.config/JetBrains/CLion2023.2
========== Filter Jetbrains Apps ==========
alex1701c commented 11 months ago

That is weird, I will investigate a bit more during the weekend and maybe add more logs to help triage the issue

alex1701c commented 11 months ago

My neon Plasma5 setup is broken, but after a quick KF6/Qt6 port, everything still seems to work.

Question: Does Pycharm show up in your KDE launchers as expected? Does the file /var/lib/snapd/desktop/applications/pycharm-community_pycharm-community.desktop exist on your machine? If so, please attach it. According to the log, there were not apps found (meaning the empty application path map)

alex1701c commented 11 months ago

@nahoj Could you please respond to my last comment? That should help making this plugin more reliable :)

nahoj commented 11 months ago

Hey, sorry for the delay. JetBrains apps don't appear in my KDE launchers. The .desktop file exists and works (launches PyCharm) though:

$ cat /var/lib/snapd/desktop/applications/pycharm-community_pycharm-community.desktop                                                             ✔  took 4s  system    at 14:34:52 
[Desktop Entry]
X-SnapInstanceName=pycharm-community
Version=1.0
Type=Application
Name=PyCharm Community Edition
Icon=/snap/pycharm-community/350/bin/pycharm.png
Exec=env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/pycharm-community_pycharm-community.desktop /snap/bin/pycharm-community %f
Comment=Python IDE for Professional Developers
Categories=Development;IDE;
Terminal=false
StartupWMClass=jetbrains-pycharm-ce
StartupNotify=true
nahoj commented 11 months ago

It works :tada:

I fixed snap apps not showing in my launchers by adding emulate sh -c 'source /etc/profile' to /etc/zsh/zprofile (https://askubuntu.com/a/989485) which in turn adds /var/lib/snapd/desktop to XDG_DATA_DIRS on login, and now your plugin shows my projects. Thanks!

nahoj commented 11 months ago

As I understand it, this issue would arise for anyone using zsh as a login shell on Ubuntu, if they didn't take the time to fix their XDG_DATA_DIRS / zprofile.

alex1701c commented 11 months ago

That is good to know! Also good that I made the logs a bit more extensive/clear so that we can tangle potential issues easier.