bmewburn / vscode-intelephense

PHP intellisense for Visual Studio Code
https://intelephense.com
Other
1.6k stars 93 forks source link

Go to Definition on class opens peek #355

Closed traed closed 5 years ago

traed commented 5 years ago

When right-clicking on a class name and choosing Go to Definition the Peek Definition menu is shown instead of the class file being opened.

OS: MacOS 10.14.3 VS code version: 1.32.3 Ext. version: 1.0.8

bmewburn commented 5 years ago

Does it occur on an object creation expression -- new Foo() ? How many definitions are shown in the peek? Please show an example or screenshot.

traed commented 5 years ago

Yes, object creation. Two definitions, one for the class signature and one for the __construct-method. Also, if the file is symlinked it shows up an additional time and points to the original file.

Not symlinked:

Screenshot 2019-03-17 at 21 58 36

Symlinked:

Screenshot 2019-03-17 at 22 05 37
bmewburn commented 5 years ago

Thanks, vsocde shows the peek UI when multiple definition locations are returned. Providing the class and constructor locations is intended here as a user may want either the class definition or constructor definition (which could be on a base class). Tracking the symlink issue in #356 .

jasonvarga commented 4 years ago

Is it possible to jump straight to the class if there's only one file?

I understand that you might want to see the constructor from another class, but if there's only one class it feels like an extra click, or that I've done something wrong.

(Sorry for reviving an old thread - I can open a new issue if you prefer)

bmewburn commented 4 years ago

@jasonvarga take a look at the vscode editor.gotoLocation.multipleDefinitions setting.

jasonvarga commented 4 years ago

Thanks 👍