Bug 354308 - Added previously snippets are not loaded after next start of KDevelop
Summary: Added previously snippets are not loaded after next start of KDevelop
Status: RESOLVED FIXED
Alias: None
Product: kdevplatform
Classification: Developer tools
Component: snippet (show other bugs)
Version: git master
Platform: Mageia RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-24 15:11 UTC by Piotr Mierzwinski
Modified: 2015-11-01 16:30 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Snippets-1 (5.37 KB, image/png)
2015-10-28 20:20 UTC, Piotr Mierzwinski
Details
Snippets-2 (8.20 KB, image/png)
2015-10-28 20:20 UTC, Piotr Mierzwinski
Details
Snippets-3 (5.37 KB, image/png)
2015-10-28 20:22 UTC, Piotr Mierzwinski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Mierzwinski 2015-10-24 15:11:00 UTC
After running KDevelop I added couple of snippets. After that they were visible on tree view of snippets plugin. I close KDevelop and next day I run him again. I've noted that my added snippet disappeared. And wired was that when I was trying add them again (using "Get new snippets") finds out that they were marked as added. Actually were listed in option "Added". I've added following snippet: "C++ Snippets" (Milian is author) and "General Purpose C++ Snippets".
The issue is that snippet are no visible on view, because it seem that they work (I tested with foreach).

I can tell also that added "private" snippets are loaded correctly after next start of KDevelop.

Reproducible: Always

Steps to Reproduce:
1. Run KDevelop
2. Turn on Snippets plugin (if doesn't run)
3. Open Snippets view
4. Invoke "Get new snippets"
5. Select and add couple of them
6. Close KDevelop
7. Run KDevelop again

Actual Results:  
Snippets are not visible in TreeView placed on the Snippets view

Expected Results:  
All added snippets should be visible in TreeView placed on the Snippets view

KDevelop cloned in the afternoon on 2015-10-24.

By the way TreeView placed in the Snippets view and "Filter" field are not fit to the Snippet view.
Comment 1 Sven Brauch 2015-10-27 09:20:11 UTC
Hmm. I cannot reproduce this. However, I have seen the wrongly-sized snippets toolview as well before, and it almost feels like a broken config file (is XMLGUI involved here somehow?), because it suddenly went away without anybody changing the code and was okay ever since. Can you maybe try in a fresh environment (add user account, run kdevelop as that user or so)?
Comment 2 Piotr Mierzwinski 2015-10-28 20:19:56 UTC
OK. I will create new user.
Done from terminal. Configuration is for sure clear. Making sure all is fine, I was restarting the system. Being logged on new user I started the tests.

In running KDevelop in "Plugins" option I can see duplicated Snippets plugin. Both are checked, but Snippets bar is not visible on right edge (default position). I can see it in Kate configuration, but here is only one (default turn off).
I turned off both. Pressed OK on configuration dialog. Again opened Configuration and turned on second one (both have been marked after that). Snippets bar is visible on the right edge, but looks very ugly - screen-shot attached ("Snippets-1"). I've added two snippets using, like before, option "Get New Snippets". Next screen presents both added - ("Snippets-2"). Time to restart of KDevelop, but before I will check Kate. And... surprise. I can see here both added (in KDevelop, because in Kate I nothing added only I tuned on this plugin) Snippets. Seems like something was written into wrong configuration file :/. Just I guess. OK lets check KDevelop. Next screen-shot ("Snippets-3") presents Snippets view after KDevelop restart. As you can see. View is empty.

Could you please check this yourself on some new user, because maybe you have something wrong in configuration. Again, I guess only.

KDevelop (branch 5.0) cloned today afternoon.
Comment 3 Piotr Mierzwinski 2015-10-28 20:20:23 UTC
Created attachment 95193 [details]
Snippets-1
Comment 4 Piotr Mierzwinski 2015-10-28 20:20:53 UTC
Created attachment 95194 [details]
Snippets-2
Comment 5 Piotr Mierzwinski 2015-10-28 20:22:08 UTC
Created attachment 95195 [details]
Snippets-3
Comment 6 Sven Brauch 2015-10-28 20:39:47 UTC
That the snippets plugin appears twice seems wrong already. Can you make sure you don't have some stray KDevelop 4 files around in your installation?
Comment 7 Milian Wolff 2015-10-29 14:51:29 UTC
What version of KTextEditor do you have? Potentially this requires some changes there, I forgot right now. Probably we need to disable this based on the version of the plugin somehow.
Comment 8 Piotr Mierzwinski 2015-10-29 22:49:09 UTC
@Sven, @Milian
I don't have KDevelop 4 installation on system where I'm testing KDevelop 5. I have also only one directory containing plugins (calling "24").
I have installed quite fresh Kate. Cloned (master branch) the same day like KDevelop (2015-10-28).
Comment 9 Piotr Mierzwinski 2015-10-29 23:51:50 UTC
@Sven
I have removed all installation kate and ktexteditor as I had and installed only these provided by my distribution. After this operation I have only one entry referring to the Snippets in KDevelop Configuration. Minor problem fixed.

OK. This was detail. The main problem is that Snippets view looks ugly (like on first and last screenshot) and worst that added snippets are not loaded after KDevelop restart :(. Of course are still visible in Kate, So could you please in what location you save added snippets.

Why I had 2 entries referring to Snippets in KDevelop configuration?
After small investigation it turned out that I had two installation of kate plugins :/. So my fault.
First one from was from my distribution and was located in: /usr/lib/qt5/plugins/ktexteditor
Second one I got after installation kate from sources and was located in: /usr/lib/plugins/ktexteditor. Now are removed.
So it caused that plugins were doubled in configuration.

On end please look at my kate and ktexteditor version currently installed:
[root@localhost ~]# rpm -qa|grep kate
kate-15.08.2-2.mga6
kate-rust-0.10-4.mga5
[root@localhost ~]# rpm -qa|grep ktexte
ktexteditor-plugins-15.08.2-2.mga6
libktexteditor4-4.14.13-1.mga6
ktexteditor-5.15.0-1.mga6

I'm using also Qt-5.5.1
Kate is working fine.
Comment 10 Sven Brauch 2015-10-30 00:28:27 UTC
Hmm. I never found out what caused the view to look like you posted for me as well, it just started to work one day. I'm quite sure it was an installation issue, but I don't know which kind of, sorry :/
Milian, any ideas regarding this?
Comment 11 Piotr Mierzwinski 2015-10-30 17:43:58 UTC
Skipping how it looks like. What about the main issue presented in title of this bug report?
I'll try to rebuild again kdevplatform and then will check if the look changed or not.
By the way I'm testing on VirtualBox 5.0.4. Maybe this is the problem of displaying Snippets view?
Comment 12 Sven Brauch 2015-10-30 19:42:45 UTC
No, VirtualBox is not the problem here. I think the two issues are most likely related, that's why I always talk about what it looks like.
Comment 13 Piotr Mierzwinski 2015-10-30 20:05:15 UTC
Unfortunately rebuilding kdevplatform and kdevelop (both cloned today evening) didn't help :(.

Again I've created to tests new user. After start newly built KDevelop unfortunately everything works like I reported :(.
Additionally I noticed one more issue. On start Snippets plugin is turn on (in configuration), but it's not displayed on the right edge. I discovered work around. I turn off the Snippets, close KDevelop, start KDevelop, turn on the Snippets. Now it's displayed, but looks ugly and doesn't work properly :(.

Please note, I don't have any problems with other plugins only with Snippets :/

You are saying this could be installation issue. OK, but what? Kate and KTextEditor I've installed from distribution packages. Kate works. Snippets in Kate are working and looking pretty. Skipping that those turned on in KDevelop appearing in Kate :/.
KDevelop and KDevplatform were built from sources (cloned branch 5.0). I'm sure you are aware that If any dependency would not be complied then I could not build both.
This is weird. I don't have idea what can I do to test it in different way. I hope Milian come up with something :/.
Comment 14 Milian Wolff 2015-11-01 16:16:15 UTC
OK, the issue is really that your Kate is too old. I have fixed some things during the sprint a few weeks ago, and that is of course not included in the 15.08 release from august.  I'll have to disable the snippets plugin in KDevelop and add some kind of version check to prevent this.

If you want to have snippets working, try to compile kate from git master - it's not hard!
Comment 15 Milian Wolff 2015-11-01 16:30:02 UTC
Git commit 4738510625158c7db9275a6314e3fb4047d709df by Milian Wolff.
Committed on 01/11/2015 at 16:28.
Pushed by mwolff into branch 'master'.

Add KDevelop/Plugin service type for Kate plugins that are compatible.

Instead of hardcoding the list in KDevelop, we use this now to detect
whether a plugin is compatible. This is required, as sometimes the
plugin needs to be adapted to work properly in KDevelop.

M  +1    -1    addons/snippets/katesnippetsplugin.desktop

http://commits.kde.org/kate/4738510625158c7db9275a6314e3fb4047d709df
Comment 16 Milian Wolff 2015-11-01 16:30:53 UTC
Git commit b54593bb62e877fee7ce9729a3d6134e4bbfe77e by Milian Wolff.
Committed on 01/11/2015 at 16:30.
Pushed by mwolff into branch '5.0'.

Use the ServiceType to detect whether a KTextEditor plugin is KDevelop compatible.

M  +1    -4    shell/plugincontroller.cpp

http://commits.kde.org/kdevplatform/b54593bb62e877fee7ce9729a3d6134e4bbfe77e