-
Notifications
You must be signed in to change notification settings - Fork 13
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
Single File Error #123
Comments
Hey @jacobcassidy. I think it should work so I would call it a bug. I will have to look at the behavior but off the top of my head the reason will probably be that the vscode api that is used by the extension is only looking for workspace. More than likely with a single file the workspace is not present, breaking the extension. We will have to look at the behavior and see if that can be addressed. |
I was able to replicate this by selecting a single file in my file explorer, opening it with VS Code, and running the I'll run this through the development version of the extension later today, and report back any findings. |
@jonathanbossenger has there been any findings on this one? I too am receiving the same error recently. |
Installed today this extension in VSC and get the same error |
Yes, this is a confirmed error. The extension uses VSCode's workspace API to access files and relies heavily on files in directory to work and none of that is available when VSCode is in single file mode. The extension requires composer and xml configuration files, and directory access, etc. at minimum it can handle this error gracefully and inform better why it doesn't work. If I have time to work on this I might get single file mode working but it will require global compose setup, and a global ruleset, etc. |
@valeryan For now, maybe if we just add a note in the readme that this only works when opening PHP files in a directory? |
@valeryan I am also getting this error, even when running inside a workspace. Linting works, formatting does not work. |
When opening a single PHP file in VSCode, running the
PHPCBF: Fix this file
command results in the following error:command 'fixer.fix' not found
. The linter (phpcs) also does not work on single files. The following is logged in the output panel:All works as intended when adding a folder with the file in it to VSCode.
Is this the intended behavior, or is there a bug when not using project folders?
The text was updated successfully, but these errors were encountered: