atom / ide-php

PHP language support for Atom-IDE
MIT License
264 stars 41 forks source link

Incorrect PHP Path silently errors #71

Open derikb opened 6 years ago

derikb commented 6 years ago

Atom 1.22.0 with atom-ide-ui 0.5.4 and ide-php 0.6.10 and php 7.1 on my computer.

Whenever I try to use the "Find References" command I get a popup that says "Find References: Symbol references are not available for this project."

Is there something special I need to do to enable symbol references?

rsese commented 6 years ago

As long as you haven't turned off Find References in the atom-ide-ui settings, you don't need to explicitly enable it.

Can you share an example where this isn't working for you? Also, if you try Find References on function foo() in the example below, does it work for you?

<?php
function foo() {
  echo "<p>Hello World!</p>";
}
foo();
?>

Lastly, what operating system are you running? The above simple example works for me on macOS 10.12.6, Atom 1.22.0, and PHP 7.1.11.

derikb commented 6 years ago

@rsese Thanks for the reply.

It's Mac OS 10.12.6. I added a file to my project directory, pasted in your example and got the same error.

Even if I start a new folder, open it in Atom, and add a file with that code, I still get the same error.

Find References is checked/enabled in my atom-ide-ui settings.

I tried disabling all my other packages except the atom-ide-ui and the php-ide, but still same results.

rsese commented 6 years ago

Hmmm, from devtools console, can you enable debugging with atom.config.set('core.debugLSP', true) and share what you see when trying Find References?

derikb commented 6 years ago

Ah, just opening the dev console, I find (multiple times):

Uncaught (in promise) Error: spawn EACCES
    at exports._errnoException (util.js:1022)
    at ChildProcess.spawn (internal/child_process.js:313)
    at Object.exports.spawn (child_process.js:399)
    at Promise (/Users/[username]/.atom/packages/ide-php/lib/main.js:48)
    at PHPLanguageClient.checkPHPVersion (/Users/[username]/.atom/packages/ide-php/lib/main.js:47)
    at PHPLanguageClient.spawnServer (/Users/[username]/.atom/packages/ide-php/lib/main.js:101)
    at getOrInstallServer.then (/Users/[username]/.atom/packages/ide-php/lib/main.js:26)

Perhaps it's an issue with my php install.

If I set core.debugLSP to true and run Find References, nothing more shows up. I just get that error dialog.

derikb commented 6 years ago

Ok, turns out my php path wasn't correctly pointing to the php binary. I just had it pointing to the php directory. So I guess the bug to report here, is that in such a case, instead of a "bad php path" error or something, that error went uncaught.

I assumed I had the php path set correctly, because after I set it, the message about not having the right php version stopped showing up (cause my default Mac php install was php5).

rsese commented 6 years ago

Ok, turns out my php path wasn't correctly pointing to the php binary. I just had it pointing to the php directory. So I guess the bug to report here, is that in such a case, instead of a "bad php path" error or something, that error went uncaught.

Hmm, I thought there used to be an error message if there was a problem with that path setting. I'll go ahead and tag as a bug for now.

damieng commented 6 years ago

We did a lot of work here, it's not clear which version the error related to. I'd say close down unless we get a new repro or you can repro it yourself @rsese

rsese commented 6 years ago

Hmmm, just gave it a try with ide-php 0.7.3 and looks like I can reproduce?

php-path-error

So the outline view works fine, I change the path setting to point to the directory containing the PHP binary, and the outline view stops working. In console I see the same error mentioned above but there's no error notification about an incorrect path setting like there was before.