when I hit F1 and use >Composer: remove package in my project, I cannot see my installed packages. I suppose the reason is my composer.json file is not situated in the root directory of my project. Is there a setting file that I can edit and set my composer.json directory? Similar thing happens when I use composer require. It creates composer.json, composer.lock and vendor folder in the project's root. But I have these files in another folder. I am using latest version of Visual Studio Code and Devsense's Composer extension is up-to-date.

cagatay117 Thank you for the question!

Currently, our extension expects composer.json in the root of the workspace folder.

We'll add a setting "composer.workingPath" to specify that! It will be available within the next update.

Implemented, will be in the next update.

Thank you!

You are awesome! Thank you @JakubMisek . (Please add this feature in the details section of the extension page as well.)

I updated my extension but I get error. My path contains spaces and I get error in the terminal that the path does not exist. I had to wrap the path with single quotes for it to work when I use the terminal manually. Maybe the problem is something like that. Can you have a look at it?
Edit: Oh I got it, it seems the path should be relative, not full path. It works now. Please show the users how to specify workingPath in the details section of the extension page.

cagatay117 Thank you for trying this so quickly!

Good point, we'll add the information into the readme.

Please let me know anytime if there is anything else we can improve.

a year later

Where does one add this setting? Are there more specific details on how to set this up?

JacobScharff The working directory is usually determined automatically.

To explicitly set the working path, use the setting "composer.workingPath".

    JacobScharff There is usually a single setup step. Please see Configuration section at https://marketplace.visualstudio.com/items?itemName=DEVSENSE.composer-php-vscode.

    The extension automatically downloads composer.phar latest snapshot, and uses it. The location respects the Composer default installation path which can be changed by setting the COMPOSER_HOME environment variable.
    The extension uses PHP executable picked using Version Picker

      Write a Reply...