Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No intellisense for enum name user,system generated as KnownEnum #2832

Open
Tracked by #2828
MaryGao opened this issue Sep 20, 2024 · 0 comments
Open
Tracked by #2828

No intellisense for enum name user,system generated as KnownEnum #2832

MaryGao opened this issue Sep 20, 2024 · 0 comments
Assignees
Labels
HRLC p0 priority 0

Comments

@MaryGao
Copy link
Contributor

MaryGao commented Sep 20, 2024

see comments and playground, when generating the knownable items for enum key user,system there is no intellisense for it.

image

relevant tsp would be like

https://github.com/Azure/typespec-azure/blob/main/packages/typespec-azure-resource-manager/lib/common-types/types.tsp#L226-L241

/**
 * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system"
 */
union Origin {
  /** Indicates the operation is initiated by a user. */
  user: "user",

  /** Indicates the operation is initiated by a system. */
  system: "system",

  /** Indicates the operation is initiated by a user or system. */
  `user,system`: "user,system",

  string,
}

another case would be there is no key defined in union

https://github.com/azure/typespec-azure/blob/main/packages/typespec-azure-resource-manager/lib/common-types/managed-identity.tsp#L62-L84

union ManagedServiceIdentityType {
  /** No managed identity. */
  "None",

  /** System assigned managed identity. */
  "SystemAssigned",

  /** User assigned managed identity. */
  "UserAssigned",

  /** System and user assigned managed identity. */
  @added(Versions.v3)
  @removed(Versions.v4)
  @added(Versions.v5)
  "SystemAssigned,UserAssigned",

  /** System and user assigned managed identity. */
  @added(Versions.v4)
  @removed(Versions.v5)
  "SystemAssigned, UserAssigned",

  string,
}
@MaryGao MaryGao changed the title Enum name user,system is not easy for intellisense when generated as KnownableEnum No intellisense for enum name user,system generated as KnownEnum Sep 20, 2024
@qiaozha qiaozha added HRLC p0 priority 0 labels Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
HRLC p0 priority 0
Projects
None yet
Development

No branches or pull requests

2 participants