Replies: 1 comment 1 reply
-
Just to report a bit about my experience. 🎈 I like VSCode to not connect to my Docker containersFor me, it's just my limited time and laziness that make me favor still running VSCode completely separate from my Docker containers. See more details for this rationale
Furthermore, I like browsing through my code and linting it, without having to start up Docker Desktop first. I usually modify and add some code here and there, then realize it'd be nice to interact with the app now, e.g. browse the UI or debug something. That's when I startup Docker Desktop in the background and launch a simple 🎈 I still need some processes to run inside the main app Docker containerBut everything comes with advantages & disadvantages. In this case, well... we cannot use (without added effort) any IDE feature that needs our app's runtime:
So apart from running tests being a bit hacky, I'm fine with the setup; it has proven to work well during the last year. We even run Cypress tests inside a Docker container and forward the UI in WSL 😅 (where WSL nowadays is automatically WSLg, so X11 works out of the box). 🎈 So what?Unfortunately, I don't know how to really derive helpful ideas to improve container support of VSCode / Ruby LSP. Here, you proposed the "socket solution" (see also #1782):
Yes, this could improve our setup (for usage of "server dependent features" and running tests). However, I would then be in a situation where I'd have to start Docker Desktop to get any linting in my IDE, which I would really dislike. For my purpose, a hooking mechanism in Ruby LSP would be great, such that we could get rid of the Ruby Test Explorer extension (which doesn't yet support the native VSCode Test Explorer UI, see here, and which seems a bit abandoned). Such a hook could allow me to execute a custom script that executes the test inside a docker container however I like, then reports the results back. As inspiration, for reporting, the Test extension uses a |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
We have a few issues related to better container support, in particular in complex setups that aren't simply having the editor connect to a single container. For example, a container with multiple projects inside or a container-inside-container situation.
I want to centralize all information into a single place (this discussion) so that we can more easily see the full picture and start deriving concrete tasks from it. From all of the related issues, we need to understand what exactly is the shortcoming with the solution provided by VS Code for more complex container setups.
Related issues/prs: #2223, #3386, #2919, #3586
The current container support
Currently, container support for the Ruby LSP relies entirely on VS Code's container support. This is ideal for extensions because the editor itself handles everything - and it is in a better position to do so.
Connecting to a container means that:
vscode.workspace.fs
APIExtensions do not have to be concerned at all with where they are running. The editor knows where it is running and can abstract away all of the complexity.
What we need to understand
Ideally, we can push for a better solution at the editor level, so that all languages and extensions are benefitted from more elaborate container support. If that's not possible or if the VS Code team is not open to making their integrations more complex, then we need to understand the level of effort involved in rolling out our own version of it.
For example, #3386 proposes customizing the command to launch the language server, but that solution is incomplete as other shell commands we try to run will not be executed within the container. Exactly the same scenario for #3586, which proposes a similar solution that only fixes test related commands.
Someone might then propose allowing all commands to be prefixed by something like
dip
, but none of these would solve the file system API problem and there's simply no way that we can provide rich editor features without the ability of reading a file on the extension side. When invoking allvscode.workspace.fs
APIs, we would end up reading files in the user’s machine instead of the container.Next concrete steps
dip
is easy, but adding our own file system layer on top of VS Code's is definitely not. We would essentially be building the solution that should live in the editor ourselves.Important note: we may still decide to not support certain use cases even after gathering more details. The Ruby LSP is an extension for language support, which is already complex enough without broadening its scope into dealing with containerized environments.
Beta Was this translation helpful? Give feedback.
All reactions