Skip to content
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

Doesn't seem to work in dev containers #121

Open
Lindsay-Needs-Sleep opened this issue Mar 14, 2023 · 4 comments
Open

Doesn't seem to work in dev containers #121

Lindsay-Needs-Sleep opened this issue Mar 14, 2023 · 4 comments

Comments

@Lindsay-Needs-Sleep
Copy link

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).

@calebcartwright
Copy link
Member

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?

@Lindsay-Needs-Sleep
Copy link
Author

Lindsay-Needs-Sleep commented Mar 15, 2023

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)

@calebcartwright
Copy link
Member

calebcartwright commented May 12, 2023

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:

workspace.workspaceFolders.forEach(f =>

watcher.generateFileSystemWatcher({

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

@calebcartwright
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants