Custom language code completion check if completion is inside block

Answered

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
1 comment

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

Please sign in to leave a comment.