1. Editor
  2. Shortcut & Live Templates used in ApiHug IDEA plugin

⚠️Please always keep upgrading your piHug plugin to latest version.⚠️

💝 Plugin home: ApiHug - API design Copilot

😆 Video guide:

  1. ApiHug101-Bilibili
  2. ApiHug101 Youtube

Shortcut

Since ApiHug Plugin: 0.2.7

Preconditions:

  1. Must be proto kind file;
  2. Must mark with ApiHug extend option, for example: option (hope.domain.kind) = IDL for IDL file;

Seems almost all the shortcut keys are occupied(if any conflict with your local settings, you can find them from your right click menu context):

ShortcutCommentTipFile
ctl + alt +shift + MAdd MessageM for MessageBEAN
ctl + alt +shift + FAdd FieldF for FieldBEAN
ctl + alt +shift + KAdd Field(Reference)K for ?BEAN
ctl + alt +shift + UAdd EnumU for Unique constantENUM
ctl + alt +shift + AAdd Enum FieldA for ?ENUM
ctl + alt +shift + XAdd ErrorX for X - wrongERROR
ctl + alt +shift + ZAdd Error FieldZ for ?ERROR
ctl + alt +shift + RAdd ServiceR for ResourceIDL
ctl + alt +shift + PAdd PathP for PathIDL
ctl + alt +shift + YAdd EntityY for Yummy 😋?ENTITY
ctl + alt +shift + OAdd Entity FieldO for ?ENTITY

Also refer to the Editor Assistant

Live Template

Since ApiHug Plugin: 0.4.4 2024-06-14

  1. Settings > Editor > Live Templates find ApiHug you will find the pre-definition of the templates;
  2. CTL + J will trigger the show up of the template selector or:
  3. just keep typing; the editor will show the auto complete list;
TypeCommentConditionFile
beanAdd Beanoutside the message blockBEAN
beefAdd Bean Fieldinside the message blockBEAN
svcAdd Serviceoutside the service blockIDL
pathAdd Pathinside the service blockIDL
pasAdd Parametersinside the method option block(no duplicates detect)IDL
paAdd Parameterinside the method option block(no duplicates detect)IDL
authAdd Authinside the method option block(no duplicates detect)IDL
auth2Add Auth(RBAC Base)inside the method option block(no duplicates detect)IDL
cstAdd Enumoutside the enum blockENUM
citAdd Enum Fieldinside the enum blockENUM
errAdd Erroroutside the error blockERROR
eitAdd Error Fieldinside the error blockERROR
etyAdd Entityoutside the message blockENTITY
eitAdd Entity Fieldinside the message blockENTITY
eixAdd Entity Indexinside the message option block(no duplicates detect)ENTITY
euxAdd Entity Uniqueinside the message option block(no duplicates detect)ENTITY

Reference Jetbrains: Live templates