vscode-php-intellisense
vscode-php-intellisense copied to clipboard
Go to definition -> no definition found
i installed php-intellisense in the morning, disabled php.suggest.basic
, set php.executablePath
and opened my php project folder (inserted into workspace).
if i want to go to a definition of a class or function or var i allways get a message that no definition is available.
the project was written in intelliJ and all works fine there. a change to vscode without correct working php intellisense is senseless.
Do you see any errors under "Help" > "Developer Tools"
No, there is no error in the console and no error in the network tab. looks all fine.
nothing is triggered in the logs on trying to jump to definition
I have the same problem too, those options only work if i want a definition in the current file
no sollution for it? i think vscode is going to be useless for me as php coder under windows now and i switch back to intelliJ or Atom
Go to Definition is the first feature of this extension that I tried. Instead of getting an error, the "progressbar" just keeps moving across the screen as if it's constantly trying.
Does Go to Definition work for anyone? Or is there something specifically wrong with our installations?
I have the same problem.
- I can only go to a definition in the same file.
- If I open the file containing the definition, I can now go to the definition.
- If I close the file containing the definition again, I can still go to the definition.
- After restart of VS Code I am back to step 1.
Any way of forcing a scan or indexing of the workspace?
(I'm on MacOS 10.13.3)
[Edit] No errors listed in Developer Tools console.
Same. Go to definition only works for definitions that exist in already-opened files. This makes closing and reopening a PHP project extremely painful.
Hi, I remember that i coudn't fix this problem, but then i found a extension called Codeiginiter Intelliphense or something, and it has those options too. Of course, it only works if you have the framework. It could help somebody :)
Does anyone here have try to reset the php.exe? Sometimes the php.exe isn't working and need to be killed.
I have same problem, i need this feature like "Go to definition" of Sublime text 3
I definitely need to be able to go to definition as a PHP developer. Shame, I really liked vs code, but this is an essential feature.
As others have mentioned, 'Go to definition' only seems to work if you have already opened the file where the definition is located. Does anyone have a solution for this?
I never experienced it. Hmmm...
Sent from My Asus Pegasus X005
Pada tanggal Sel, 22 Mei 2018 22.22, Tory Kepler [email protected] menulis:
As others have mentioned, 'Go to definition' only seems to work if you have already opened the file where the definition is located. Does anyone have a solution for this?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/felixfbecker/vscode-php-intellisense/issues/225#issuecomment-391031943, or mute the thread https://github.com/notifications/unsubscribe-auth/ACr9NHJlvQg3c-kAExlRweycDatWKSPlks5t1C0lgaJpZM4Q5SxE .
Same issue here...
Same issue here. Quite a pain in the ass
Can anybody give more information? It works fine for me.
Extension version? Operating system? PHP Version? How many source files?
go to definition not working
win 7 sp1
not working for me too, my info:
- OS: WINDOWS 10 Home
- VS Code ver
- VS Code ext
- VS Code user settings
- function undefined
@danielhuang-030 When you tried the autocomplete does the autocomplete work? If not than don't expect that the goto function would work. I suggest to try https://marketplace.visualstudio.com/items?itemName=bmewburn.vscode-intelephense-client I don't advertise it, but for now that's a alternative that works very good and not depends on php.exe
@benyaminl Thank you for the suggestion, I just installed, it looks great!
Any updates on this issue? I have the same problem! This is probably the most important feature everyone is looking for and there has to be a solution to solve the current problem.
VS Code - version 1.27.1 PHP IntelliSense - version 2.3.5 PHP 7.1.16 Mac OS High Sierra - version 10.13.6
---- UPDATE ---- Actually I think it works it some use-cases and it doesn't it some different use-cases. For example, I have this code from a Laravel project:
/**
* Show details for a given listing
*
* @param \App\Area $area
* @param \App\Listing $listing
*
* @return \Illuminate\Http\Response
*/
public function show(Area $area, Listing $listing)
{
if (! $listing->live()) {
abort(404);
}
if (auth()->check()) {
auth()->user()->viewedListing($listing);
}
return view('listings.show', compact('listing'));
}
I was able to get the Go To Definition to work for the live()
method, but not for viewedListing()
method.
@vasilestefirta change to Intelephense, it's more stable and more powerful than Intelisense https://marketplace.visualstudio.com/items?itemName=bmewburn.vscode-intelephense-client
For laravel I think you need some more tools for it.
@benyaminl you already mentioned this before in the thread. Please keep this issue on topic.
To everyone else: If there is no update posted on this issue, there is no update. I don't have the capacity to investigate this in my free time. If anyone wants to do a PR with a fix, I am willing to invest time to review it. Given the amount of people here that posted here that they are affected by this, one would think someone here would care enough to look into it. It's just PHP code 🙂
@felixfbecker I think it's time for you to set up patreon profile so it would be your side project that generate money :v: so you have more time for develop it because it generate money :v
@benyaminl Intelephense works great for me! Thanks for the suggestion 💯 👍
On MacOS, when a folder is a symlink to another folder the content is not indexed, thus some definitions are not working. Could this be the problem ?
The problem is that by default this extension doesn't scan all files. You have to do hax like patching the source, or making sure the first directory in your workspace is an aggregate of any other directories in your workspace (defeating the purpose of having them broken down cleanly in the first place).
The solution is to make the scan directories configurable, but I haven't written a patch for it yet.
@cha0s This was it for me, and I'm curious how many others in this thread are in similar situations. I had two folders: a project folder (mostly text files and assets) and a library folder (PHP). "Go to Definition" only worked when the file containing the definition was already opened.
I then removed the project folder, so I only had the PHP folder, and now can navigate to those definitions even when the file is closed.
And for anyone wondering - I added the project folder back so that it was second on the list, and Intellisense still worked happily after a fresh restart. So it appears from behavior like the defect here is that the plugin only looks at the first directory in the list.
Works for me as well if the first folder in the project is the one including all the other code. Thanks for the tip.
Works for me as well if the first folder in the project is the one including all the other code. Thanks for the tip.
Nope. Just endless scanning in my case... Find all references does not work too.