-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add .natvis for MSVC debug view #844
Conversation
Just out of curiosity: does the .natvis file must be put into the src directory? |
No, the .natvis can be everywhere. I.e. the outcome library from ned14 puts it into include dir, GSL from Microsoft puts it into root. |
Checked the build error. Its only on one Mac machine. This restriction is gone with cmake v3.3. possible ad-hoc solutions:
I don't know what you prefer (or, if nothing, discard the PR). Edit: CMake Error Message from the machine:
and CMake fails. Therefore it is the error mentioned above. |
Can one of the admins verify this patch? |
added compiler & cmake version check. For non MSVC-Version, the .natvis file is not needed and I guess it's a good idea no not install it on these system. When I already implemented a condition, I see no problem in adding a version check. |
src/json.natvis
Outdated
</Expand> | ||
</Type> | ||
|
||
</AutoVisualizer> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please move this file to the root? I do not want to confuse people that have no idea what a .natvis
file is. I may clean up the repo and come up with a misc
folder or something, but right now, the root would be fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure,
had to edit the install procedure for it.
Its now in the root dir and will be installed to the root dir /install-prefix dir.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Thanks a lot! |
This PR adds a .natvis improving the debug view of
nlohmann::basic_json
in the MSVC GUI.Also, included the ..natvis file into CMake install process.
The supported container types for the template arguments
object
andarray
are generic and the container's .natvis will be shown (if declared).Here is an example view from the readme test (MSVC2017):
There is also a name bug in the CMakeLists for tests. I did not created a second issue, since it's just the name-prefix which is missing.
I can create a new pull request if you want or you can fix it on your own. (its the first commit).