Skip to content

Commit

Permalink
feat(schema): use the type names passed to schema's types! macro in…
Browse files Browse the repository at this point in the history
… type position (#5046)

This gives the IDE a hint that it's a type name and allows one to navigate to the type definition and see name resolution errors

Signed-off-by: ⭐️NINIKA⭐️ <[email protected]>
  • Loading branch information
DCNick3 authored Sep 9, 2024
1 parent 38a7bd2 commit c3008e3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions schema/gen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ use iroha_schema::prelude::*;

macro_rules! types {
($($t:ty),+ $(,)?) => {
// use all the types in a type position, so that IDE can resolve them
const _: () = {
use complete_data_model::*;
$(
let _resolve_my_type_pls: $t;
)+
};

/// Apply `callback` to all types in the schema.
#[macro_export]
macro_rules! map_all_schema_types {
Expand Down

0 comments on commit c3008e3

Please sign in to comment.