sandhje / vscode-phpmd

VSCode PHP Mess Detector extension
MIT License
15 stars 4 forks source link

problems to be marked as error #29

Closed JohnstonCode closed 6 years ago

JohnstonCode commented 6 years ago

Can any issues listed by phpmd be listed as errors rather than info in the problems list?

sandhje commented 6 years ago

The extension maps the "priority" of the reported phpmd problems to vscode "severity". By creating a PHPMD ruleset file and setting that in the extension's configuration you can control how the problems are "shown" within vscode. See https://phpmd.org/documentation/creating-a-ruleset.html on how to create a ruleset file and how to set priority for specific rules.

The mapping within the extension is as follows:

PHPMD Priority VSCode severity
1 DiagnosticSeverity.Error
2 DiagnosticSeverity.Warning
3 DiagnosticSeverity.Information
4 DiagnosticSeverity.Hint
5 DiagnosticSeverity.Hint