skip to Main Content

I just added the PHP extension by Devsense to my VSCode and now it’s lighting up like a Christmas tree. I want to disable the Intellisense option for unknown/undefined properties.

Here is the issue
and the error message
Undefined property: MY_Model::$load PHP(PHP0416)
And a link to the post where they talk about adding it

I saw some options for Intelliphense where you could set "intelephense.diagnostics.undefinedProperties": false
in the vscode settings.json, but I couldn’t find anything that would work for this extension.

The fix described here in the 3rd post to add the property in a comment does work, but is not feasible in the codebases I am working in. I need something more like the second post, where I can just disable the check altogether

2

Answers


  1. Chosen as BEST ANSWER

    I found the answer to my own question. Leaving it here because It took me way too long.

    You just have to exclude the error code, in this case error code 0416


  2. 1 – Open Settings.json : ctrl + shift + P and type ‘settings.json’
    2 – Select ‘Open User Settings (JSON)
    3 – At the end of file, add this code:

    "php.problems.exclude" : {
      "/" : [416],
      "vendor/" : true,
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search