After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 618142 - Anjuta Snippets Plug-in
Anjuta Snippets Plug-in
Status: RESOLVED FIXED
Product: anjuta
Classification: Applications
Component: plugins: snippet-manager
git master
Other Linux
: Normal normal
: ---
Assigned To: Dragos Dena
Anjuta maintainers
Depends on:
Blocks:
 
 
Reported: 2010-05-09 01:23 UTC by Dragos Dena
Modified: 2011-01-14 19:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
IAnjutaMacro to IAnjutaSnippetManager (7.63 KB, patch)
2010-05-09 01:27 UTC, Dragos Dena
rejected Details | Review
The patch with the plugin (604.25 KB, patch)
2010-08-10 22:33 UTC, Dragos Dena
reviewed Details | Review
New version. (623.15 KB, patch)
2010-08-13 22:56 UTC, Dragos Dena
committed Details | Review

Description Dragos Dena 2010-05-09 01:23:22 UTC
As suggested by jhs, I opened this bug report for my GSoC project: an Anjuta Snippet Manager plug-in. I will attach the patches for my plug-in here until it's final version.
Comment 1 Dragos Dena 2010-05-09 01:27:08 UTC
Created attachment 160617 [details] [review]
IAnjutaMacro to IAnjutaSnippetManager

Changed the name of IAnjutaMacro to IAnjutaSnippetManager.
Now, the macro and file-wizard plugins should make use of the IAnjutaSnippetManager interface.
If needed, additional methods will be added to IAnjutaSnippetManager later.
Comment 2 Johannes Schmid 2010-05-09 13:06:48 UTC
Review of attachment 160617 [details] [review]:

I don't see much benefit in applying this patch now as the backend of the SnippetManager isn't ready yet and as such only the interface names are changed.

In addition, I would like that the interface covers the cases discussed in the mail from the beginning when it's changed.
Comment 3 Dragos Dena 2010-08-10 22:33:52 UTC
Created attachment 167548 [details] [review]
The patch with the plugin
Comment 4 Johannes Schmid 2010-08-11 06:53:06 UTC
Review of attachment 167548 [details] [review]:

Looks very good overall, nice cooding style!

I made some minor comments (see below). It would be nice to have the import/export feature (at least for anjuta-snippets) in so we don't need to announce another string change.

Thanks a lot!

::: plugins/sourceview/sourceview.c
@@ -1191,3 @@
 	sourceview_cell_get_iter (cell, &iter);
 	
-	g_signal_handlers_block_by_func (sv->priv->document,

Have you checked that auto-indentation still works when you remove that?

::: plugins/snippets-manager/Makefile.am
@@ +69,3 @@
+	snippets-import-export.c\
+	snippets-import-export.h
+	

You need to add the rules for schema generation here. See the Makefiles from other plugins with preferences.

::: plugins/snippets-manager/plugin.c
@@ +294,3 @@
+	                         ANJUTA_SHELL_PLACEMENT_LEFT,
+	                         NULL);
+    snippets_manager_plugin->browser_maximized = FALSE;

indentation...

@@ +352,3 @@
+	if (snippets_manager_plugin->browser_maximized)
+		on_snippets_browser_unmaximize_request (snippets_manager_plugin->snippets_browser,
+			                                    snippets_manager_plugin);

dito

@@ +419,3 @@
+	snippets_manager->snippets_provider = 
+		snippets_provider_new (snippets_manager->snippets_db,
+	                           snippets_manager->snippets_interaction);

dito

::: plugins/snippets-manager/snippets-global-variables.xml
@@ +10,3 @@
+	<global-variable name="year" is_command="true" ><![CDATA[date +%Y]]></global-variable>
+
+	<global-variable name="email" is_command="false"><![CDATA[user@host]]></global-variable>

This looks wrong. You can receive the mail from the preferences (as well as the user name)

::: plugins/language-manager/languages.xml
@@ +10,3 @@
 	<language id="6" name="Vala" strings="vala" mime-types="text/x-vala" make-target=".o"/>
 	<language id="7" name="JavaScript" strings="js,javascript" mime-types="application/javascript"/>
+	<language id="8" name="Perl" strings="perl" mime-types="application/x-perl"/>

Have you checked these strings with scintilla, too?
Comment 5 Dragos Dena 2010-08-13 22:56:45 UTC
Created attachment 167849 [details] [review]
New version.

A basic import/export feature added and also some bugs fixed.
Comment 6 Johannes Schmid 2010-08-15 19:56:47 UTC
Review of attachment 167849 [details] [review]:

Looks good!
Comment 7 Johannes Schmid 2010-08-15 20:29:46 UTC
Review of attachment 167849 [details] [review]:

OK, I found too many things that are not working to apply that now:

* when inserting using autocompletion and you have fo<trigger autocopmletion here> you get "fofor (...)"
* the language column isn't disabled when a file is in the editor
* The interactive variables didn't work at all for me (or I wasn't aware how the should). When I inserted a for loop I should go the default values
* Import/Export menu items do nothing
* We need to rename "Snippets Browser" to "Snippets" because it wastes to much space otherwise
* Would be cool to have the snippets icon instead of GTK_STOCK_FILE for the snippets browser
* We really need far more snippets but that can wait for later
Comment 8 Dragos Dena 2010-08-16 00:10:35 UTC
(In reply to comment #7)
> Review of attachment 167849 [details] [review]:
> 
> OK, I found too many things that are not working to apply that now:

    Wow ... looking now what's wrong. Except for the last 2 things, everything worked for me.
Comment 9 Johannes Schmid 2010-08-16 20:06:03 UTC
OK, sorry, I did something wrong while patching, anyway, these points are left:


> * when inserting using autocompletion and you have fo<trigger autocopmletion
> here> you get "fofor (...)"
> * Would be cool to have the snippets icon instead of GTK_STOCK_FILE for the
> snippets browser
> * We really need far more snippets but that can wait for later

Patch is applied in master though.
Comment 10 Johannes Schmid 2010-08-16 20:06:35 UTC
Review of attachment 167849 [details] [review]:

Applied to master with some changes to the buttons.
Comment 11 Dragos Dena 2010-08-17 09:59:44 UTC
> > * when inserting using autocompletion and you have fo<trigger autocopmletion
> > here> you get "fofor (...)"

    Hmmmm, can't reproduce it. Does it happen all the time? Could you file a bug about it?
Comment 12 Johannes Schmid 2011-01-14 19:16:10 UTC
Closing as SoC is long over.