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

Feature - Only format modified text #3111

Closed
shivapoudel opened this issue Sep 10, 2020 · 4 comments
Closed

Feature - Only format modified text #3111

shivapoudel opened this issue Sep 10, 2020 · 4 comments

Comments

@shivapoudel
Copy link

VSCode 1.49.0 comes with setting the only format modified text using the setting "editor.formatOnSaveMode": "modifications",. Do PHPCBF come with a setting to format only the modified area of the file?

@gsherwood
Copy link
Member

Use can use the --filter=gitmodified CLI arg to only format files that have modifications, but there is no feature to format just the lines that have been modified. This often doesn't make sense for the sniffs as they may generate errors on lines that have not changed, but the errors are caused by changes that were made elsewhere in the file.

@shivapoudel
Copy link
Author

shivapoudel commented Sep 16, 2020

I was talking about to adapt this VSCode feature https://code.visualstudio.com/updates/v1_49#_only-format-modified-text in its PHPCS extension valeryan/vscode-phpsab#31

Thanks @gsherwood

@valeryan
Copy link

My vscode extension does not have any association with phpcs beyond utilizing it. I assume this issue would be better handled on my extension. @gsherwood I would close this...

@gsherwood
Copy link
Member

Good discussion, but closing as this is not something that is going to be handled at the PHPCS level.

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

3 participants