Closed inf0dr0id closed 7 months ago
This is probably due to the changes introduced in https://github.com/ddev/ddev/pull/5771
Looks like the vscode ddev plugin needs to just generate the .vscode/tasks.json
file from the one found on the Ddev docs site.
https://ddev.readthedocs.io/en/latest/users/snippets/tasks.json
The extension does create the tasks.json file with the required configuration. https://share.cleanshot.com/Yvx20vp7
For now this process happens when the workspace is opened, in a future version we implement more checks when the project is started, restarted, etc.
In this case, I'll need help from you to get more information as I'm not able to replicate it. In VS Code, open the command palette and type "Toggle Developer Tools", inside that window use (cmd+r on Mac or controls+r on windows?) to reload VS Code and check for any possible errors.
You're right, there are errors right away. I've disabled all other extension created a new folder with a fresh ddev config and freshly installed the DDEV Manager extension v2.2.0 after completely deleting it from the local extensions folder. I'm using VSCodium 1.87.2.
Please let me know if this helps or if you need further information.
Hi @inf0dr0id thank's for the information, probably something changed in the VS Code API in a recent update, I'm running 1.86.1
As soon as I've some free time I'll take a look at this.
@inf0dr0id Well, I just upgraded to VS Code 1.87.2 and everything is working, not sure if related to VSCodium or something related to your workspace. The extension uses the VS Code API to read and update the tasks.json and launch.json files.
I'll try VSCodium when I've some free time, in the meantime can you let me know if your workspace has multiple root folders? https://code.visualstudio.com/docs/editor/multi-root-workspaces
@biati-digital No multiple roots. Quick test with official VSCode 1.87.2 shows same issue.
@inf0dr0id thank's for checking, can you please try this version?
@biati-digital
@inf0dr0id Ok, I'm not able to replicate this error so it will take more time. I'm currently busy but hopefully in a few days i'll be able to take a look at this.
I don't know if this context helps, but this issue happened to me when I opened a project where I had created the launch.json file manually some time ago following the old Ddev docs, before I started using the vscode ddev extension, and also before I contributed the changes that introduced the xdebug tasks into the launch.json file.
The behavior I saw after opening the vscode project was that the launch.json was updated automatically by the extension but that the tasks.json file that wasn't there before didn't get created.
I have this issue with our without a launch.json already there. The launch.json is created/updated correctly.
A test on two other machines, one was freshly installed, showed the same errors in the console. Maybe some missing dependencies which a VSCode extension developer has installed?
@jameswilson probably not be related, in fact the code to create/update the launch.json file is the same as the code to create/update tasks.json file except for 1 line.
@inf0dr0id There are no external dependencies; all the required code is bundled with the extension when published. The only "external dependency" is DDEV. The tasks and launch files are created/updated using only the VS Code API. From your screenshots I can see that the API is not returning the tasks, in all the tests I did even if the tasks file didn't exists it returned an object. Not sure if it has something to do with user level task or some other config. Anyway, I'll rewrite that part.
After some tests the problem was with user level tasks, I had an empty tasks file in ~/Library/Application Support/Code/User/tasks.json and because of that when using workspace.getConfiguration('tasks')
I was receiving an empty object instead of undefined, when I removed that file I was able to replicate the issue.
@inf0dr0id please update the extension to 2.3.1 (from the extensions marketplace) and let me know if it's working.
@biati-digital Great, it's working now. Thank you.
Awesome, I'll close this issue now.
I'm not sure if this is a bug or just a problem on my system?
When DDEV Manager creates the launch.json with "preLaunchTask": "DDEV: Enable Xdebug" and "postDebugTask": "DDEV: Disable Xdebug" it does not create the tasks.json and I'm getting the following error when launching "Listen for Xdebug":
To Reproduce Steps to reproduce the behavior (at least on my system):
Expected behavior The tasks for preLaunchTask and postDebugTask should be created in tasks.json.
Cheers
System: