Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No Symbols Found for PHP #2823

Closed
DevynCJohnson opened this issue Jun 10, 2021 · 17 comments
Closed

No Symbols Found for PHP #2823

DevynCJohnson opened this issue Jun 10, 2021 · 17 comments

Comments

@DevynCJohnson
Copy link
Contributor

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.

@elextr
Copy link
Member

elextr commented Jun 10, 2021

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 reverting #2666 manually first before you try to learn to use bisect :)

@eht16
Copy link
Member

eht16 commented Jun 12, 2021

Current master does show symbols for me.
@DevynCJohnson would you mind to share some example code which is not working?

@elextr
Copy link
Member

elextr commented Jun 12, 2021

@DevynCJohnson also check that Geany is recognising those files as PHP (Filetype in the status bar).

@DevynCJohnson
Copy link
Contributor Author

@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;
    }
}

@elextr
Copy link
Member

elextr commented Jun 16, 2021

@DevynCJohnson that code shows symbols for me

@elextr
Copy link
Member

elextr commented Jun 16, 2021

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.

@DevynCJohnson
Copy link
Contributor Author

@elextr , I am on the master-branch. With both v1.37.1 and the master branch, I experience that issue.

@DevynCJohnson
Copy link
Contributor Author

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.

@DevynCJohnson
Copy link
Contributor Author

DevynCJohnson commented Jun 16, 2021

Never mind about my last comment. The functions that were listed were JavaScript functions that were called in HTML with the PHP file.

@DevynCJohnson
Copy link
Contributor Author

Reverting to commit f600937 (Feb 5, 2021), which is the commit before the merging of #2666, does not resolve the issue.

@elextr
Copy link
Member

elextr commented Jun 16, 2021

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.

@DevynCJohnson
Copy link
Contributor Author

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)

@elextr
Copy link
Member

elextr commented Jun 16, 2021

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.

@elextr
Copy link
Member

elextr commented Jun 16, 2021

Oh wait, do I understand correctly you said here 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 ?

@DevynCJohnson
Copy link
Contributor Author

@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.

@elextr
Copy link
Member

elextr commented Jun 16, 2021

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.

[Edit, all I did was paste it into a blank document, set the filetype to PHP and save it to /tmp]

@DevynCJohnson
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants