hello im trying to use geanygendoc for php in geany 0.19.1
i have created a function like that :
function test ($a, $b) { return $a; }
so im using the "tools" menu then "document generator" then "document current symbol" -> nothing happens
using "document all symbols" -> nothing happens
i could see that using the right click mouse button, there is a menu called "insert comments" and inside, there is "insert function description" that is giving me : /* * * name: unknown * @param * @return */
cool, but i could use "snippets" for that, i would prefear to see : /* * * name: test * @param $a * @return $a */
there is also "insert documentation comments" but nothing is happening when using it.
so im not able to use geanygendoc
the doc is containing a list of config options and some example that i can not understand on how to use them, i thought that it was "install and play" :)
if someone could provide a quick help on how to use it please ?
Hi again,
Le 17/09/2010 15:43, ssm2017 a écrit :
[…]
i could see that using the right click mouse button, there is a menu called "insert comments" and inside, there is "insert function description" that is giving me : /*
- name: unknown
- @param
- @return
*/
This one is a default Geany functionality, nothing related to GeanyGenDoc.
cool, but i could use "snippets" for that, i would prefear to see : /*
- name: test
- @param $a
- @return $a
*/
And it's where GeanyGenDoc can help you :) (when configured, see below)
there is also "insert documentation comments" but nothing is happening when using it.
so im not able to use geanygendoc
the doc is containing a list of config options and some example that i can not understand on how to use them, i thought that it was "install and play" :)
Well, the problem you're facing is the lack of default configuration for PHP, because unfortunately nobody wrote it yet.
And yes, the documentation about configuration files is perhaps a bit hard to understand at first glance, I'm sorry... I must try to make it a bit easier to read someday -- but that's difficult when you already know what you're talking about :/
Well, anyway, what you want is a working configuration for PHP, right? So, I'll try to explain a little what you have to do:
I suggest you to start with the C configuration file, so copy it from /usr/share/geany-plugins/geanygendoc/filetypes/c.conf [1], and put it in ~/.config/geany/plugins/geanygendoc/filetypes/php.conf So you have a configuration for PHP -- but it's currently the C one.
You now have to: 1) modify the match_function_arguments regular expression in the settings section, in order to extract the argument list from functions [2]. This is the complex part, because it should work with every possible constructions. 2) in the doctypes list [3], add or modify the settings (if needed). Basically, the Doxygen part should be OK for PHP, apart from missing class support. 3) when you're done, reload the GeanyGenDoc configuration files with Tools -> Documentation Generator -> Reload Configuration Files (or restart Geany) 4) ...it should now work!
BTW, I just wrote a basic PHP configuration file (I join it here) that you can (try to) use and improve if needed. Tell me if/how it works :)
If you have any more questions, please, go ahead :)
Regards, Colomban
PS: it seems there's a strange bug with PHP files that places the documentation at the wrong position for functions if they are indented... :/ I'll take a look at this.
[1] or from the SVN if it's also missing from the Ubuntu package...: http://geany-plugins.svn.sourceforge.net/viewvc/geany-plugins/trunk/geanygen...
[2] Yes, that's a sad implementation detail, but it's needed (at least for now, hopefully it could be done automatically someday)
[3] Each doctype represents the rules to follow in order to generate the documentation for each symbol. Basically, see it as the output format -- Odxygen, Gtk-Doc, whatever.
Le 17/09/2010 18:18, Colomban Wendling a écrit :
PS: it seems there's a strange bug with PHP files that places the documentation at the wrong position for functions if they are indented... :/ I'll take a look at this.
Hum, nothing related to PHP, that was a bug that was visible when tabs are used for indentation. Fixed in SVN r1588.
Regards, Colomban
hello thank you for attention
i have copied your php.conf file to my ~/.config/geany/plugins/geanygendoc/filetypes/php.conf then i reloaded config files when trying to use geanygendoc, i have this error in the output panel : "20:12:31: Documentation type "" does not exist for language "PHP"."
2010/9/17 Colomban Wendling lists.ban@herbesfolles.org:
Le 17/09/2010 18:18, Colomban Wendling a écrit :
PS: it seems there's a strange bug with PHP files that places the documentation at the wrong position for functions if they are indented... :/ I'll take a look at this.
Hum, nothing related to PHP, that was a bug that was visible when tabs are used for indentation. Fixed in SVN r1588.
Regards, Colomban _______________________________________________ Geany mailing list Geany@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany
Le 17/09/2010 20:14, ssm2017 a écrit :
hello thank you for attention
i have copied your php.conf file to my ~/.config/geany/plugins/geanygendoc/filetypes/php.conf then i reloaded config files when trying to use geanygendoc, i have this error in the output panel : "20:12:31: Documentation type "" does not exist for language "PHP"."
Hum, seems I don't set a default value for the documentation type, my bad... Go in the plugin's preferences dialog (edit -> plugin preferences -> documentation generator), and under "documentation type" set the documentation type of language "All" to "doxygen".
Regards, Colomban
thank you it looks working now
2010/9/17 Colomban Wendling lists.ban@herbesfolles.org:
Le 17/09/2010 20:14, ssm2017 a écrit :
hello thank you for attention
i have copied your php.conf file to my ~/.config/geany/plugins/geanygendoc/filetypes/php.conf then i reloaded config files when trying to use geanygendoc, i have this error in the output panel : "20:12:31: Documentation type "" does not exist for language "PHP"."
Hum, seems I don't set a default value for the documentation type, my bad... Go in the plugin's preferences dialog (edit -> plugin preferences -> documentation generator), and under "documentation type" set the documentation type of language "All" to "doxygen".
Regards, Colomban _______________________________________________ Geany mailing list Geany@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany
sometimes, im having a strange behavior im only using geanygendoc for php functions actually sometimes, it is refusing to create the functiuon header and tells me : 23:24:36: No setting applies to symbol "result" of type "variable" at line 105. it is going in the function and get a variable then say this sometimes, when adding empty lines between 2 functions, it is working but not all the time... :)
2010/9/17 ssm2017 ssm2017@gmail.com:
thank you it looks working now
2010/9/17 Colomban Wendling lists.ban@herbesfolles.org:
Le 17/09/2010 20:14, ssm2017 a écrit :
hello thank you for attention
i have copied your php.conf file to my ~/.config/geany/plugins/geanygendoc/filetypes/php.conf then i reloaded config files when trying to use geanygendoc, i have this error in the output panel : "20:12:31: Documentation type "" does not exist for language "PHP"."
Hum, seems I don't set a default value for the documentation type, my bad... Go in the plugin's preferences dialog (edit -> plugin preferences -> documentation generator), and under "documentation type" set the documentation type of language "All" to "doxygen".
Regards, Colomban _______________________________________________ Geany mailing list Geany@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany
Hi,
Le 17/09/2010 23:28, ssm2017 a écrit :
sometimes, im having a strange behavior im only using geanygendoc for php functions actually sometimes, it is refusing to create the functiuon header and tells me : 23:24:36: No setting applies to symbol "result" of type "variable" at line 105. it is going in the function and get a variable then say this sometimes, when adding empty lines between 2 functions, it is working but not all the time... :)
Hum, I think this isn't a bug but simply the way it is (and because the Geany's PHP tag extractor extracts variables inside functions). It it's actually a bug, just say it again (and give an example to reproduce it, please :)).
Actually, what GeanyGenDoc does to find out what you want to document is very simple: it finds the first tag (symbol) before or at the current line. So since the PHP tag extractor extracts variables inside functions, if your cursor is inside the function but after a variable, this is the variable that will be found.
A small example:
1. function foo ($bar) { 2. 3. $var = 42; 4. // ...
There is symbols at line 1 (a function) and 3 (a variable). So if the cursor is at line 1 or 2, the function foo() will be the "current" symbol, but at line 3 or 4, the variable $var will prevail.
This is a bit annoying from the PHP parser to extract all these variables, yes... I just committed to SVN a way to completely ignore some symbols, which fixes this. I also added the updated PHP configuration file, so current SVN should support PHP by default -- even though that configuration file probably isn't prefect yet.
2010/9/17 ssm2017 ssm2017@gmail.com:
thank you it looks working now
Cool :) BTW, I created the "doxygen" doctype, but if you want something different, either modify the current templates or create a new doctype (and use it, by setting the appropriate value in the plugin configuration).
Regards, Colomban