Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: drev on March 05, 2008, 08:45:29 pm

Title: Suggets of improvements to Code Snippets plugin
Post by: drev on March 05, 2008, 08:45:29 pm
Hello,
There is some suggets to improve the code snippets plugin.

* See the snippet in a text field at the bottom of the treeCtrl (instead of opening a new window)
* Always save/load to/from a .xml file (currently, they are saved in a sytem dir)
* Import/export eclipse xml snippets

I can code that in some weeks, what do you think of that ?
Title: Re: Suggets of improvements to Code Snippets plugin
Post by: Pecan on March 06, 2008, 01:38:06 am
Hello,
There is some suggets to improve the code snippets plugin.

* See the snippet in a text field at the bottom of the treeCtrl (instead of opening a new window)

Personally, my snippets are too large for a text field in a small window. And I often have multiple snippets open at the same time.
I usually keep snippets in a snippet file (FileLink) and would rather see them in an editor with all the facilities of an edtior.

But you/re most welcome to change my opinion with a demo.

* Always save/load to/from a .xml file (currently, they are saved in a sytem dir)

ummm, I don't understand. Snippets *are* loaded saved/from an .xml .

* Import/export eclipse xml snippets

I don't have an opinion. I have no experience with Eclipse.

I can code that in some weeks, what do you think of that ?

Good. A demo/prototype would be instructive.
Title: Re: Suggets of improvements to Code Snippets plugin
Post by: MortenMacFly on March 06, 2008, 08:31:34 am
* Import/export eclipse xml snippets
I wouldn't do that. It is not within the C::B focus to support each and every feature of other IDE's. Project importers are the only exception. If you want such funtionality it would be better to either write an(other) (own) plugin or a tiny (command line based) stand-alone converter. The latter should be *really* easy to implement.
Title: Re: Suggets of improvements to Code Snippets plugin
Post by: drev on March 10, 2008, 01:45:35 pm
Thanks for your answers,
It's a good idea to make a command line eclipse / snippet converter

The main problem for me with this snippet editor is :
When I use it on my USB key (or when i copy it to an another PC) the snippets are not copied too (it's like the appearance of codeblock) I don't know where they are saved... but i always must export/import

It would be better to always save snippets to an (relative path) xml file and automatically load it at the start-up of the editor.
Title: Re: Suggets of improvements to Code Snippets plugin
Post by: mariocup on March 10, 2008, 04:37:28 pm
Hi,

the codesnippets plugins save the configuration in your APPDATA directory. The content of the codesnippets browser is saved in codesnippets.xml and the settings in codesnippets.ini. In the codesnippets.ini file you can change the location of the loaded content

Code
SnippetFile= <your path>/codesnippets.xml


You can also load a different snippets file via the context menu in the codesnippets browser within CodeBlocks.

Bye,

Mario
Title: Re: Suggets of improvements to Code Snippets plugin
Post by: Pecan on March 10, 2008, 08:17:34 pm
You can also set your snippet directory from within the settings menu. Right click on the root item and choose settings.
Note the "Snippets Folder" entry.

(http://img217.imageshack.us/img217/5751/218hy5.png)
Title: Re: Suggets of improvements to Code Snippets plugin
Post by: drev on March 12, 2008, 11:05:12 am
Ok, i did not know about application data.