Skip to content
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

Fix error source; free leaked allocations; fix refcounting; BSTR is wide, not UTF-8; convert return_hr to expression #10

Merged
merged 7 commits into from
Nov 10, 2020
5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ widestring = "0.4.2"
thiserror = "1.0"

[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3.9", features = ["wtypes", "oleauto"] }
winapi = { version = "0.3.9", features = ["wtypes", "oleauto", "combaseapi"] }

[target.'cfg(not(windows))'.dependencies]
libc = "0.2"

[dev-dependencies]
rspirv = "0.6.0"
14 changes: 14 additions & 0 deletions examples/intellisense-tu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ fn main() {

let name = cursor.get_display_name().unwrap();
println!("Name {:?}", name);
assert_eq!(name, "copy.hlsl");

let cursor_kind = cursor.get_kind().unwrap();
println!("CursorKind {:?}", cursor_kind);
Expand All @@ -42,6 +43,19 @@ fn main() {

let child_cursors = cursor.get_all_children().unwrap();

assert_eq!(
child_cursors[0].get_display_name(),
Ok("g_input".to_owned())
);
assert_eq!(
child_cursors[1].get_display_name(),
Ok("g_output".to_owned())
);
assert_eq!(
child_cursors[2].get_display_name(),
Ok("copyCs(uint3)".to_owned())
);

for child_cursor in child_cursors {
let range = child_cursor.get_extent().unwrap();
println!("Child Range {:?}", range);
Expand Down
Loading