mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 14:21:16 +00:00
Prepare the compiler to be async
This will allow the online editor to load imports from URL asynchroniously later Since currently the compiler is only working on a single thread, and that we never await on a future that could block, it is allowed to use the spin_on executor
This commit is contained in:
parent
a7abfea961
commit
359f42c5f7
22 changed files with 110 additions and 89 deletions
|
@ -331,9 +331,9 @@ pub fn sixtyfps(stream: TokenStream) -> TokenStream {
|
|||
let syntax_node = parser::SyntaxNodeWithSourceFile { node: syntax_node, source_file };
|
||||
|
||||
//println!("{:#?}", syntax_node);
|
||||
let compiler_config =
|
||||
CompilerConfiguration { include_paths: &include_paths, ..Default::default() };
|
||||
let (root_component, mut diag) = compile_syntax_node(syntax_node, diag, &compiler_config);
|
||||
let compiler_config = CompilerConfiguration { include_paths, ..Default::default() };
|
||||
let (root_component, mut diag) =
|
||||
spin_on::spin_on(compile_syntax_node(syntax_node, diag, compiler_config));
|
||||
//println!("{:#?}", tree);
|
||||
if diag.has_error() {
|
||||
diag.map_offsets_to_span(&tokens);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue