Update: 2024-10-15

This commit is contained in:
2024-10-15 20:59:39 +03:00
parent 89989c222f
commit 814425e4b7
41 changed files with 1044 additions and 546 deletions

View File

@@ -11,18 +11,89 @@ local c = ls.choice_node
ls.add_snippets("python", {
s(
"main",
"logger",
fmt(
[[
def main() -> None:
{}
if __name__ == "__main__":
main()
import logging
logger = logging.getLogger(__name__)
]],
{}
)
),
s(
"dbg",
fmt(
[[
logger.debug({})
]],
{
i(1, "pass"),
i(0),
}
)
),
s(
"info",
fmt(
[[
logger.info({})
]],
{
i(0),
}
)
),
s(
"warn",
fmt(
[[
logger.warning({})
]],
{
i(0),
}
)
),
s(
"err",
fmt(
[[
logger.error({})
]],
{
i(0),
}
)
),
s(
"exc",
fmt(
[[
logger.exception({})
]],
{
i(0),
}
)
),
s(
"crit",
fmt(
[[
logger.critical({})
]],
{
i(0),
}
)
),
s(
"fatal",
fmt(
[[
logger.fatal({})
]],
{
i(0),
}
)
),

View File

@@ -37,7 +37,6 @@ ls.add_snippets("rust", {
{}
)
),
s("pd", fmt([[println!("{}: {{:?}}", {});]], { same(1), i(1) })),
s(
"dead",
fmt(
@@ -48,17 +47,98 @@ ls.add_snippets("rust", {
)
),
s(
"some",
"component",
fmt(
[[
if let Some({}) = torrent.{}{{
torrent_fields.push({}.to_string());
}}
#[derive(Debug, Reflect, Component)]
#[reflect(Component)]
struct {}
]],
{
i(1),
}
)
),
s(
"event",
fmt(
[[
#[derive(Debug, Event)]
struct {}
]],
{
i(1),
}
)
),
s(
"resource",
fmt(
[[
#[derive(Debug, Default, Reflect, Resource)]
#[reflect(Resource)]
struct {}
]],
{
i(1),
}
)
),
s(
"schedule",
fmt(
[[
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, ScheduleLabel)]
struct {}
]],
{
i(1),
}
)
),
s(
"states",
fmt(
[[
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default, States)]
enum {} {{
#[default]
{}
}}
]],
{
i(1),
i(2),
}
)
),
s(
"systemset",
fmt(
[[
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, SystemSet)]
enum {} {{
{}
}}
]],
{
i(1),
i(2),
}
)
),
s(
"plugin",
fmt(
[[
use bevy::prelude::*;
pub(super) fn plugin(app: &mut App) {{
{}
}}
]],
{
same(1),
i(1),
same(1),
}
)
),