Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format on save not working with native editor.formatOnSave option #5

Open
majjara-a-sharkawy opened this issue May 13, 2024 · 1 comment

Comments

@majjara-a-sharkawy
Copy link

Hello Tarik

As the title demonstrates the problem is the the php-imports.formatOnSave option is not working when the native editor.formatOnSave option is enabled

@majjara-a-sharkawy
Copy link
Author

I have fixed the issue with these keybindings

{
    "key": "ctrl+s",
    "command": "runCommands",
    "args": {
      "commands": ["vscode-php-imports.format", "workbench.action.files.save"]
    },
    "when": "editorLangId == php"
  },
  {
    "key": "shift+alt+f",
    "command": "runCommands",
    "args": {
      "commands": ["vscode-php-imports.format", "editor.action.formatDocument"]
    },
    "when": "editorHasDocumentFormattingProvider && editorTextFocus && !editorReadonly && !inCompositeEditor && editorLangId == php"
  }

I hope this is useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant