Skip to content

Commit

Permalink
Make scope.thrift annotations "magic"
Browse files Browse the repository at this point in the history
Summary: We can't use structured annotations in this file because of circular dependencies, and we don't want to keep the unstructured annotations around. Inject the annotations in the mutator where they will not be picked up by the codemod and we can eventually inject them as structured once the bundling work is complete.

Reviewed By: yoney

Differential Revision: D69817266

fbshipit-source-id: b39c204b2633ee4db9971f490b3b24ad342fe967
  • Loading branch information
iahs authored and facebook-github-bot committed Feb 21, 2025
1 parent 9e0467a commit 22ff053
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions thrift/annotation/scope.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -99,17 +99,20 @@ struct Service {}
struct Interaction {}

/** The `function` definition scope. */
struct Function {} (hack.name = "TFunction", js.name = "TFunction")
struct Function {}
/* added by compiler: (hack.name = "TFunction", js.name = "TFunction") */

/** The Enum value definition scope. */
struct EnumValue {}

/** The `const` definition scope. */
struct Const {} (hack.name = "TConst")
struct Const {}
/* added by compiler: (hack.name = "TConst") */

// Due to cython bug, we can not use `Enum` as class name directly
// https://github.com/cython/cython/issues/2474
struct Enum {} (py3.hidden)
struct Enum {}
/* added by compiler: (py3.hidden) */

/** A scope that includes all 'structured' definitions. */
@Struct
Expand All @@ -122,7 +125,8 @@ struct Structured {}
@Service
@Interaction
@Transitive
struct Interface {} (hack.name = "TInterface")
struct Interface {}
/* added by compiler: (hack.name = "TInterface") */

/** A scope that includes all program-scoped definition. */
@Structured
Expand Down

0 comments on commit 22ff053

Please sign in to comment.