Closed swaldhoer closed 9 months ago
I also have no TypeScript/JavaScript experience or experience writing VSCode extensions. Looking through the source I think the solution is to just add a command in the main.ts and then some changes in the adapter.ts.
Again no idea what I'm doing but as a temporary hack I changed the files in extension directly located in C:\Users\<user>\.vscode\extensions\numaru.vscode-ceedling-test-adapter-1.10.1\out\src
to the attached files, problemMatcher.js didn't need to be changed.
src.zip
From there I edited the launch.json program line to:
"program": "${workspaceFolder}/tools/ceedling/build/test/out/${command:ceedlingExplorer.testFileName}/${command:ceedlingExplorer.debugTestExecutable}",
This is an extreme hack but I have no idea how to edit the source code to produce a vscode extension. There must be some "compile" process that takes the typescript source in the repo and converts it to javascript. I live in embedded C so this is quite a different environment to me. Anyway hope this helps you and I'm sure anyone who knows what they're doing could quickly submit a pull request with the fix.
@cwilliamson-bti Does ${command:ceedlingExplorer.testFileName}
for a file test_abc.c
resolve to
test_abc
or to
test_abc.c
?Based on this code snippet
I assume, that ${command:ceedlingExplorer.testFileName}
resolves to test_abc
.
Then the solution to this issue is to just set the workspace specific path correctly, i.e., to something like this:
{
"name": "Ceedling Test Explorer Debug",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/test/out/${command:ceedlingExplorer.testFileName}/${command:ceedlingExplorer.debugTestExecutable}",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "C:/MinGW/bin/gdb.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
@cwilliamson-bti so there is no reason to change the extension installation, it can just be fixed in the workspace local settings.
The setting described above works so I am closing this issue.
The output directory structure of Ceedling will change:
0.31.1
|./test/out/${command:ceedlingExplorer.debugTestExecutable}
0.32.0
|./test/out/${test_file_name_without_extension}/${command:ceedlingExplorer.debugTestExecutable}
This means, if you have a test
test_my_test_abc.c
thedebugTestExecutable
path changes to./test/out/test_my_test_abc/${command:ceedlingExplorer.debugTestExecutable}
This is a crucial update for us, although I have no TypeScript/JavaScript experience, if you could point me to the code where this needs to be fixed, I would try to prepare a Pull request.