junstyle / vscode-php-cs-fixer

PHP CS Fixer extension for VS Code
https://marketplace.visualstudio.com/items?itemName=junstyle.php-cs-fixer
MIT License
357 stars 45 forks source link

Case insensitive class #167

Open cretueusebiu opened 2 years ago

cretueusebiu commented 2 years ago

When creating a file Testclass.php and then renaming it to TestClass.php, the extension will rename the class back to Testclass.

bandicam 2022-01-10 14-31-52-815

When running php php-cs-fixer.phar fix TestClass.php it will rename the class to TestClass (the correct way).
So I guess it's a problem with the extension.

This is related to the psr_autoloading rule which I have it set to true.

Is there a cache file maybe I can delete ?

junstyle commented 2 years ago

you can open developer tools to check the args, menu: help -> toggle developer tools

last item of the array is filepath, this filepath got from activeTextEditor.document.uri.fsPath, no cache

cretueusebiu commented 2 years ago

It looks like vscode still reads the file in lowercase even though it the sidebar and Windows Explorer it's renamed. I've cleared the vscode editor and command history, disk cleanup, even restarted my PC.

Screenshot_1

innocenzi commented 2 years ago

I had this issue, and the solution for me was to clear the workspace cache in ~/Library/Application Support/Code/User/<workspaceStorage>.

There is this extension that does it for you in case the naming issue appears again.