Skip to content

Commit

Permalink
Natvis cleanup following the windows-result crate split (#2853)
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-weis authored Feb 17, 2024
1 parent b62b802 commit a9b594b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
<Type Name="windows_core::array::Array&lt;*&gt;">
<DisplayString>{{ len={len} }}</DisplayString>
Expand All @@ -11,17 +12,6 @@
</Expand>
</Type>

<Type Name="windows_result::error::Error">
<Expand>
<ExpandedItem>code</ExpandedItem>
<Item Name="[info]">info</Item>
</Expand>
</Type>

<Type Name="windows_result::hresult::HRESULT">
<DisplayString>{(HRESULT)__0}</DisplayString>
</Type>

<Type Name="windows_core::imp::ref_count::RefCount">
<DisplayString>{__0}</DisplayString>
</Type>
Expand Down
2 changes: 1 addition & 1 deletion crates/libs/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Learn more about Rust for Windows here: <https://github.com/microsoft/windows-rs

#![doc(html_no_source)]
#![allow(non_snake_case)]
#![cfg_attr(windows_debugger_visualizer, debugger_visualizer(natvis_file = "../windows.natvis"))]
#![cfg_attr(windows_debugger_visualizer, debugger_visualizer(natvis_file = "../natvis/windows-core.natvis"))]

extern crate self as windows_core;

Expand Down
13 changes: 13 additions & 0 deletions crates/libs/result/natvis/windows-result.natvis
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
<Type Name="windows_result::error::Error">
<Expand>
<ExpandedItem>code</ExpandedItem>
<Item Name="[info]">info</Item>
</Expand>
</Type>

<Type Name="windows_result::hresult::HRESULT">
<DisplayString>{(HRESULT)__0}</DisplayString>
</Type>
</AutoVisualizer>
5 changes: 5 additions & 0 deletions crates/libs/result/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
Learn more about Rust for Windows here: <https://github.com/microsoft/windows-rs>
*/

#![cfg_attr(
windows_debugger_visualizer,
debugger_visualizer(natvis_file = "../natvis/windows-result.natvis")
)]

mod bindings;
use bindings::*;

Expand Down

0 comments on commit a9b594b

Please sign in to comment.