Custom language code completion check if completion is inside block

已回答

I'm making a custom language plugin and now i'm making the code completion for it. This language is a composed of block and instructions inside and i want to make completion to propose instructions only when i'm inside some type of block.

For example my language have state block that can only have  event blocks inside and event blocks can only have instructions inside.

 

State:STATENAME {

   event:EVENTNAME {

        MESSAGE "test"

  }

}

 

1

CompletionContributor can be registered with corresponding ElementPattern defining context on which the contributor is relevant: https://plugins.jetbrains.com/docs/intellij/element-patterns.html 

 

See also https://plugins.jetbrains.com/docs/intellij/navigating-psi.html

0

请先登录再写评论。