Open erichlf opened 5 months ago
Currently the logic that determines the devcontainer root folder is here https://github.com/arnaupv/nvim-devcontainer-cli/blob/main/lua/devcontainer_cli/folder_utils.lua#L4-L28
as you can see currently it chooses the longest path, which is the contrary of returning the top level directory. In other words, the devcontainer that is created by the tool depends on the folder where you open neovim.
what do you think about that?
And now I see why it doesn't work for me. This assumes that your top project root is a git repo, which is not the case for me. In fact, my workflow is very typical in ROS/ROS2 development, where you have a workspace with a src
directory which contains your repos. The plugin that I pointed to uses pattern matching to determine the root of the project. In the case of devcontainers this is pretty easy, just look for .devcontainer
.
There might be different ways to choose the .devcontainer and also this should be configurable in the nvim plugin
It would be pretty nice if this could determine the root of the project directory. My project has several git repos below a main workspace like so
So we would want to return the top level directory containing
.devcontainer
. This can be done using telescope projects or possibly a home grown method.