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

Automatic detection not working #33

Closed QazCetelic closed 1 year ago

QazCetelic commented 1 year ago

The plugin has trouble detecting CLion, IntelliJIdea, and Rider. They are installed using the JetBrains Toolbox. Manually adding the mappings fixes the issue.

IDE Recent Project XML Desktop File
IntelliJ ~/.config/JetBrains/IntelliJIdea2022.2 ~/.local/share/applications/jetbrains-idea.desktop
CLion ~/.config/JetBrains/CLion2022.2 ~/.local/share/applications/jetbrains-clion.desktop
Rider ~/home/qaz/.config/JetBrains/Rider2022.2 ~/.local/share/applications/jetbrains-rider.desktop
alex1701c commented 1 year ago

That is weird, I have the exact same IntelliJ version and it works fine. Could you please list the folders in ~/.config/JetBrains/?

alex1701c commented 1 year ago

Also, please attach the log file you can generate in the config dialog

QazCetelic commented 1 year ago

It seems that it does find the desktop files on startup but it did not show any entries until the IDE's were manually mapped.

Found /home/qaz/.local/share/applications/jetbrains-idea.desktop based on entry path
Found /home/qaz/.local/share/applications/jetbrains-clion.desktop based on entry path
Found /home/qaz/.local/share/applications/jetbrains-webstorm.desktop based on entry path
Found /home/qaz/.local/share/applications/jetbrains-mps.desktop based on entry path
Found /home/qaz/.local/share/applications/jetbrains-idea-ce.desktop based on entry path
Found /home/qaz/.local/share/applications/jetbrains-rider.desktop based on entry path
Found /home/qaz/.local/share/applications/jetbrains-fleet.desktop based on entry path
Found /home/qaz/.local/share/applications/jetbrains-pycharm-ce.desktop based on entry path
Found /home/qaz/.local/share/applications/Space Desktop.desktop based on StartupWMClass
========== Manually Configured Jetbrains Applications ==========
/home/qaz/.local/share/applications/jetbrains-clion.desktop
/home/qaz/.config/JetBrains/CLion2022.2/options/recentProjects.xml
/home/qaz/.local/share/applications/jetbrains-idea.desktop
/home/qaz/.config/JetBrains/IntelliJIdea2022.2/options/recentProjects.xml
...
...
========== Find Available Config Folders ==========
WebStorm /home/qaz/.config/JetBrains/WebStorm2022.2
Rider /home/qaz/.config/JetBrains/Rider2022.2
Rider /home/qaz/.config/JetBrains/Rider2022.1
IntelliJIdea /home/qaz/.config/JetBrains/IntelliJIdea2022.2
IntelliJIdea /home/qaz/.config/JetBrains/IntelliJIdea2022.1
IdeaIC /home/qaz/.config/JetBrains/IdeaIC2022.2
IdeaIC /home/qaz/.config/JetBrains/IdeaIC2022.1
CLion /home/qaz/.config/JetBrains/CLion2022.2
CLion /home/qaz/.config/JetBrains/CLion2022.1
Fleet 1.9.231 Public Preview is not contained in alias
IntelliJ IDEA Community 2022.2.3 is not contained in alias
MPS 2021.3.1 is not contained in alias
PyCharm Community 2022.2 is not contained in alias
Space Desktop 2022.1.2 is not contained in alias
WebStorm 2022.2.3 is not contained in alias
...

However, it does contain the lines IntelliJ IDEA Ultimate file content is empty, Rider 2022.2.3 file content is empty, CLion 2022.2.4 file content is empty. These match up with the custom mappings.

Log ``` Found /home/qaz/.local/share/applications/jetbrains-idea.desktop based on entry path Found /home/qaz/.local/share/applications/jetbrains-clion.desktop based on entry path Found /home/qaz/.local/share/applications/jetbrains-webstorm.desktop based on entry path Found /home/qaz/.local/share/applications/jetbrains-mps.desktop based on entry path Found /home/qaz/.local/share/applications/jetbrains-idea-ce.desktop based on entry path Found /home/qaz/.local/share/applications/jetbrains-rider.desktop based on entry path Found /home/qaz/.local/share/applications/jetbrains-fleet.desktop based on entry path Found /home/qaz/.local/share/applications/jetbrains-pycharm-ce.desktop based on entry path Found /home/qaz/.local/share/applications/Space Desktop.desktop based on StartupWMClass ========== Manually Configured Jetbrains Applications ========== /home/qaz/.local/share/applications/jetbrains-clion.desktop /home/qaz/.config/JetBrains/CLion2022.2/options/recentProjects.xml /home/qaz/.local/share/applications/jetbrains-idea.desktop /home/qaz/.config/JetBrains/IntelliJIdea2022.2/options/recentProjects.xml /home/qaz/.local/share/applications/jetbrains-rider.desktop /home/qaz/.config/JetBrains/Rider2022.2/options/recentSolutions.xml Application path map: CLion 2022.2.4 ==> /home/qaz/.local/share/applications/jetbrains-clion.desktop Fleet 1.9.231 Public Preview ==> /home/qaz/.local/share/applications/jetbrains-fleet.desktop IntelliJ IDEA Community 2022.2.3 ==> /home/qaz/.local/share/applications/jetbrains-idea-ce.desktop IntelliJ IDEA Ultimate ==> /home/qaz/.local/share/applications/jetbrains-idea.desktop MPS 2021.3.1 ==> /home/qaz/.local/share/applications/jetbrains-mps.desktop PyCharm Community 2022.2 ==> /home/qaz/.local/share/applications/jetbrains-pycharm-ce.desktop Rider 2022.2.3 ==> /home/qaz/.local/share/applications/jetbrains-rider.desktop Space Desktop 2022.1.2 ==> /home/qaz/.local/share/applications/Space Desktop.desktop WebStorm 2022.2.3 ==> /home/qaz/.local/share/applications/jetbrains-webstorm.desktop ========== Custom Configured Applications ========== Config file found for CLion 2022.2.4 CLion 2022.2.4 file content is empty Config file found for IntelliJ IDEA Ultimate IntelliJ IDEA Ultimate file content is empty Config file found for Rider 2022.2.3 Rider 2022.2.3 file content is empty ========== Find Available Config Folders ========== WebStorm /home/qaz/.config/JetBrains/WebStorm2022.2 Rider /home/qaz/.config/JetBrains/Rider2022.2 Rider /home/qaz/.config/JetBrains/Rider2022.1 IntelliJIdea /home/qaz/.config/JetBrains/IntelliJIdea2022.2 IntelliJIdea /home/qaz/.config/JetBrains/IntelliJIdea2022.1 IdeaIC /home/qaz/.config/JetBrains/IdeaIC2022.2 IdeaIC /home/qaz/.config/JetBrains/IdeaIC2022.1 CLion /home/qaz/.config/JetBrains/CLion2022.2 CLion /home/qaz/.config/JetBrains/CLion2022.1 Fleet 1.9.231 Public Preview is not contained in alias IntelliJ IDEA Community 2022.2.3 is not contained in alias MPS 2021.3.1 is not contained in alias PyCharm Community 2022.2 is not contained in alias Space Desktop 2022.1.2 is not contained in alias WebStorm 2022.2.3 is not contained in alias ========== Filter Jetbrains Apps ========== Found not projects for: Fleet 1.9.231 Public Preview Found not projects for: IntelliJ IDEA Community 2022.2.3 Found not projects for: MPS 2021.3.1 Found not projects for: PyCharm Community 2022.2 Found not projects for: Space Desktop 2022.1.2 Found not projects for: WebStorm 2022.2.3 ```
QazCetelic commented 1 year ago

That is weird, I have the exact same IntelliJ version and it works fine. Could you please list the folders in ~/.config/JetBrains/?

alex1701c commented 1 year ago

Thanks a ton already! AFICS you have the logs with your custom mapping provided, could you please trash/rename ~/.config/krunnerplugins/jetbrainsrunnerrc and generate the log again?

Also, I have improved the logging a bit. Please run git pull in the root of this project, go into src-jetbrains-api, check out master there, pull & run the install script from the root of the project. Then there is a bit more context :)

QazCetelic commented 1 year ago
Found /home/qaz/.local/share/applications/jetbrains-idea.desktop based on entry path
Found /home/qaz/.local/share/applications/jetbrains-fleet.desktop based on entry path
Found /home/qaz/.local/share/applications/jetbrains-rider.desktop based on entry path
Found /home/qaz/.local/share/applications/jetbrains-clion.desktop based on entry path
Found /home/qaz/.local/share/applications/jetbrains-webstorm.desktop based on entry path
Found /home/qaz/.local/share/applications/jetbrains-idea-ce.desktop based on entry path
Found /home/qaz/.local/share/applications/jetbrains-pycharm-ce.desktop based on entry path
Found /home/qaz/.local/share/applications/Space Desktop.desktop based on StartupWMClass
Found /home/qaz/.local/share/applications/jetbrains-mps.desktop based on entry path
========== Manually Configured Jetbrains Applications ==========
Application path map: 
CLion 2022.2.4 ==> /home/qaz/.local/share/applications/jetbrains-clion.desktop
Fleet 1.9.231 Public Preview ==> /home/qaz/.local/share/applications/jetbrains-fleet.desktop
IntelliJ IDEA Community 2022.2.3 ==> /home/qaz/.local/share/applications/jetbrains-idea-ce.desktop
IntelliJ IDEA Ultimate ==> /home/qaz/.local/share/applications/jetbrains-idea.desktop
MPS 2021.3.1 ==> /home/qaz/.local/share/applications/jetbrains-mps.desktop
PyCharm Community 2022.2 ==> /home/qaz/.local/share/applications/jetbrains-pycharm-ce.desktop
Rider 2022.2.3 ==> /home/qaz/.local/share/applications/jetbrains-rider.desktop
Space Desktop 2022.1.2 ==> /home/qaz/.local/share/applications/Space Desktop.desktop
WebStorm 2022.2.3 ==> /home/qaz/.local/share/applications/jetbrains-webstorm.desktop
========== Find Available Config Folders ==========
WebStorm /home/qaz/.config/JetBrains/WebStorm2022.2
Rider /home/qaz/.config/JetBrains/Rider2022.2
Rider /home/qaz/.config/JetBrains/Rider2022.1
IntelliJIdea /home/qaz/.config/JetBrains/IntelliJIdea2022.2
IntelliJIdea /home/qaz/.config/JetBrains/IntelliJIdea2022.1
IdeaIC /home/qaz/.config/JetBrains/IdeaIC2022.2
IdeaIC /home/qaz/.config/JetBrains/IdeaIC2022.1
CLion /home/qaz/.config/JetBrains/CLion2022.2
CLion /home/qaz/.config/JetBrains/CLion2022.1
CLion 2022.2.4 is not contained in alias
Fleet 1.9.231 Public Preview is not contained in alias
IntelliJ IDEA Community 2022.2.3 is not contained in alias
IntelliJ IDEA Ultimate /home/qaz/.config/JetBrains/IntelliJIdea2022.2/options/  from alias
MPS 2021.3.1 is not contained in alias
PyCharm Community 2022.2 is not contained in alias
Rider 2022.2.3 is not contained in alias
Space Desktop 2022.1.2 is not contained in alias
WebStorm 2022.2.3 is not contained in alias
Config file found for IntelliJ IDEA Ultimate /home/qaz/.config/JetBrains/IntelliJIdea2022.2/options/recentProjects.xml
Config file found for IntelliJ IDEA Ultimate /home/qaz/.config/JetBrains/IntelliJIdea2022.2/options/recentProjects.xml
===== Recently used project folder for IntelliJ IDEA Ultimate=====
    /home/qaz/Project/Programming/Qt/haruna
    /home/qaz/Project/Programming/Rust/legi
    /home/qaz/Project/Programming/Kotlin/Selenium
    /home/qaz/Project/Programming/Rust/algo

========== Filter Jetbrains Apps ==========
Found not projects for: CLion 2022.2.4
Found not projects for: Fleet 1.9.231 Public Preview
Found not projects for: IntelliJ IDEA Community 2022.2.3
Found not projects for: MPS 2021.3.1
Found not projects for: PyCharm Community 2022.2
Found not projects for: Rider 2022.2.3
Found not projects for: Space Desktop 2022.1.2
Found not projects for: WebStorm 2022.2.3
alex1701c commented 1 year ago

That is really weird. Can you please check out master in the src/jetbrains-api submodule and try again? I have also added a bit of better logging.

And does the ~/.config/JetBrains/CLion2022.2/options/ folder exist for you?

QazCetelic commented 1 year ago

~/.config/JetBrains/CLion2022.2/options/ exists and contains:

The projects in the log do show up, these all seem to be projects that I have opened after opening this issue. I suspect that all detected projects have been added after deleting ~/.config/krunnerplugins/jetbrainsrunnerrc. Older projects aren't detected. IntelliJ shows far more opened projects than the plugin finds.

Found /home/qaz/.local/share/applications/jetbrains-rider.desktop based on entry path
Found /home/qaz/.local/share/applications/jetbrains-fleet.desktop based on entry path
Found /home/qaz/.local/share/applications/jetbrains-clion.desktop based on entry path
Found /home/qaz/.local/share/applications/jetbrains-mps.desktop based on entry path
Found /home/qaz/.local/share/applications/jetbrains-webstorm.desktop based on entry path
Found /home/qaz/.local/share/applications/jetbrains-pycharm-ce.desktop based on entry path
Found /home/qaz/.local/share/applications/Space Desktop.desktop based on StartupWMClass
Found /home/qaz/.local/share/applications/jetbrains-idea.desktop based on entry path
Found /home/qaz/.local/share/applications/jetbrains-idea-ce.desktop based on entry path
Application path map:
CLion ==> /home/qaz/.local/share/applications/jetbrains-clion.desktop
Fleet 1.9.231 Public Preview ==> /home/qaz/.local/share/applications/jetbrains-fleet.desktop
IntelliJ IDEA Community ==> /home/qaz/.local/share/applications/jetbrains-idea-ce.desktop
IntelliJ IDEA Ultimate ==> /home/qaz/.local/share/applications/jetbrains-idea.desktop
MPS ==> /home/qaz/.local/share/applications/jetbrains-mps.desktop
PyCharm Community 2022.2 ==> /home/qaz/.local/share/applications/jetbrains-pycharm-ce.desktop
Rider ==> /home/qaz/.local/share/applications/jetbrains-rider.desktop
Space Desktop ==> /home/qaz/.local/share/applications/Space Desktop.desktop
WebStorm ==> /home/qaz/.local/share/applications/jetbrains-webstorm.desktop
========== Find Available Config Folders ==========
WebStorm /home/qaz/.config/JetBrains/WebStorm2022.2
Rider /home/qaz/.config/JetBrains/Rider2022.2
Rider /home/qaz/.config/JetBrains/Rider2022.1
IntelliJIdea /home/qaz/.config/JetBrains/IntelliJIdea2022.2
IntelliJIdea /home/qaz/.config/JetBrains/IntelliJIdea2022.1
IdeaIC /home/qaz/.config/JetBrains/IdeaIC2022.2
IdeaIC /home/qaz/.config/JetBrains/IdeaIC2022.1
CLion /home/qaz/.config/JetBrains/CLion2022.2
CLion /home/qaz/.config/JetBrains/CLion2022.1
found config folder /home/qaz/.config/JetBrains/CLion2022.2/options/ for CLion
Fleet 1.9.231 Public Preview is not contained in alias
IntelliJ IDEA Community /home/qaz/.config/JetBrains/IdeaIC2022.2/options/  from alias
IntelliJ IDEA Ultimate /home/qaz/.config/JetBrains/IntelliJIdea2022.2/options/  from alias
MPS is not contained in alias
PyCharm Community 2022.2 is not contained in alias
found config folder /home/qaz/.config/JetBrains/Rider2022.2/options/ for Rider
Space Desktop is not contained in alias
found config folder /home/qaz/.config/JetBrains/WebStorm2022.2/options/ for WebStorm
Config file found for CLion /home/qaz/.config/JetBrains/CLion2022.2/options/recentProjects.xml
===== Recently used project folder for CLion=====
    NO PROJECTS

Config file found for IntelliJ IDEA Community /home/qaz/.config/JetBrains/IdeaIC2022.2/options/recentProjects.xml
===== Recently used project folder for IntelliJ IDEA Community=====
    NO PROJECTS

Config file found for IntelliJ IDEA Ultimate /home/qaz/.config/JetBrains/IntelliJIdea2022.2/options/recentProjects.xml
===== Recently used project folder for IntelliJ IDEA Ultimate=====
    /home/qaz/removed from log
    /home/qaz/removed from log
    /home/qaz/removed from log
    /home/qaz/removed from log
    /home/qaz/removed from log

Config file found for Rider /home/qaz/.config/JetBrains/Rider2022.2/options/recentSolutions.xml
===== Recently used project folder for Rider=====
    /home/qaz/removed from log
    /home/qaz/removed from log
    /home/qaz/removed from log
    /home/qaz/removed from log
    /home/qaz/removed from log
    /home/qaz/removed from log
    /home/qaz/removed from log
    /home/qaz/removed from log
    /home/qaz/removed from log
    /home/qaz/removed from log
    /home/qaz/removed from log
    /home/qaz/removed from log
    /home/qaz/removed from log

Config file found for WebStorm /home/qaz/.config/JetBrains/WebStorm2022.2/options/recentProjects.xml
===== Recently used project folder for WebStorm=====
    NO PROJECTS

========== Filter Jetbrains Apps ==========
Found not projects for: CLion
Found not projects for: Fleet 1.9.231 Public Preview
Found not projects for: IntelliJ IDEA Community
Found not projects for: MPS
Found not projects for: PyCharm Community 2022.2
Found not projects for: Space Desktop
Found not projects for: WebStorm
alex1701c commented 1 year ago

I suspect that all detected projects have been added after deleting ~/.config/krunnerplugins/jetbrainsrunnerrc

Yeah, that is where the custom mappings were saved.

Config file found for CLion /home/qaz/.config/JetBrains/CLion2022.2/options/recentProjects.xml ===== Recently used project folder for CLion===== NO PROJECTS

That bit is interesting, because it seems like the path is correct, but it still does not find projects. On my setup, the path is the same, and it reads the projects. Can you please attach the file?

IntelliJ shows far more opened projects than the plugin finds.

Are the files that are missing in the KRunner plugin in the recentProjects.xml file?

QazCetelic commented 1 year ago

Clion's recentProjects.xml contains:

<application>
  <component name="RecentProjectsManager">
    <option name="lastOpenedProject" value="$USER_HOME$/Programming/Rust/borso" />
    <option name="lastProjectLocation" value="$USER_HOME$/Programming/C++/Qt" />
  </component>
</application>

IntelliJ has 54 entries in the recentProjects.xml file but only 5 listed in the log file.

alex1701c commented 1 year ago

Clion's recentProjects.xml contains:

That is super weird, ony my setup the XML contains lots more info:

<application>
  <component name="RecentProjectsManager">
    <option name="additionalInfo">
      <map>
        <entry key="$USER_HOME$/CLionProjects/cpphelloworld">
          <value>
            <RecentProjectMetaInfo frameTitle="cpphelloworld" opened="true" projectWorkspaceId="2Hi2jnUjFzW3ZB8ojt76PjxR7bF">
              <option name="activationTimestamp" value="1668784150095" />
              <option name="binFolder" value="$APPLICATION_HOME_DIR$/bin" />
              <option name="build" value="CL-222.4345.21" />
              <option name="buildTimestamp" value="1665390674502" />
              <frame x="580" y="198" width="1400" height="1000" />
              <option name="productionCode" value="CL" />
              <option name="projectOpenTimestamp" value="1668784139615" />
            </RecentProjectMetaInfo>
          </value>
        </entry>
      </map>
    </option>
    <option name="lastOpenedProject" value="$USER_HOME$/CLionProjects/cpphelloworld" />
  </component>
</application>

Even more weird is that with the custom mapping, you reported it working fine.

IntelliJ has 54 entries in the recentProjects.xml file but only 5 listed in the log file.

Is the xml structure there the same and do the paths still exist on your computer?

alex1701c commented 1 year ago

@QazCetelic Could you please provide the info?