1
1
{
2
- // Place your warframe workspace snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
3
- // description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
4
- // is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
5
- // used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
6
- // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
7
- // Placeholders with the same ids are connected.
8
- // Example:
9
- "Test a model (RTObj)" : {
10
- "scope" : " rust" ,
11
- "prefix" : " model_test" ,
12
- "body" : [
13
- " #[cfg(test)]"
14
- " mod test {"
15
- " use super::${1:model};"
16
- " use crate::worldstate::{client::Client, error::ApiError};"
17
- " "
18
- " #[cfg(not(feature = \" multilangual\" ))]"
19
- " #[tokio::test]"
20
- " async fn test_${1/(.*)/${1:/downcase}/}() -> Result<(), ApiError> {"
21
- " let client = Client::new();"
22
- " "
23
- " match client.fetch::<${1:model}>().await {"
24
- " Ok(_${1/(.*)/${1:/downcase}/}) => Ok(()),"
25
- " Err(why) => Err(why),"
26
- " } "
27
- " } "
28
- " "
29
- " #[cfg(feature = \" multilangual\" )]"
30
- " #[tokio::test]"
31
- " async fn test_${1/(.*)/${1:/downcase}/}_ml() -> Result<(), ApiError> {"
32
- " use crate::worldstate::prelude::Language;"
33
- " "
34
- " let client = Client::new();"
35
- " "
36
- " match client.fetch_using_lang::<${1:model}>(Language::ZH).await {"
37
- " Ok(_${1/(.*)/${1:/downcase}/}) => Ok(()),"
38
- " Err(why) => Err(why),"
39
- " } "
40
- " } "
41
- " }"
42
- ]
43
- },
44
- "Test a model (RTArray)" : {
45
- "scope" : " rust" ,
46
- "prefix" : " model_test_array" ,
47
- "body" : [
48
- " #[cfg(test)]"
49
- " mod test {"
50
- " use super::${1:model};"
51
- " use crate::worldstate::{client::Client, error::ApiError};"
52
- " "
53
- " #[cfg(not(feature = \" multilangual\" ))]"
54
- " #[tokio::test]"
55
- " async fn test_${1/(.*)/${1:/downcase}/}() -> Result<(), ApiError> {"
56
- " let client = Client::new();"
57
- " "
58
- " match client.fetch_arr::<${1:model}>().await {"
59
- " Ok(_${1/(.*)/${1:/downcase}/}s) => Ok(()),"
60
- " Err(why) => Err(why),"
61
- " } "
62
- " } "
63
- " "
64
- " #[cfg(feature = \" multilangual\" )]"
65
- " #[tokio::test]"
66
- " async fn test_${1/(.*)/${1:/downcase}/}_ml() -> Result<(), ApiError> {"
67
- " use crate::worldstate::prelude::Language;"
68
- " "
69
- " let client = Client::new();"
70
- " "
71
- " match client.fetch_arr_using_lang::<${1:model}>(Language::ZH).await {"
72
- " Ok(_${1/(.*)/${1:/downcase}/}s) => Ok(()),"
73
- " Err(why) => Err(why),"
74
- " } "
75
- " } "
76
- " }"
77
- ]
78
- }
2
+ // Place your warframe workspace snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
3
+ // description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
4
+ // is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
5
+ // used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
6
+ // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
7
+ // Placeholders with the same ids are connected.
8
+ // Example:
9
+ "Test a model (RTObj)" : {
10
+ "scope" : " rust" ,
11
+ "prefix" : " model_test" ,
12
+ "body" : [
13
+ " #[cfg(test)]" ,
14
+ " mod test {" ,
15
+ " use super::${1:model};" ,
16
+ " use crate::worldstate::{client::Client, error::ApiError};" ,
17
+ " " ,
18
+ " #[cfg(not(feature = \" multilangual\" ))]" ,
19
+ " #[tokio::test]" ,
20
+ " async fn test_${1/(.*)/${1:/downcase}/}() -> Result<(), ApiError> {" ,
21
+ " let client = Client::new();" ,
22
+ " " ,
23
+ " match client.fetch::<${1:model}>().await {" ,
24
+ " Ok(_${1/(.*)/${1:/downcase}/}) => Ok(())," ,
25
+ " Err(why) => Err(why)," ,
26
+ " } " ,
27
+ " } " ,
28
+ " " ,
29
+ " #[cfg(feature = \" multilangual\" )]" ,
30
+ " #[tokio::test]" ,
31
+ " async fn test_${1/(.*)/${1:/downcase}/}_ml() -> Result<(), ApiError> {" ,
32
+ " use crate::worldstate::prelude::Language;" ,
33
+ " " ,
34
+ " let client = Client::new();" ,
35
+ " " ,
36
+ " match client.fetch_using_lang::<${1:model}>(Language::ZH).await {" ,
37
+ " Ok(_${1/(.*)/${1:/downcase}/}) => Ok(())," ,
38
+ " Err(why) => Err(why)," ,
39
+ " } " ,
40
+ " } " ,
41
+ " }" ,
42
+ ]
43
+ },
44
+ "Test a model (RTArray)" : {
45
+ "scope" : " rust" ,
46
+ "prefix" : " model_test_array" ,
47
+ "body" : [
48
+ " #[cfg(test)]" ,
49
+ " mod test {" ,
50
+ " use super::${1:model};" ,
51
+ " use crate::worldstate::{client::Client, error::ApiError};" ,
52
+ " " ,
53
+ " #[cfg(not(feature = \" multilangual\" ))]" ,
54
+ " #[tokio::test]" ,
55
+ " async fn test_${1/(.*)/${1:/downcase}/}() -> Result<(), ApiError> {" ,
56
+ " let client = Client::new();" ,
57
+ " " ,
58
+ " match client.fetch_arr::<${1:model}>().await {" ,
59
+ " Ok(_${1/(.*)/${1:/downcase}/}s) => Ok(())," ,
60
+ " Err(why) => Err(why)," ,
61
+ " } " ,
62
+ " } " ,
63
+ " " ,
64
+ " #[cfg(feature = \" multilangual\" )]" ,
65
+ " #[tokio::test]" ,
66
+ " async fn test_${1/(.*)/${1:/downcase}/}_ml() -> Result<(), ApiError> {" ,
67
+ " use crate::worldstate::prelude::Language;" ,
68
+ " " ,
69
+ " let client = Client::new();" ,
70
+ " " ,
71
+ " match client.fetch_arr_using_lang::<${1:model}>(Language::ZH).await {" ,
72
+ " Ok(_${1/(.*)/${1:/downcase}/}s) => Ok(())," ,
73
+ " Err(why) => Err(why)," ,
74
+ " } " ,
75
+ " } " ,
76
+ " }" ,
77
+ ]
78
+ }
79
79
}
0 commit comments