From e7ac1e221f6a3cc3a826b264d1788ad2fd413044 Mon Sep 17 00:00:00 2001 From: LingMan Date: Sun, 22 Oct 2023 05:57:15 +0200 Subject: [PATCH] rust: detect all macros directly exported from std So far only a rather arbitrary subset was recognized. --- src/basic-languages/rust/rust.ts | 33 ++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/src/basic-languages/rust/rust.ts b/src/basic-languages/rust/rust.ts index 24e764f433..e862fbf863 100644 --- a/src/basic-languages/rust/rust.ts +++ b/src/basic-languages/rust/rust.ts @@ -140,12 +140,41 @@ export const language = { constants: ['true', 'false', 'Some', 'None', 'Ok', 'Err'], supportMacros: [ + 'assert!', + 'assert_eq!', + 'assert_ne!', + 'cfg!', + 'column!', + 'compile_error!', + 'concat!', + 'dbg!', + 'debug_assert!', + 'debug_assert_eq!', + 'debug_assert_ne!', + 'env!', + 'eprint!', + 'eprintln!', + 'file!', 'format!', + 'format_args!', + 'include!', + 'include_bytes!', + 'include_str!', + 'is_x86_feature_detected!', + 'line!', + 'matches!', + 'module_path!', + 'option_env!', + 'panic!', 'print!', 'println!', - 'panic!', - 'format_args!', + 'stringify!', + 'thread_local!', + 'todo!', + 'try!', + 'unimplemented!', 'unreachable!', + 'vec!', 'write!', 'writeln!' ],