Compare commits
1 commit
master
...
windows_do
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
047de9bf96 |
2 changed files with 9 additions and 2 deletions
|
|
@ -88,7 +88,6 @@ fn test_parsing_with_logging() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(unix)]
|
|
||||||
fn test_parsing_with_debug_graph_enabled() {
|
fn test_parsing_with_debug_graph_enabled() {
|
||||||
use std::io::{BufRead, BufReader, Seek};
|
use std::io::{BufRead, BufReader, Seek};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1386,6 +1386,11 @@ impl Drop for Parser {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(windows)]
|
||||||
|
extern "C" {
|
||||||
|
fn _open_osfhandle(osfhandle: isize, flags: core::ffi::c_int) -> core::ffi::c_int;
|
||||||
|
}
|
||||||
|
|
||||||
impl Tree {
|
impl Tree {
|
||||||
/// Get the root node of the syntax tree.
|
/// Get the root node of the syntax tree.
|
||||||
#[doc(alias = "ts_tree_root_node")]
|
#[doc(alias = "ts_tree_root_node")]
|
||||||
|
|
@ -1495,7 +1500,10 @@ impl Tree {
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
{
|
{
|
||||||
let handle = file.as_raw_handle();
|
let handle = file.as_raw_handle();
|
||||||
unsafe { ffi::ts_tree_print_dot_graph(self.0.as_ptr(), handle as i32) }
|
unsafe {
|
||||||
|
let fd = _open_osfhandle(handle as isize, 0);
|
||||||
|
ffi::ts_tree_print_dot_graph(self.0.as_ptr(), fd);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue