Skip to content

Commit

Permalink
Merge pull request #7 from andooown/lexicon-def-id
Browse files Browse the repository at this point in the history
#LexiconDefID macro
  • Loading branch information
andooown committed Oct 20, 2023
2 parents 1b73dea + f9d755b commit 86cfb1a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Sources/LexiconGen/LexiconGen.swift
Expand Up @@ -36,9 +36,10 @@ struct LexiconGen: ParsableCommand {
print("\(defs.count) definitions found")

let source = try SourceFileSyntax {
try ImportDeclSyntax("import Foundation")
try ImportDeclSyntax("import ATProtoCore")
try ImportDeclSyntax("import ATProtoMacro")
try ImportDeclSyntax("import ATProtoXRPC")
try ImportDeclSyntax("import Foundation")

// Namespace enums
for def in namespaces {
Expand Down Expand Up @@ -96,7 +97,7 @@ struct LexiconGen: ParsableCommand {
object
) {
try VariableDeclSyntax(
"public static let typeValue = \"\(raw: def.id.valueWithoutMain)\""
"public static let typeValue = #LexiconDefID(\"\(raw: def.id.valueWithoutMain)\")"
)
}

Expand All @@ -112,7 +113,7 @@ struct LexiconGen: ParsableCommand {
object
) {
try VariableDeclSyntax(
"public static let typeValue = \"\(raw: def.id.valueWithoutMain)\""
"public static let typeValue = #LexiconDefID(\"\(raw: def.id.valueWithoutMain)\")"
)
}

Expand Down

0 comments on commit 86cfb1a

Please sign in to comment.