VS Code suggestions for PHP show everything, instead of class functions only

Viewed 5091

I tried setting up VS Code for a legacy PHP project, to evaluate it against other IDEs. My problem is with the suggestions I get, when I press <an object>->Ctrl+Space. For example I want to get all suggestions (properties and functions) of a certain class. I am in the class and I type:

$this->(Ctrl+Space)

I get a large list of functions and constants, which are things I can use in PHP in general and not the functions and properties of the class I am in. After I installed the PHP Intelephense extension, I get the class methods that I need in my suggestions, but still they are mixed with everything else and hard to find, unless I start typing the first letters of the function I need to access. To show you what I mean, this is what I get, when I type the following within a function of my class:

enter image description here

I don't think this is a matter of extension, because even if I disable all my extensions I still get the whole bunch of suggestions. How can I remove all unnecessary suggestions, or at least give priority to the class specific suggestions and see them on top of the list?

2 Answers

You must disable the vscode built-in PHP Language Features.

  1. Click extensions.
  2. In the search bar type @builtin php.
  3. Click cog icon of PHP Language Features.
  4. Click Disable.

Extension UI - Disabling built-in PHP Language Features

Related