Skip to content

Formatting glitches with unset() #518

@SharakPL

Description

@SharakPL

I use your extension as a formatter like this:

  "[php]": {
    "editor.tabSize": 4,
    "editor.formatOnSave": true,
    "files.insertFinalNewline": true,
    "editor.codeActionsOnSave": {
      "source.fixAll": "explicit"
    },
    "editor.defaultFormatter": "DEVSENSE.phptools-vscode"
  },

But it looks like it can't handle unset() properly.
It won't format this (other functions are formatted properly at this state):
obraz

Expected is this:
obraz

But when I format it myself and save, it reformats the code to this:
obraz

Does the extension implement all the psr-12 standards properly?
Can it handle project standards eg. .php-cs-fixer.dist.php in project root?

Would be much better if it showed specific rules that are not met by the code and will trigger formatting on save. Just like stylelint or eslint do it in VSCode's Problems tab, eg.:

obraz

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions