Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to turn off warnings while debugging in VS Code?

I'm debugging a PHP app in VS Code using XDebug(PHP Debug extension) and getting errors like:

VS Code PHP debugging error

I understand what the problem is and how to fix it, but the solution is so huge, that fixing such an errors is something I can't do at the moment.

I want to start using VS Code for PHP development. I was using Visual Studio with "PHP Tools for Visual Studio" and didn't have this problem.

In the first script which is loaded when the request occurs, I have error_reporting(E_ALL^E_WARNING^E_NOTICE);, which should suppress such an errors. But it seems that the VS Code debugger ignores it. I didn't find any setting for PHP Debug which could help me with this.

Is there any way how to tell VS Code Debugger to ignore/not display such errors?

like image 881
Skorunka František Avatar asked Aug 31 '18 15:08

Skorunka František


People also ask

How do I get rid of warnings in VS Code?

Use a preprocessor directiveUse a #pragma warning (C#) or Disable (Visual Basic) directive to suppress the warning for only a specific line of code.

How do I turn off errors in Visual Studio?

Turn off the warning for a project in Visual StudioSelect the Configuration Properties > C/C++ > Advanced property page. Edit the Disable Specific Warnings property to add 4996 . Choose OK to apply your changes.

How do you get rid of the red dot in VS Code?

Search for debug in settings, disable "glyph margin", and all related settings, this will disable the option to make debugging dots, if you just want to remove them all but not disable adding them, use the answers above.


1 Answers

It is possible to set where debugger stops in "Debug / Breakpoints" panel or VS Code:

enter image description here

like image 179
Skorunka František Avatar answered Sep 19 '22 18:09

Skorunka František