未验证 提交 71f7e0e9 编写于 作者: P Phodal HUANG

fix: any import issue

上级 a7ec0597
......@@ -3,7 +3,6 @@ package base
import (
. "../../language/java"
. "./models"
"fmt"
)
var node *JFullIdentifier;
......@@ -24,6 +23,9 @@ func (s *JavaRefactorListener) EnterPackageDeclaration(ctx *PackageDeclarationCo
func (s *JavaRefactorListener) EnterImportDeclaration(ctx *ImportDeclarationContext) {
importText := ctx.QualifiedName().GetText()
if ctx.MUL() != nil {
importText = importText + ".*"
}
startLine := ctx.GetStart().GetLine()
stopLine := ctx.GetStop().GetLine()
......@@ -99,7 +101,6 @@ func (s *JavaRefactorListener) EnterLambdaParameters(ctx *LambdaParametersContex
func (s *JavaRefactorListener) EnterMethodCall(ctx *MethodCallContext) {
text := ctx.IDENTIFIER().GetText()
fmt.Println(ctx.IDENTIFIER().GetText(), "......")
startLine := ctx.GetStart().GetLine()
stopLine := ctx.GetStop().GetLine()
field := &JField{text, node.Pkg, startLine, stopLine}
......
......@@ -62,11 +62,12 @@ func handleNode(node *JFullIdentifier) {
for index := range imports {
imp := imports[index]
ss := strings.Split(imp.Name, ".")
fmt.Println(ss)
lastField := ss[len(ss)-1]
var isOk = false
for _, field := range fields {
if field.Name == lastField {
if field.Name == lastField || lastField == "*" {
isOk = true
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册