How to match "Go struct tag"
已回答
I want to develop a code completion plugin. It can provice code completion for “golang struct tag”.
Now I don't know how to write it.
public class MyCompletionContributorTag extends CompletionContributor {
public MyCompletionContributorTag() {
extend(
CompletionType.BASIC,
// it doesn't work.
PlatformPatterns.psiElement(GoTypes.STRING).withParent(GoTag.class),
new MyCompletionProvider()
);
}
}
Please help me. Thank you.
请先登录再写评论。
Hi,
Try:
Thank you!
It can work normally:
PlatformPatterns.psiElement(GoTypes.RAW_STRING).withSuperParent(2, GoTag::class)