Remove /* code */ placeholders in rust.snippets.
This commit is contained in:
parent
dba38fc382
commit
7af4b8f424
@ -9,14 +9,14 @@ priority -50
|
|||||||
###############
|
###############
|
||||||
snippet fn "A function, optionally with arguments and return type."
|
snippet fn "A function, optionally with arguments and return type."
|
||||||
fn ${1:function_name}(${2})${3/..*/ -> /}${3} {
|
fn ${1:function_name}(${2})${3/..*/ -> /}${3} {
|
||||||
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
|
${VISUAL}${0}
|
||||||
}
|
}
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet test "Test function"
|
snippet test "Test function"
|
||||||
#[test]
|
#[test]
|
||||||
fn ${1:test_function_name}() {
|
fn ${1:test_function_name}() {
|
||||||
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
|
${VISUAL}${0}
|
||||||
}
|
}
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
@ -55,7 +55,7 @@ endsnippet
|
|||||||
|
|
||||||
snippet mod "A mod." b
|
snippet mod "A mod." b
|
||||||
mod ${1:`!p snip.rv = snip.basename.lower() or "name"`} {
|
mod ${1:`!p snip.rv = snip.basename.lower() or "name"`} {
|
||||||
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
|
${VISUAL}${0}
|
||||||
} /* $1 */
|
} /* $1 */
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
@ -97,7 +97,7 @@ endsnippet
|
|||||||
|
|
||||||
snippet if "if .. (if)" b
|
snippet if "if .. (if)" b
|
||||||
if ${1:/* condition */} {
|
if ${1:/* condition */} {
|
||||||
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
|
${VISUAL}${0}
|
||||||
}
|
}
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
@ -109,19 +109,19 @@ endsnippet
|
|||||||
|
|
||||||
snippet while "while .. {}" b
|
snippet while "while .. {}" b
|
||||||
while ${1:condition} {
|
while ${1:condition} {
|
||||||
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
|
${VISUAL}${0}
|
||||||
}
|
}
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet for "for .. in .." b
|
snippet for "for .. in .." b
|
||||||
for ${1:i} in ${2:range(0u, 10)} {
|
for ${1:i} in ${2:range(0u, 10)} {
|
||||||
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
|
${VISUAL}${0}
|
||||||
}
|
}
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet spawn "spawn(proc() { .. });" b
|
snippet spawn "spawn(proc() { .. });" b
|
||||||
spawn(proc() {
|
spawn(proc() {
|
||||||
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
|
${VISUAL}${0}
|
||||||
});
|
});
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
@ -146,13 +146,13 @@ endsnippet
|
|||||||
############
|
############
|
||||||
snippet st "Struct" b
|
snippet st "Struct" b
|
||||||
struct ${1:`!p snip.rv = snip.basename.title() or "name"`} {
|
struct ${1:`!p snip.rv = snip.basename.title() or "name"`} {
|
||||||
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
|
${VISUAL}${0}
|
||||||
}
|
}
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet stn "Struct with new constructor." b
|
snippet stn "Struct with new constructor." b
|
||||||
pub struct ${1:`!p snip.rv = snip.basename.title() or "name"`} {
|
pub struct ${1:`!p snip.rv = snip.basename.title() or "name"`} {
|
||||||
${3:/* code */}
|
${3}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl $1 {
|
impl $1 {
|
||||||
@ -180,14 +180,14 @@ endsnippet
|
|||||||
##########
|
##########
|
||||||
snippet imp "An impl" b
|
snippet imp "An impl" b
|
||||||
impl ${1:Name} {
|
impl ${1:Name} {
|
||||||
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
|
${VISUAL}${0}
|
||||||
}
|
}
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet drop "Drop implementation" b
|
snippet drop "Drop implementation" b
|
||||||
impl Drop for ${1:Name} {
|
impl Drop for ${1:Name} {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
|
${VISUAL}${0}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
endsnippet
|
endsnippet
|
||||||
@ -198,7 +198,7 @@ endsnippet
|
|||||||
############
|
############
|
||||||
snippet trait "Trait block" b
|
snippet trait "Trait block" b
|
||||||
trait ${1:Name} {
|
trait ${1:Name} {
|
||||||
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
|
${VISUAL}${0}
|
||||||
}
|
}
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user