mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Add _token suffix to token accessors
I think this makes is more clear which things are : AstNode and which are : AstToken
This commit is contained in:
parent
a95116fbfa
commit
e6d22187a6
12 changed files with 210 additions and 213 deletions
|
@ -208,6 +208,7 @@ fn generate_nodes(kinds: KindsSrc<'_>, grammar: AstSrc<'_>) -> Result<String> {
|
|||
FieldSrc::Optional(_) | FieldSrc::Shorthand => {
|
||||
let is_token = token_kinds.contains(&ty.to_string());
|
||||
if is_token {
|
||||
let method_name = format_ident!("{}_token", method_name);
|
||||
quote! {
|
||||
pub fn #method_name(&self) -> Option<#ty> {
|
||||
support::token(&self.syntax)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue