vscode-workspace-config-plus icon indicating copy to clipboard operation
vscode-workspace-config-plus copied to clipboard

Doesn't seem to work in dev containers

Open Lindsay-Needs-Sleep opened this issue 2 years ago • 4 comments
trafficstars

First, this is awesome!

Sadly it appears to not work when running inside a dev container. (Basically a docker instance.)

This might be too much of an edge case, but if you have any advice ideas on how I could diagnose this more that would be awesome!

Behavior:

  • I make changes to tasks.shared.json, and tasks.json is not updated

Running Windows, with my linux dev container (a Docker Container) run via WSL2.

Theoretically it should be possible for it to work I think. The editorconfig extension works within the devcontainer (it detects file changes on save and rewrites the file with correct styling).

Lindsay-Needs-Sleep avatar Mar 14 '23 02:03 Lindsay-Needs-Sleep

Thanks for sharing. Few cursory questions:

  • What version of Windows are you running?
  • Are you launching VS Code from a traditional Windows context (e.g. Command Prompt, Explorer, etc.), or from a WSL terminal?

calebcartwright avatar Mar 14 '23 13:03 calebcartwright

windows 10 I'm launching vscode from windows (just tried launching VsCode from WSL to see if it made a difference. No dice.)

Double checked that I do indeed have the extension installed in my dev container "Extension is enabled on 'Dev Container: Docker from Docker Compose'"


I have no experience with vscode development, but I know there is a developer tools, can I debug the extension from there? (Or would I have to install / work from the source?)

Maybe I could find out if it's not able to detect the file changes... Maybe due to file paths. I believe the devcontainer mounts my workspace folder as a docker volume. (my workspace folder is in the windows file system and not WSL)

idea/thought dump (shots in the dark xD): (I ran into some other issues with running a sibling docker container from the devcontainer because it needed the windows' paths and not the docker container path to my workspace folder. Maybe it's something similar-ish... The devcontainer provides a handy env variable that contains the windows workspace path: LOCAL_WORKSPACE_FOLDER, possibly if the extension checked if that exists and monitored that directory? Though that is not a very pretty solution... xD)

Lindsay-Needs-Sleep avatar Mar 15 '23 08:03 Lindsay-Needs-Sleep

Yeah, file system issues between windows and wsl was my first troubleshooting guess. You've probably already gone through this but sharing for posterity: https://code.visualstudio.com/docs/devcontainers/tips-and-tricks.

I think the easiest way to troubleshoot is probably to just clone this repo, open it up in VS Code and then use the launch configuration that's included in this repository. That will launch a new VS Code instance enabled with source debugging enabled, so you should be able to set breakpoints (in the initial/original VS Code instance)

As a starting point I'd recommend dropping breakpoints at the below locations:

https://github.com/swellaby/vscode-workspace-config-plus/blob/194868fe1f2a01bb09794646c129971f70bfe44a/src/index.js#L35

https://github.com/swellaby/vscode-workspace-config-plus/blob/194868fe1f2a01bb09794646c129971f70bfe44a/src/lib.js#L28

And be sure to inspect the locals pointing to the watched files

calebcartwright avatar May 12 '23 00:05 calebcartwright

Also, maybe you need to make sure the confg+ extension is installed inside your container? https://code.visualstudio.com/docs/devcontainers/containers#_managing-extensions

calebcartwright avatar May 12 '23 00:05 calebcartwright