rust-analyzer/crates/syntax/src/utils.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

10 lines
317 B
Rust
Raw Normal View History

2021-03-08 12:59:54 +00:00
//! A set of utils methods to reuse on other abstraction levels
use crate::SyntaxKind;
2021-03-08 12:59:54 +00:00
#[inline]
pub fn is_raw_identifier(name: &str, edition: parser::Edition) -> bool {
let is_keyword = SyntaxKind::from_keyword(name, edition).is_some();
is_keyword && !matches!(name, "self" | "crate" | "super" | "Self")
}