sdobreff / vscode-php-resolver Goto Github PK
View Code? Open in Web Editor NEWResolves PHP namespaces, PHP buatifier, PHP code standartds,PHP error log monitoring
License: MIT License
Resolves PHP namespaces, PHP buatifier, PHP code standartds,PHP error log monitoring
License: MIT License
Is there a way to automatically use the phpcs.xml file inside the current workspace?
Currently, I have to edit the settings manually if I change to a project that does not use the same standard.
When saving a PHP file with editor.formatOnSave
enabled, php-cs-fixer
runs and fixes the issues it can, but then places the changes into the file after the initial save command. This means any PHP files that still contain errors will show in the editor as an unsaved file.
The only way to save the file as is, is to either close the file and choose save in the dialog box that appears, or use the command pallet to save the file without formatting; both of which trigger an error that is placed in the output console. I think the proper way to handle this would be to sutomatically run php-cs-fixer
, place the resulting code in the file (which is already being done), and then automatically trigger save without formatting so the file does not get stuck in a reformatting loop.
PS: Does your extension or vscode prompt (notify) All fixable errors were resolved
when saving? Could that message be disabled or removed?
Hi there!
I'm excited to see a new extension that might be better than the existing ones :P
After installing the extension and opening a PHP file, I get a phpcs Fatal error occurred
notification, and looking at the extension output I see this:
["INFO" - 4:41:36 PM] Switched to new file - starting code sniffer
["INFO" - 4:41:36 PM] phpcs - Dispose diagnostic collection
["INFO" - 4:41:36 PM] phpcs - The document URI file:///<some_redacted_path>/src/Bootstrap.php
["INFO" - 4:41:36 PM] phpcs - Extracting standards from the configuration
["INFO" - 4:41:36 PM] phpcs - Spawning the command with parameters - -q - --report=json --standard=
["INFO" - 4:41:36 PM] phpcs - Writing the extracted file content to the stdin
["INFO" - 4:41:36 PM] phpcs - No data received - exit
["INFO" - 4:41:36 PM] phpcs - Collecting the output finished starting parsing
["ERROR" - 4:41:36 PM] phpcs - Failed collecting proper output - Unexpected end of JSON input
["INFO" - 4:41:36 PM] phpcs - Received -
As soon as I updated the paths to phpcs
and phpcbf
in the extension settings the error went away, so the "problem" is more like "the error message didn't accurately indicate what's wrong".
Seems like this could be resolved in a few ways:
phpResolver.phpSnifferCommand
and force the user to configure it before it does anythingphpcs
or ./vendor/bin/phpcs
Cheers!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.