mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
default method name to type name
This commit is contained in:
parent
05a9d42f54
commit
78d60a549d
4 changed files with 51 additions and 84 deletions
|
@ -10,7 +10,7 @@ extern crate commandspec;
|
|||
extern crate heck;
|
||||
|
||||
use clap::{App, Arg, SubCommand};
|
||||
use heck::{CamelCase, ShoutySnakeCase};
|
||||
use heck::{CamelCase, ShoutySnakeCase, SnakeCase};
|
||||
use std::{
|
||||
collections::HashMap,
|
||||
fs,
|
||||
|
@ -91,6 +91,9 @@ fn render_template(template: &str) -> Result<String> {
|
|||
tera.register_filter("camel", |arg, _| {
|
||||
Ok(arg.as_str().unwrap().to_camel_case().into())
|
||||
});
|
||||
tera.register_filter("snake", |arg, _| {
|
||||
Ok(arg.as_str().unwrap().to_snake_case().into())
|
||||
});
|
||||
tera.register_filter("SCREAM", |arg, _| {
|
||||
Ok(arg.as_str().unwrap().to_shouty_snake_case().into())
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue