In both v1.37.1 and the code on the master-branch (running on Ubuntu 20.04) do not report any symbols for PHP code. Neither can I Ctrl+Click a symbol nor use "Go to Symbol Definition" to find the symbol definition. Other languages (like C) list the symbols on the file and allow me to go to the symbol definition. I have tried many PHP files and I verified that my PHP files are valid, yet Geany seems to not be able to parse out the symbols.
I'm assuming it worked in the past. If so if you can build from git you could use bisect to find which commit broke it, then see what it did.
Hint try #2666 manually first before you try to learn to use bisect :)
Current master *does* show symbols for me. @DevynCJohnson would you mind to share some example code which is not working?
@DevynCJohnson also check that Geany is recognising those files as PHP (Filetype in the status bar).
@elextr , yes, Geany recognizes the file as PHP. I happened to notice that if I set the file-type to "HTML", then the symbols are listed. I still need to try Geany without that commit. I hope to report back soon.
@eht16 , below is some code that (at least on my system) does not display symbols.
``` <?php
function main() { return 0; }
class SomeClass {
public function __construct() { return; }
public function __destruct() { return; }
public function someFunction() { return; } } ```
@DevynCJohnson that code shows symbols for me
Oh wait, both @eht16 and I are on 1.38 with the number of the beast #2666 ctags PR that was _after_ 1.37 IIRC.
@DevynCJohnson maybe try current Git master.
@elextr , I am on the master-branch. With both v1.37.1 and the master branch, I experience that issue.
I may have found something. I tried disabling all of my plugins and then the symbols are listed. I will see which plugin is the culprit.
Mind about my last comment. The functions that were listed were JavaScript functions that were called in HTML with the PHP file.
Reverting to commit f600937dd8f592ff00150867537166b2d86aa4dd (Feb 5, 2021), which is the commit before the merging of #2666, does not resolve the issue.
Since your posted PHP code shows symbols for me, and other PHP shows symbols for @eht16 #2666 is probably not the problem.
Please post the detailed version GTK/Glib and OS from Help->debug messages.
The below is from the latest master-branch code that I am currently using.
``` 03:11:29: Geany INFO : Geany 1.38, en_US.UTF-8 03:11:29: Geany INFO : GTK 3.24.20, GLib 2.64.6 03:11:29: Geany INFO : OS: Ubuntu 20.04.2 LTS (focal) ```
Hmmm, I thought if Geany was built from Git it said the HEAD when it was configured (sadly not the one when built), like:
``` 11:08:30: Geany INFO : Geany 1.38 (git >= b524a58e), en_AU.UTF-8 ```
At this point I'm out of immediate ideas.
Oh wait, do I understand correctly you said [here](https://github.com/geany/geany/issues/2823#issuecomment-862130837) that there were JS functions as well as PHP ones in the same file? If so I'm not sure what will happen, I don't think Geany handles multiple language symbols in the same file, @techee ?
@elextr , you read that correctly. If JavaScript functions are in a `<script>` block within HTML that is in a PHP file, the JavaScript symbols will be listed in the "Symbols" list.
Well, as I said I don't know how well (or not) thats handled, but I guess it doesn't affect why you get no symbols but I do for the code you pasted above.
I found the cause of the issue. It was an ID-10-T error. More specifically, I had `tag_parser=HTML` under `[settings]` in the filetypes.php file.
Closed #2823.
github-comments@lists.geany.org