Open timsu92 opened 2 years ago
I apologize for not translating Vim version info as I don't know the exact wordings in English.
Thanks for the report. This is caused because we do the filetype filtering before we do the "extends" expansion. That will require quite some refactoring. For now, I would suggest just copy the filetypes entry from where you're inheriting it from.
Description
If there's another config with
"default": true
andfiletype
is (should be) extended, it will be considered as an execution option even if the extended filetype doesn't match. However, the config with extended filetype works well on the extended filetype.Take the
vimspector.json
provided in Minimal Reproduction for example, debugging a cpp file will be asked to choose from configs, while debugging a python file will debug right away.Works in vim?
Reproducable in Vim
Works with clean config?
Yes
Sample project works?
Reproducable with sample project
Minimal Reproduction
In
vimspector.json
, create 3 configurations:vimspector.json
```json { "$schema": "https://puremourning.github.io/vimspector/schema/vimspector.schema.json#", "configurations": { "launch - C family": { "adapter": "vscode-cpptools", "default": true, "filetypes": [ "cpp", "c", "objc", "rust" ], "configuration": { "type":"cppdbg", "request": "launch", "program": "${workspaceRoot}/a.out", "args": [], "cwd": "${workspaceRoot}", "environment": [], "externalConsole": true, "MIMode": "gdb", "setupCommands": [ { "description": "Enable pretty-printing for gdb", "text": "-enable-pretty-printing", "ignoreFailures": true } ], "stopAtEntry": false }, "breakpoints": { "exception": { "cpp_catch": "N", "cpp_throw": "Y", "all": "Y" } } }, "launch - Python - template":{ "adapter":"debugpy", "filetypes": ["python"], "configuration": { "type": "python", "request": "launch", "console": "externalTerminal", "python": "${PYTHON}" }, "breakpoints": { "exception": { "raised": "N", "uncaught": "Y", "userUnhandled": "Y" } }, "variables":{ "PYTHON":{ "shell": ["which", "python"] } }, "autoselect": false }, "launch - Python - default":{ "extends": "launch - Python - template", "default": true, "configuration": { "cwd": "${workspaceRoot}", "program": "${relativeFile}" } } } } ```In my config, there are two defaults, which are
launch - C family
andlaunch - Python - default
. Inlaunch - C family
,cpp
is declared infilestypes
, whereasfiletypes
oflaunch - Python - default
is extended fromlaunch - Python - template
which containspython
only.Then, debug a
cpp
file using<Plug>VimspectorContinue
, and it asks me which configuration to use.Expected Behaviour
Execute
launch - C family
as it's the only one matches "default" and filetype "cpp".Actual Behaviour
Ask me to execute
launch - C family
orlaunch - Python - default
Additional information
The following log files are got after entering the debug session with config
launch - C family
and on a breakpoint.Installation Type
Plugin Manager (git clone)
Vimspector version
3378018bc1cdd1d9b70734c3e970bc52fd983415
Debug Info
Log file
Vim version
Python version
3.10.4 (main, Jun 29 2022, 12:14:53) [GCC 11.2.0]
Neovim diagnostics
Operating System
Linux LAPTOP-PRJ2HP6O 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Declaration