diff options
Diffstat (limited to 'src/tools/rust-analyzer/crates/syntax/src/utils.rs')
| -rw-r--r-- | src/tools/rust-analyzer/crates/syntax/src/utils.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/tools/rust-analyzer/crates/syntax/src/utils.rs b/src/tools/rust-analyzer/crates/syntax/src/utils.rs new file mode 100644 index 00000000000..a38f8b2b55d --- /dev/null +++ b/src/tools/rust-analyzer/crates/syntax/src/utils.rs @@ -0,0 +1,8 @@ +//! A set of utils methods to reuse on other abstraction levels + +use crate::SyntaxKind; + +pub fn is_raw_identifier(name: &str) -> bool { + let is_keyword = SyntaxKind::from_keyword(name).is_some(); + is_keyword && !matches!(name, "self" | "crate" | "super" | "Self") +} |
