Suggestion: Improve ${workspaceFolder}
variable
#1189
Replies: 2 comments 1 reply
-
You can close and re-open the workspace folder from within vscode too.
Opening a folder is a completely different action than declaring a workspace/project folder. That's way more surprising for people who are used to vim instead of migrating from vscode. I'm not going to make any changes in this direction. |
Beta Was this translation helpful? Give feedback.
-
FYI: After a bit more investigation, I probably go with just environmental variables in "pythonPath": "${env:PROJECT_ROOT}/.venv/bin/python",
"cwd": "..." Setting |
Beta Was this translation helpful? Give feedback.
-
Hi, currently there is some kind of mismatch between VS Code and nvim-dap
${workspaceFolder}
variable. VS Code docs define it as, whereas nvim-dap states
Former is a static directory reference provided as argument to VS Code startup. Latter is a directory, which can change dynamically. Some settings change
cwd
in Neovim, so this might result in surprising errors, when using a debug configuration and${workspaceFolder}
. In this case the only chance is to specify full absolute paths for things likepythonPath
orcwd
, which is suboptimal, as fragile configuration - also when.vscode
is checked in to VCS.What about following:
Check, if
nvim
has been started with an explicit directory as cli argument, e.g. byvim.v.argv
. If so, use argument as "opened folder" for${workspaceFolder}
. Otherwise fall back to Neovim's current working directory for compatibility with status quo.This better aligns with VS Code's definition and creates a more path-stable configuration.
Optional idea for
launch.json
:It would be very nice to have a variable
${vscodeParent}
, which automatically searches for the parent directory of.vscode
(wherelaunch.json
resides in) and possibly traverse the file tree up, until found. Though first suggestion is a much more low-hanging fruit.Beta Was this translation helpful? Give feedback.
All reactions