mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-10 06:34:20 +00:00
Fix autocomplete in rsx (#2794)
This commit is contained in:
parent
eeccb741d3
commit
4c0fefbcb9
1 changed files with 20 additions and 20 deletions
|
@ -151,26 +151,6 @@ impl ToTokens for TemplateBody {
|
||||||
const NORMAL: &str = dioxus_core::const_format::str_replace!(PATH, '\\', "/");
|
const NORMAL: &str = dioxus_core::const_format::str_replace!(PATH, '\\', "/");
|
||||||
dioxus_core::const_format::concatcp!(NORMAL, ':', line!(), ':', column!(), ':', #index)
|
dioxus_core::const_format::concatcp!(NORMAL, ':', line!(), ':', column!(), ':', #index)
|
||||||
};
|
};
|
||||||
#[cfg(not(debug_assertions))]
|
|
||||||
{
|
|
||||||
#[doc(hidden)] // vscode please stop showing these in symbol search
|
|
||||||
static ___TEMPLATE: dioxus_core::Template = dioxus_core::Template {
|
|
||||||
name: ___TEMPLATE_NAME,
|
|
||||||
roots: &[ #( #roots ),* ],
|
|
||||||
node_paths: &[ #( #node_paths ),* ],
|
|
||||||
attr_paths: &[ #( #attr_paths ),* ],
|
|
||||||
};
|
|
||||||
|
|
||||||
// NOTE: Allocating a temporary is important to make reads within rsx drop before the value is returned
|
|
||||||
#[allow(clippy::let_and_return)]
|
|
||||||
let __vnodes = dioxus_core::VNode::new(
|
|
||||||
#key_tokens,
|
|
||||||
___TEMPLATE,
|
|
||||||
Box::new([ #( #dynamic_nodes ),* ]),
|
|
||||||
Box::new([ #( #dyn_attr_printer ),* ]),
|
|
||||||
);
|
|
||||||
__vnodes
|
|
||||||
}
|
|
||||||
#[cfg(debug_assertions)]
|
#[cfg(debug_assertions)]
|
||||||
{
|
{
|
||||||
// The key is important here - we're creating a new GlobalSignal each call to this
|
// The key is important here - we're creating a new GlobalSignal each call to this
|
||||||
|
@ -192,6 +172,26 @@ impl ToTokens for TemplateBody {
|
||||||
__dynamic_value_pool.render_with(__template_read)
|
__dynamic_value_pool.render_with(__template_read)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
#[cfg(not(debug_assertions))]
|
||||||
|
{
|
||||||
|
#[doc(hidden)] // vscode please stop showing these in symbol search
|
||||||
|
static ___TEMPLATE: dioxus_core::Template = dioxus_core::Template {
|
||||||
|
name: ___TEMPLATE_NAME,
|
||||||
|
roots: &[ #( #roots ),* ],
|
||||||
|
node_paths: &[ #( #node_paths ),* ],
|
||||||
|
attr_paths: &[ #( #attr_paths ),* ],
|
||||||
|
};
|
||||||
|
|
||||||
|
// NOTE: Allocating a temporary is important to make reads within rsx drop before the value is returned
|
||||||
|
#[allow(clippy::let_and_return)]
|
||||||
|
let __vnodes = dioxus_core::VNode::new(
|
||||||
|
#key_tokens,
|
||||||
|
___TEMPLATE,
|
||||||
|
Box::new([ #( #dynamic_nodes ),* ]),
|
||||||
|
Box::new([ #( #dyn_attr_printer ),* ]),
|
||||||
|
);
|
||||||
|
__vnodes
|
||||||
|
}
|
||||||
};
|
};
|
||||||
tokens.append_all(quote! {
|
tokens.append_all(quote! {
|
||||||
dioxus_core::Element::Ok({
|
dioxus_core::Element::Ok({
|
||||||
|
|
Loading…
Reference in a new issue