question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

testMate.cpp.debug.configTemplate Setting Shows Incorrect Warning About Missing "Type" Property

See original GitHub issue

Checklist

  • The issue is about this extension and NOT about a fork.
  • Check the known issues list.
  • The latest version of the extension was used.
  • It is not related to remote-vscode or I checked the following issue

Describe the bug

The testMate.cpp.debug.configTemplate setting complains about a missing “type” property in the schema file of settings.json, but the property is not required if it is set to behave differently per platform. For example, our project has this:

  "testMate.cpp.debug.configTemplate": {
    "linux": { "type": "lldb" },
    "osx": { "type": "lldb" },
    "windows": { "type": "cppvsdbg" },
    "program": "${exec}",
    "args": "${argsArray}",
    "cwd": "${cwd}",
    "env": "${envObj}",
    "environment": "${envObjArray}"
  }

This way, we use the VS debugger on Windows and lldb on Linux and OSX. This works functionally without an issue, which is fantastic for our scenario! The only problem is the settings.json file shows a warning: Missing property "type". See the screenshot pasted below.

To Reproduce

Set the testMate.cpp.debug.configTemplate mentioned above.

Screenshots (optional)

image

Desktop

  • Extension Version: v3.6.24
  • VS Code Version: 1.55.2
  • Catch2 / Google Test / DOCTest Version: Google Test - 1.10.0
  • OS Type and Version: Windows 10/Debian
  • Using remote-ssh/docker/wsl?: Local and Docker

Regression bug?

Not that I know of, since this is the first time I’m using the setting 😃

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
matepekcommented, Apr 23, 2021

Okay so I’ve discovered that this platform-specific settings doesn’t work for configTemplate at all. I’m fixing it

2reactions
matepekcommented, Apr 23, 2021

Hello, In theory you are right but… it’s hard to implement in that way. One can silence the value with creating a dummy type value:

Like:

  "testMate.cpp.debug.configTemplate": {
    "type": "<overwritten by platform-specific value>"
    "linux": { "type": "lldb" },
    "osx": { "type": "lldb" },
    "windows": { "type": "cppvsdbg" },
    "program": "${exec}",
    "args": "${argsArray}",
    "cwd": "${cwd}",
    "env": "${envObj}",
    "environment": "${envObjArray}"
  }

Since all the platform versions will overwrite anyway it will work just fine. Other option is to overwrite it on windows only:

   "type": "lldb", 
   "windows": { "type": "cppvsdbg" }

I could make it an optional but (I think) most of my users uses it on only 1 platform and for them the warning is actually helpful.

I will update the documentation. I like that you read it. My effort to write it wasn’t in vain. 😃

If you have other suggestion don’t hold it back 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

vscode-catch2-test-adapter/debug.configTemplate.md at master
It will choose the first one which's "request" property is "launch" and has type property with string value starting with cpp , lldb...
Read more >
C++ TestMate - Visual Studio Marketplace
This extension allows you to run your Catch2, Google Test and DOCtest tests using the native testing vscode-api. It also have basic support...
Read more >
How to set up C++ Testmate in VS Code - Stack Overflow
To troubleshoot #2 and #3 you can turn on debug logging for the extension (again, in the VSCode's config json), this will cause...
Read more >
Debug a C++ project in VS Code - YouTube
This video walks you through the steps to debug a C++ project in Visual Studio Code. Find more "Hello World" tutorials for building...
Read more >
Working with Visual Studio Code — OpenPASS Documentation
Correctly configured Visual Studio Code showing – among other things – left, debugging, testmate, and cmake pane selectors, and at the bottom, build...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found