未验证 提交 fc4de078 编写于 作者: P Phodal Huang

fix: fix creator annotaion issue

上级 483be10d
...@@ -99,6 +99,7 @@ func TestAnnotation(t *testing.T) { ...@@ -99,6 +99,7 @@ func TestAnnotation(t *testing.T) {
methodMap[c.Name] = c methodMap[c.Name] = c
} }
g.Expect(len(callNodes[0].Annotations)).To(Equal(0))
g.Expect(methodMap["macOsXPositiveTest"].Name).To(Equal("macOsXPositiveTest")) g.Expect(methodMap["macOsXPositiveTest"].Name).To(Equal("macOsXPositiveTest"))
for _, call := range methodMap["macOsXPositiveTest"].MethodCalls { for _, call := range methodMap["macOsXPositiveTest"].MethodCalls {
......
...@@ -248,8 +248,12 @@ func (s *JavaCallListener) EnterAnnotation(ctx *parser.AnnotationContext) { ...@@ -248,8 +248,12 @@ func (s *JavaCallListener) EnterAnnotation(ctx *parser.AnnotationContext) {
currentMethod.Annotations = append(currentMethod.Annotations, annotation) currentMethod.Annotations = append(currentMethod.Annotations, annotation)
} else { } else {
annotation := common_listener.BuildAnnotation(ctx) annotation := common_listener.BuildAnnotation(ctx)
if currentType == "Creator" {
currentCreatorNode.Annotations = append(currentCreatorNode.Annotations, annotation)
} else {
currentNode.Annotations = append(currentNode.Annotations, annotation) currentNode.Annotations = append(currentNode.Annotations, annotation)
} }
}
} }
func (s *JavaCallListener) EnterConstructorDeclaration(ctx *parser.ConstructorDeclarationContext) { func (s *JavaCallListener) EnterConstructorDeclaration(ctx *parser.ConstructorDeclarationContext) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册