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

While projects are listed on KRunner, no actions are taken. #31

Closed rodrigopedra closed 1 year ago

rodrigopedra commented 1 year ago

I've been using this plugin for a while now, and it is very helpful. Some days ago (I was very busy these last days, so I can't remember, but it was surely in the past two weeks) it just stopped working.

I run KRunner (alt+space) then type the shortcut (php dummy for example) and after selecting it and hitting enter, PhpStorm is not opened anymore.

If PhpStorm is already open, the plugin also does not work anymore to open a different project.

My OS setup:

Operating System: openSUSE Tumbleweed 20221102 KDE Plasma Version: 5.26.2 KDE Frameworks Version: 5.99.0 Qt Version: 5.15.6 Kernel Version: 6.0.5-1-default (64-bit) Graphics Platform: X11

PhpStorm: 2022.2.3

If I can provide any other info, please let me know.

alex1701c commented 1 year ago

Thanks for the feedback! I can not reproduce with PhpStorm installed from Jetbrains-Toolbox and master of this plugin. What version of this plugin do you have installed?

Please say how you have installed PhpStorm and provide the ~/.config/JetBrains/PhpStorm2022.2/options/recentProjects.xml file.

rodrigopedra commented 1 year ago

Hey, thanks for the response.

I installed it from the .tar.gz file available at this link: https://www.jetbrains.com/phpstorm/download/download-thanks.html and manually following the Install-Linux-tar.txt file compressed in this archive file.

Here is the file:

<application>
  <component name="RecentProjectsManager">
    <option name="additionalInfo">
      <map>
        <entry key="$USER_HOME$/code/conectora/ouvidora">
          <value>
            <RecentProjectMetaInfo frameTitle="ouvidora" projectWorkspaceId="23TYqAR9hdP56SvjOstxUsb8alh">
              <option name="activationTimestamp" value="1666273399742" />
              <option name="binFolder" value="$APPLICATION_HOME_DIR$/bin" />
              <option name="build" value="PS-222.4345.15" />
              <option name="buildTimestamp" value="1664986563761" />
              <frame x="1920" y="32" width="1920" height="1048" extendedState="6" />
              <option name="productionCode" value="PS" />
              <option name="projectOpenTimestamp" value="1666272101394" />
            </RecentProjectMetaInfo>
          </value>
        </entry>
        <entry key="$USER_HOME$/code/conectora/novo-ouvidora">
          <value>
            <RecentProjectMetaInfo frameTitle="novo-ouvidora" projectWorkspaceId="27Dyg5IYQTo34P1W5dfiYyljywt">
              <option name="activationTimestamp" value="1666636701439" />
              <option name="binFolder" value="$APPLICATION_HOME_DIR$/bin" />
              <option name="build" value="PS-222.4345.15" />
              <option name="buildTimestamp" value="1664986599327" />
              <frame x="1920" y="1112" width="1920" height="1048" extendedState="6" />
              <option name="productionCode" value="PS" />
              <option name="projectOpenTimestamp" value="1666636124413" />
            </RecentProjectMetaInfo>
          </value>
        </entry>
        <entry key="$USER_HOME$/code/playground/latte">
          <value>
            <RecentProjectMetaInfo frameTitle="latte" projectWorkspaceId="25I7GxRZQrwt6anduxe4buEnRC6">
              <option name="activationTimestamp" value="1666810304859" />
              <option name="binFolder" value="$APPLICATION_HOME_DIR$/bin" />
              <option name="build" value="PS-222.4345.15" />
              <option name="buildTimestamp" value="1664986590958" />
              <frame x="1920" y="1112" width="1920" height="1048" extendedState="6" />
              <option name="productionCode" value="PS" />
              <option name="projectOpenTimestamp" value="1666810175768" />
            </RecentProjectMetaInfo>
          </value>
        </entry>
        <entry key="$USER_HOME$/code/playground/resultados">
          <value>
            <RecentProjectMetaInfo frameTitle="resultados" projectWorkspaceId="2Fanuv63GCTXfswOQaMsfPJ147m">
              <option name="activationTimestamp" value="1667177633357" />
              <option name="binFolder" value="$APPLICATION_HOME_DIR$/bin" />
              <option name="build" value="PS-222.4345.15" />
              <option name="buildTimestamp" value="1664986608674" />
              <frame x="1920" y="1112" width="1920" height="1048" extendedState="6" />
              <option name="productionCode" value="PS" />
              <option name="projectOpenTimestamp" value="1667144576237" />
            </RecentProjectMetaInfo>
          </value>
        </entry>
        <entry key="$USER_HOME$/code/playground/dummy">
          <value>
            <RecentProjectMetaInfo frameTitle="dummy" projectWorkspaceId="2GSl2QChg61xRG8X7fO6Z9n4vHT">
              <option name="activationTimestamp" value="1667217925202" />
              <option name="binFolder" value="$APPLICATION_HOME_DIR$/bin" />
              <option name="build" value="PS-222.4345.15" />
              <option name="buildTimestamp" value="1664986604582" />
              <frame x="1920" y="1112" width="1920" height="1048" extendedState="6" />
              <option name="productionCode" value="PS" />
              <option name="projectOpenTimestamp" value="1667204750015" />
            </RecentProjectMetaInfo>
          </value>
        </entry>
        <entry key="$USER_HOME$/code/conectora/avaliadora">
          <value>
            <RecentProjectMetaInfo frameTitle="avaliadora – Handler.php" opened="true" projectWorkspaceId="23DfZ6Zj6JcwX0P8LjlpHH1X7Lt">
              <option name="activationTimestamp" value="1667530842702" />
              <option name="binFolder" value="$APPLICATION_HOME_DIR$/bin" />
              <option name="build" value="PS-222.4345.15" />
              <option name="buildTimestamp" value="1664986619934" />
              <frame x="1920" y="1112" width="1920" height="1048" extendedState="6" />
              <option name="productionCode" value="PS" />
              <option name="projectOpenTimestamp" value="1667439635312" />
            </RecentProjectMetaInfo>
          </value>
        </entry>
      </map>
    </option>
    <option name="lastOpenedProject" value="$USER_HOME$/code/conectora/avaliadora" />
    <option name="lastProjectLocation" value="$USER_HOME$/code/conectora" />
  </component>
</application>
alex1701c commented 1 year ago

I wonder about the installation, gets a desktop file installed somewhere? I tried it locally (at first I used Jetbrains-toolbox) and it did not seem to install a desktop file. Maybe you could just attach it :)

What version of this plugin do you have installed?

Please provide this info.

rodrigopedra commented 1 year ago

What version of this plugin do you have installed?

Sorry, I missed that one. I have the latest 1.9.2 version, I update from GitHub on a weekly basis.

To install a desktop file, open PhpStorm and choose this option from the Welcome Dialog's settings menu:

image

You can also open a project, choose the Tools menu and then the "Create Desktop Entry..." option as described on their documentation:

https://www.jetbrains.com/help/phpstorm/2022.2/installation-guide.html#standalone

Please choose the "Linux" tab, as they do not provide an anchor link direct to it.

For instance, this is my current .desktop file for PhpStorm:

[Desktop Entry]
Version=1.0
Type=Application
Name=PhpStorm
Icon=/home/rodrigo/apps/phpstorm/bin/phpstorm.svg
Exec=env XMODIFIERS=phpstorm.sh "/home/rodrigo/apps/phpstorm/bin/phpstorm.sh" %f
Comment=Lightning-smart PHP IDE
Categories=Development;IDE;
Terminal=false
StartupWMClass=jetbrains-phpstorm
StartupNotify=true

Currently installed at ~/.local/share/applications/jetbrains-phpstorm.desktop.

As said before, it used to work fine about two weeks ago.

alex1701c commented 1 year ago

Thanks for the info, I can confirm the issue. This was broken when fixing another bug :/

For now, you could go back to version 1.9.1.

rodrigopedra commented 1 year ago

Don't worry! Thanks for the hard work. I am glad I could help to find it. Have a nice weekend.

alex1701c commented 1 year ago

Have a nice weekend too!

I have created a PR with a proposed fix, can you please check if it works for you? Please update the project using git pull --recurse and then run git checkout fix_local_install_launch. The recurse is needed because of the submodule :)

rodrigopedra commented 1 year ago

Thanks. I just tested it out, and unfortunately it didn't work.

https://user-images.githubusercontent.com/5470108/200185203-22562f86-87a1-49a8-925c-03d7349a2ff1.mp4

alex1701c commented 1 year ago

Can you please try running krunner --replace on the terminal and then launch the projects? Might provide further info.

And just to double-check: When you do a git log in the src/jetbrains-api/ folder, you see the commits I did today?

rodrigopedra commented 1 year ago

When you do a git log in the src/jetbrains-api/ folder, you see the commits I did today?

Yes.

commit d870452aba7d2819368111213a66605ada48a559 (HEAD -> fix_local_install_launch, origin/fix_local_install_launch)
Author: Alexander Lohnau <alexander.lohnau@gmx.de>
Date:   Sun Nov 6 13:10:57 2022 +0100

    Do not build tests when installing plugin

    This is only for developers and not normal users relevant

Results from krunner --replace

$ krunner --replace
kf.runner: KRunner plugin "skroogeaddoperation" still uses a .desktop file ("org.kde.plasma-runner-skrooge-add-operation.desktop"). Please port it to JSON metadata.
kf.kio.core: -miniicon isn't supported anymore (service "" )
kf.kio.core: -miniicon isn't supported anymore (service "" )
env: ‘/home/rodrigo/code/conectora/avaliadora’: Permission denied

I ran the query php avaliadora (avaliadora is a project's name)

One note, that could be an alternative. In the same menu to install a Desktop file, there is an entry to install a CLI to open projects.

For example, pstorm /home/rodrigo/code/conectora/avaliadora would open the project on that directory.

This is working fine. Not sure if helpful, but could be an alternative if you can catch any errors.

alex1701c commented 1 year ago

When you do a git log in the src/jetbrains-api/ folder, you see the commits I did today?

I meant if you cd into the dir, sorry :see_no_evil:

rodrigopedra commented 1 year ago

I have this:

commit 22762492b72aeae6226a3fb62a5e6a20fb108188 (HEAD)
Author: Alexander Lohnau <alexander.lohnau@gmx.de>
Date:   Sun Oct 30 19:01:55 2022 +0100

    Use KIO::DesktopExecParser for reading Exec value

    This way we do not have to deal with the placeholders for URLs
    and quotes for the path, which might become problematic later on.

When doing git pull on this directory I get this warning:

~/code/plasma/JetBrainsRunner/src/jetbrains-api [detached:remotes/origin/HEAD~3 ✓] $ git pull
You are not currently on a branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>

I guess I should switch branches on this directory too? Is this it?

rodrigopedra commented 1 year ago

Ah ok, changing branches on ./src/jetbrains-api to master and git pull it, made it work.

Now I have this on git log

commit 37f66ebc0422ff07b39e45e0675554133d41c192 (HEAD -> master, origin/master, origin/HEAD)
Author: Alexander Lohnau <alexander.lohnau@gmx.de>
Date:   Sun Nov 6 13:00:38 2022 +0100

    Silence false positive clazy warnings

    This will very likely be only called once. Thus there is no need to declare it as static

I don't know how I ended up on a detached state on this directory. My update script I run every week looks like this:

sudo rm -rf /home/rodrigo/code/plasma/JetBrainsRunner/build
cd /home/rodrigo/code/plasma/JetBrainsRunner || exit
git pull --force --recurse-submodules
sh /home/rodrigo/code/plasma/JetBrainsRunner/install.sh

Maybe I should change

git pull --force --recurse-submodules

to just

git pull --force --recurse

Would it avoid the detached state?

rodrigopedra commented 1 year ago

Yes, that change seems to actually recurse into sub-directories.

I usually copy install scripts from other apps I manually update from their git repositories. I will review one by one to find where the --recurse-submodules option came from

So I can confirm it is back working with the changes from earlier today (down here it is still Nov'6th)

rodrigopedra commented 1 year ago

By the way, thanks a lot for fixing it so fast and for the all your patience. Have a nice week =)

alex1701c commented 1 year ago

Would it avoid the detached state?

The submodule is taken at a specific commit ID. Meaning, if I change the module, I have to update this project to include the changes. That is intended this way, because changes could break the KRunner plugin and I do not want to have to keep strict compatibility.

By the way, thanks a lot for fixing it so fast and for the all your patience.

Yeah, no problem. I feel a bit sorry for even using git submodules, because they are always a bit weird/confusing.

I will make a new release of this project & update it on the KDE Store. Have a nice week too!