TaKo
TaKo

Reputation: 449

PHP Intelephense does not recognize PHPMailer and PhpSpreadsheet in Visual Studio Code (VS Code) project

I have been working on a project for months now and all worked just fine. But now I am suddenly experiencing error in my IDE (Visual Studio Code) produced by PHP Intelephense showing:

> Undefined type 'PHPMailer\PHPMailer\PHPMailer' 
> Undefined type 'PhpOffice\PhpSpreadsheet\Spreadsheet'

enter image description here

I imagine the error must be somehow PHP Intelephense related because I can execute the PHP project without errors and both PHPMailer and Spreadsheet works fine. However, I am frustrated for the IDE errors, which do not exist.

I have tried all this but no success:

enter image description here

enter image description here

Create a new directory for the project. Initialize Composer and install the packages:

None of that solved the issue in my case.

Upvotes: 0

Views: 296

Answers (1)

TaKo
TaKo

Reputation: 449

according to @shigo the solution to my problem is:

before intelephense.files.exclude edit: before edit

after intelephense.files.exclude edit: after edit

Upvotes: 0

Related Questions