mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-12 13:18:47 +00:00
Implement module_path!()
This commit is contained in:
parent
134c7563be
commit
81820fe52c
2 changed files with 11 additions and 0 deletions
|
@ -88,6 +88,7 @@ register_builtin! {
|
||||||
(column, Column) => column_expand,
|
(column, Column) => column_expand,
|
||||||
(file, File) => file_expand,
|
(file, File) => file_expand,
|
||||||
(line, Line) => line_expand,
|
(line, Line) => line_expand,
|
||||||
|
(module_path, ModulePath) => module_path_expand,
|
||||||
(assert, Assert) => assert_expand,
|
(assert, Assert) => assert_expand,
|
||||||
(stringify, Stringify) => stringify_expand,
|
(stringify, Stringify) => stringify_expand,
|
||||||
(format_args, FormatArgs) => format_args_expand,
|
(format_args, FormatArgs) => format_args_expand,
|
||||||
|
@ -105,6 +106,15 @@ register_builtin! {
|
||||||
(option_env, OptionEnv) => option_env_expand
|
(option_env, OptionEnv) => option_env_expand
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn module_path_expand(
|
||||||
|
_db: &dyn AstDatabase,
|
||||||
|
_id: LazyMacroId,
|
||||||
|
_tt: &tt::Subtree,
|
||||||
|
) -> ExpandResult<tt::Subtree> {
|
||||||
|
// Just return a dummy result.
|
||||||
|
ExpandResult::ok(quote! { "module::path" })
|
||||||
|
}
|
||||||
|
|
||||||
fn line_expand(
|
fn line_expand(
|
||||||
_db: &dyn AstDatabase,
|
_db: &dyn AstDatabase,
|
||||||
_id: LazyMacroId,
|
_id: LazyMacroId,
|
||||||
|
|
|
@ -188,6 +188,7 @@ pub mod known {
|
||||||
column,
|
column,
|
||||||
compile_error,
|
compile_error,
|
||||||
line,
|
line,
|
||||||
|
module_path,
|
||||||
assert,
|
assert,
|
||||||
stringify,
|
stringify,
|
||||||
concat,
|
concat,
|
||||||
|
|
Loading…
Reference in a new issue