Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Phodal
Coca
提交
ab30d891
C
Coca
项目概览
Phodal
/
Coca
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
Coca
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
ab30d891
编写于
1月 16, 2020
作者:
P
Phodal Huang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: merge jmethod call codecall
上级
bb7dfa0a
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
109 addition
and
114 deletion
+109
-114
pkg/application/analysis/java_full_app_test.go
pkg/application/analysis/java_full_app_test.go
+5
-3
pkg/application/refactor/rename/rename_method.go
pkg/application/refactor/rename/rename_method.go
+10
-2
pkg/application/tbs/tbs_app.go
pkg/application/tbs/tbs_app.go
+9
-9
pkg/domain/core_domain/code_call.go
pkg/domain/core_domain/code_call.go
+36
-0
pkg/domain/core_domain/code_property.go
pkg/domain/core_domain/code_property.go
+2
-2
pkg/domain/jdomain/jclass_node.go
pkg/domain/jdomain/jclass_node.go
+1
-1
pkg/domain/jdomain/jmethod.go
pkg/domain/jdomain/jmethod.go
+1
-1
pkg/domain/jdomain/jmethod_call.go
pkg/domain/jdomain/jmethod_call.go
+0
-58
pkg/infrastructure/ast/full/java_full_converter.go
pkg/infrastructure/ast/full/java_full_converter.go
+11
-10
pkg/infrastructure/ast/full/java_full_listener.go
pkg/infrastructure/ast/full/java_full_listener.go
+34
-28
未找到文件。
pkg/application/analysis/java_full_app_test.go
浏览文件 @
ab30d891
...
...
@@ -2,6 +2,7 @@ package analysis
import
(
.
"github.com/onsi/gomega"
"github.com/phodal/coca/pkg/domain/core_domain"
"github.com/phodal/coca/pkg/domain/jdomain"
"path/filepath"
"testing"
...
...
@@ -195,14 +196,15 @@ func Test_ShouldGetMethodCallParameters(t *testing.T) {
callNodes
:=
getCallNodes
(
codePath
)
methodCallMap
:=
make
(
map
[
string
]
jdomain
.
JMethod
Call
)
methodCallMap
:=
make
(
map
[
string
]
core_domain
.
Code
Call
)
for
_
,
method
:=
range
callNodes
[
0
]
.
Methods
{
for
_
,
call
:=
range
method
.
MethodCalls
{
methodCallMap
[
call
.
MethodName
]
=
call
}
}
g
.
Expect
(
methodCallMap
[
"assertEquals"
]
.
Parameters
)
.
To
(
Equal
([]
string
{
"true"
,
"true"
}))
g
.
Expect
(
methodCallMap
[
"assertEquals"
]
.
Parameters
[
0
]
.
TypeValue
)
.
To
(
Equal
(
"true"
))
g
.
Expect
(
methodCallMap
[
"assertEquals"
]
.
Parameters
[
1
]
.
TypeValue
)
.
To
(
Equal
(
"true"
))
}
func
Test_BuilderCallSplitIssue
(
t
*
testing
.
T
)
{
...
...
@@ -213,7 +215,7 @@ func Test_BuilderCallSplitIssue(t *testing.T) {
callNodes
:=
getCallNodes
(
codePath
)
methodCallMap
:=
make
(
map
[
string
]
jdomain
.
JMethod
Call
)
methodCallMap
:=
make
(
map
[
string
]
core_domain
.
Code
Call
)
for
_
,
method
:=
range
callNodes
[
0
]
.
Methods
{
for
_
,
call
:=
range
method
.
MethodCalls
{
methodCallMap
[
call
.
MethodName
]
=
call
...
...
pkg/application/refactor/rename/rename_method.go
浏览文件 @
ab30d891
...
...
@@ -2,6 +2,7 @@ package unused
import
(
"github.com/phodal/coca/pkg/application/refactor/rename/support"
"github.com/phodal/coca/pkg/domain/core_domain"
"github.com/phodal/coca/pkg/domain/jdomain"
"io/ioutil"
"log"
...
...
@@ -52,8 +53,15 @@ func startParse(nodes []jdomain.JClassNode, relates []support.RefactorChangeRela
}
}
func
methodCallToMethodModel
(
call
jdomain
.
JMethodCall
)
jdomain
.
JMethod
{
return
jdomain
.
JMethod
{
Name
:
call
.
MethodName
,
Type
:
call
.
Type
,
StartLine
:
call
.
StartLine
,
StartLinePosition
:
call
.
StartLinePosition
,
StopLine
:
call
.
StopLine
,
StopLinePosition
:
call
.
StopLinePosition
}
func
methodCallToMethodModel
(
call
core_domain
.
CodeCall
)
jdomain
.
JMethod
{
return
jdomain
.
JMethod
{
Name
:
call
.
MethodName
,
Type
:
call
.
Type
,
StartLine
:
call
.
Position
.
StartLine
,
StartLinePosition
:
call
.
Position
.
StartLinePosition
,
StopLine
:
call
.
Position
.
StopLine
,
StopLinePosition
:
call
.
Position
.
StopLinePosition
,
}
}
func
updateSelfRefs
(
node
jdomain
.
JClassNode
,
method
jdomain
.
JMethod
,
info
*
support
.
PackageClassInfo
)
{
...
...
pkg/application/tbs/tbs_app.go
浏览文件 @
ab30d891
...
...
@@ -38,7 +38,7 @@ func (a TbsApp) AnalysisPath(deps []jdomain.JClassNode, identifiersMap map[strin
checkEmptyTest
(
clz
.
FilePath
,
annotation
,
&
results
,
method
,
&
testType
)
}
var
methodCallMap
=
make
(
map
[
string
][]
jdomain
.
JMethod
Call
)
var
methodCallMap
=
make
(
map
[
string
][]
core_domain
.
Code
Call
)
var
hasAssert
=
false
for
index
,
methodCall
:=
range
currentMethodCalls
{
if
methodCall
.
MethodName
==
""
{
...
...
@@ -85,7 +85,7 @@ func checkAssert(hasAssert bool, clz jdomain.JClassNode, method jdomain.JMethod,
}
}
func
updateMethodCallsForSelfCall
(
method
jdomain
.
JMethod
,
clz
jdomain
.
JClassNode
,
callMethodMap
map
[
string
]
jdomain
.
JMethod
)
[]
jdomain
.
JMethod
Call
{
func
updateMethodCallsForSelfCall
(
method
jdomain
.
JMethod
,
clz
jdomain
.
JClassNode
,
callMethodMap
map
[
string
]
jdomain
.
JMethod
)
[]
core_domain
.
Code
Call
{
currentMethodCalls
:=
method
.
MethodCalls
for
_
,
methodCall
:=
range
currentMethodCalls
{
if
methodCall
.
Class
==
clz
.
Class
{
...
...
@@ -98,10 +98,10 @@ func updateMethodCallsForSelfCall(method jdomain.JMethod, clz jdomain.JClassNode
return
currentMethodCalls
}
func
checkRedundantAssertionTest
(
path
string
,
call
jdomain
.
JMethod
Call
,
method
jdomain
.
JMethod
,
results
*
[]
TestBadSmell
,
testType
*
string
)
{
func
checkRedundantAssertionTest
(
path
string
,
call
core_domain
.
Code
Call
,
method
jdomain
.
JMethod
,
results
*
[]
TestBadSmell
,
testType
*
string
)
{
TWO_PARAMETERS
:=
2
if
len
(
call
.
Parameters
)
==
TWO_PARAMETERS
{
if
call
.
Parameters
[
0
]
==
call
.
Parameters
[
1
]
{
if
call
.
Parameters
[
0
]
.
TypeValue
==
call
.
Parameters
[
1
]
.
TypeValue
{
*
testType
=
"RedundantAssertionTest"
tbs
:=
TestBadSmell
{
FileName
:
path
,
...
...
@@ -115,7 +115,7 @@ func checkRedundantAssertionTest(path string, call jdomain.JMethodCall, method j
}
}
func
checkDuplicateAssertTest
(
clz
jdomain
.
JClassNode
,
results
*
[]
TestBadSmell
,
methodCallMap
map
[
string
][]
jdomain
.
JMethod
Call
,
method
jdomain
.
JMethod
,
testType
*
string
)
{
func
checkDuplicateAssertTest
(
clz
jdomain
.
JClassNode
,
results
*
[]
TestBadSmell
,
methodCallMap
map
[
string
][]
core_domain
.
Code
Call
,
method
jdomain
.
JMethod
,
testType
*
string
)
{
var
isDuplicateAssert
=
false
for
_
,
methodCall
:=
range
methodCallMap
{
if
len
(
methodCall
)
>=
constants
.
DuplicatedAssertionLimitLength
{
...
...
@@ -138,28 +138,28 @@ func checkDuplicateAssertTest(clz jdomain.JClassNode, results *[]TestBadSmell, m
}
}
func
checkSleepyTest
(
path
string
,
method
jdomain
.
JMethod
Call
,
jMethod
jdomain
.
JMethod
,
results
*
[]
TestBadSmell
,
testType
*
string
)
{
func
checkSleepyTest
(
path
string
,
method
core_domain
.
Code
Call
,
jMethod
jdomain
.
JMethod
,
results
*
[]
TestBadSmell
,
testType
*
string
)
{
if
method
.
IsThreadSleep
()
{
*
testType
=
"SleepyTest"
tbs
:=
TestBadSmell
{
FileName
:
path
,
Type
:
*
testType
,
Description
:
""
,
Line
:
method
.
StartLine
,
Line
:
method
.
Position
.
StartLine
,
}
*
results
=
append
(
*
results
,
tbs
)
}
}
func
checkRedundantPrintTest
(
path
string
,
mCall
jdomain
.
JMethod
Call
,
results
*
[]
TestBadSmell
,
testType
*
string
)
{
func
checkRedundantPrintTest
(
path
string
,
mCall
core_domain
.
Code
Call
,
results
*
[]
TestBadSmell
,
testType
*
string
)
{
if
mCall
.
IsSystemOutput
()
{
*
testType
=
"RedundantPrintTest"
tbs
:=
TestBadSmell
{
FileName
:
path
,
Type
:
*
testType
,
Description
:
""
,
Line
:
mCall
.
StartLine
,
Line
:
mCall
.
Position
.
StartLine
,
}
*
results
=
append
(
*
results
,
tbs
)
...
...
pkg/domain/core_domain/code_call.go
浏览文件 @
ab30d891
package
core_domain
import
(
"github.com/phodal/coca/pkg/infrastructure/constants"
"strings"
)
type
CodeCall
struct
{
Package
string
Type
string
...
...
@@ -8,3 +13,34 @@ type CodeCall struct {
Parameters
[]
CodeProperty
Position
CodePosition
}
func
NewCodeMethodCall
()
CodeCall
{
return
CodeCall
{}
}
func
(
c
*
CodeCall
)
BuildFullMethodName
()
string
{
isConstructor
:=
c
.
MethodName
==
""
if
isConstructor
{
return
c
.
Package
+
"."
+
c
.
Class
}
return
c
.
Package
+
"."
+
c
.
Class
+
"."
+
c
.
MethodName
}
func
(
c
*
CodeCall
)
IsSystemOutput
()
bool
{
return
c
.
Class
==
"System.out"
&&
(
c
.
MethodName
==
"println"
||
c
.
MethodName
==
"printf"
||
c
.
MethodName
==
"print"
)
}
func
(
c
*
CodeCall
)
IsThreadSleep
()
bool
{
return
c
.
MethodName
==
"sleep"
&&
c
.
Class
==
"Thread"
}
func
(
c
*
CodeCall
)
HasAssertion
()
bool
{
methodName
:=
strings
.
ToLower
(
c
.
MethodName
)
for
_
,
assertion
:=
range
constants
.
ASSERTION_LIST
{
if
strings
.
HasPrefix
(
methodName
,
assertion
)
{
return
true
}
}
return
false
}
pkg/domain/core_domain/code_property.go
浏览文件 @
ab30d891
...
...
@@ -9,9 +9,9 @@ type CodeProperty struct {
Parameters
[]
CodeProperty
}
func
NewCodeParameter
(
type
Nam
e
string
,
typeType
string
)
CodeProperty
{
func
NewCodeParameter
(
type
Valu
e
string
,
typeType
string
)
CodeProperty
{
return
CodeProperty
{
TypeValue
:
type
Nam
e
,
TypeValue
:
type
Valu
e
,
TypeType
:
typeType
,
}
}
...
...
pkg/domain/jdomain/jclass_node.go
浏览文件 @
ab30d891
...
...
@@ -12,7 +12,7 @@ type JClassNode struct {
FilePath
string
Fields
[]
core_domain
.
CodeField
Methods
[]
JMethod
MethodCalls
[]
JMethod
Call
MethodCalls
[]
core_domain
.
Code
Call
Extend
string
Implements
[]
string
Annotations
[]
core_domain
.
CodeAnnotation
...
...
pkg/domain/jdomain/jmethod.go
浏览文件 @
ab30d891
...
...
@@ -14,7 +14,7 @@ type JMethod struct {
StopLine
int
StopLinePosition
int
Parameters
[]
core_domain
.
CodeProperty
MethodCalls
[]
JMethod
Call
MethodCalls
[]
core_domain
.
Code
Call
Override
bool
Annotations
[]
core_domain
.
CodeAnnotation
IsConstructor
bool
...
...
pkg/domain/jdomain/jmethod_call.go
浏览文件 @
ab30d891
package
jdomain
import
(
"github.com/phodal/coca/pkg/infrastructure/constants"
"strings"
)
type
JMethodCall
struct
{
Package
string
Type
string
Class
string
MethodName
string
Parameters
[]
string
StartLine
int
StartLinePosition
int
StopLine
int
StopLinePosition
int
}
func
NewJMethodCall
()
JMethodCall
{
return
JMethodCall
{
Package
:
""
,
Type
:
""
,
Class
:
""
,
MethodName
:
""
,
Parameters
:
nil
,
StartLine
:
0
,
StartLinePosition
:
0
,
StopLine
:
0
,
StopLinePosition
:
0
,
}
}
func
(
c
*
JMethodCall
)
BuildFullMethodName
()
string
{
isConstructor
:=
c
.
MethodName
==
""
if
isConstructor
{
return
c
.
Package
+
"."
+
c
.
Class
}
return
c
.
Package
+
"."
+
c
.
Class
+
"."
+
c
.
MethodName
}
func
(
c
*
JMethodCall
)
IsSystemOutput
()
bool
{
return
c
.
Class
==
"System.out"
&&
(
c
.
MethodName
==
"println"
||
c
.
MethodName
==
"printf"
||
c
.
MethodName
==
"print"
)
}
func
(
c
*
JMethodCall
)
IsThreadSleep
()
bool
{
return
c
.
MethodName
==
"sleep"
&&
c
.
Class
==
"Thread"
}
func
(
c
*
JMethodCall
)
HasAssertion
()
bool
{
methodName
:=
strings
.
ToLower
(
c
.
MethodName
)
for
_
,
assertion
:=
range
constants
.
ASSERTION_LIST
{
if
strings
.
HasPrefix
(
methodName
,
assertion
)
{
return
true
}
}
return
false
}
pkg/infrastructure/ast/full/java_full_converter.go
浏览文件 @
ab30d891
...
...
@@ -3,7 +3,6 @@ package full
import
(
"github.com/phodal/coca/languages/java"
"github.com/phodal/coca/pkg/domain/core_domain"
"github.com/phodal/coca/pkg/domain/jdomain"
"strings"
)
...
...
@@ -23,7 +22,7 @@ func BuildMethodParameters(parameters parser.IFormalParametersContext) []core_do
return
methodParams
}
func
BuildMethodCallMethods
(
jMethodCall
*
jdomain
.
JMethod
Call
,
callee
string
,
targetType
string
,
ctx
*
parser
.
MethodCallContext
)
{
func
BuildMethodCallMethods
(
jMethodCall
*
core_domain
.
Code
Call
,
callee
string
,
targetType
string
,
ctx
*
parser
.
MethodCallContext
)
{
methodName
:=
callee
packageName
:=
currentPkg
...
...
@@ -53,19 +52,21 @@ func BuildMethodCallMethods(jMethodCall *jdomain.JMethodCall, callee string, tar
jMethodCall
.
Class
=
targetType
}
func
BuildMethodCallLocation
(
jMethodCall
*
jdomain
.
JMethod
Call
,
ctx
*
parser
.
MethodCallContext
,
callee
string
)
{
jMethodCall
.
StartLine
=
ctx
.
GetStart
()
.
GetLine
()
jMethodCall
.
StartLinePosition
=
ctx
.
GetStart
()
.
GetColumn
()
jMethodCall
.
StopLine
=
ctx
.
GetStop
()
.
GetLine
()
jMethodCall
.
StopLinePosition
=
jMethodCall
.
StartLinePosition
+
len
(
callee
)
func
BuildMethodCallLocation
(
jMethodCall
*
core_domain
.
Code
Call
,
ctx
*
parser
.
MethodCallContext
,
callee
string
)
{
jMethodCall
.
Position
.
StartLine
=
ctx
.
GetStart
()
.
GetLine
()
jMethodCall
.
Position
.
StartLinePosition
=
ctx
.
GetStart
()
.
GetColumn
()
jMethodCall
.
Position
.
StopLine
=
ctx
.
GetStop
()
.
GetLine
()
jMethodCall
.
Position
.
StopLinePosition
=
jMethodCall
.
Position
.
StartLinePosition
+
len
(
callee
)
}
func
BuildMethodCallParameters
(
jMethodCall
*
jdomain
.
JMethod
Call
,
ctx
*
parser
.
MethodCallContext
)
{
func
BuildMethodCallParameters
(
jMethodCall
*
core_domain
.
Code
Call
,
ctx
*
parser
.
MethodCallContext
)
{
if
ctx
.
ExpressionList
()
!=
nil
{
var
parameters
[]
string
var
parameters
[]
core_domain
.
CodeProperty
for
_
,
expression
:=
range
ctx
.
ExpressionList
()
.
(
*
parser
.
ExpressionListContext
)
.
AllExpression
()
{
expressionCtx
:=
expression
.
(
*
parser
.
ExpressionContext
)
parameters
=
append
(
parameters
,
expressionCtx
.
GetText
())
parameter
:=
core_domain
.
NewCodeParameter
(
expressionCtx
.
GetText
(),
""
)
parameters
=
append
(
parameters
,
parameter
)
}
jMethodCall
.
Parameters
=
parameters
}
...
...
pkg/infrastructure/ast/full/java_full_listener.go
浏览文件 @
ab30d891
...
...
@@ -16,7 +16,7 @@ var clzs []string
var
currentPkg
string
var
currentClz
string
var
fields
[]
core_domain
.
CodeField
var
methodCalls
[]
jdomain
.
JMethod
Call
var
methodCalls
[]
core_domain
.
Code
Call
var
currentType
string
var
mapFields
=
make
(
map
[
string
]
string
)
...
...
@@ -226,9 +226,9 @@ func (s *JavaFullListener) EnterFieldDeclaration(ctx *parser.FieldDeclarationCon
for
_
,
declarator
:=
range
decelerators
.
(
*
parser
.
VariableDeclaratorsContext
)
.
AllVariableDeclarator
()
{
var
typeCtx
*
parser
.
ClassOrInterfaceTypeContext
=
nil
typeCtx
=
BuildTypeCtxByIndex
(
typeType
,
typeCtx
,
0
)
typeCtx
=
BuildTypeCtxByIndex
(
typeType
,
typeCtx
,
0
)
if
typeType
.
GetChildCount
()
>
1
{
typeCtx
=
BuildTypeCtxByIndex
(
typeType
,
typeCtx
,
1
)
typeCtx
=
BuildTypeCtxByIndex
(
typeType
,
typeCtx
,
1
)
}
if
typeCtx
==
nil
{
...
...
@@ -469,23 +469,26 @@ func buildCreatedCall(createdName string, ctx *parser.CreatorContext) {
method
:=
methodMap
[
getMethodMapName
(
currentMethod
)]
fullType
,
_
:=
WarpTargetFullType
(
createdName
)
jMethodCall
:=
&
jdomain
.
JMethodCall
{
Package
:
RemoveTarget
(
fullType
),
Type
:
"CreatorClass"
,
Class
:
createdName
,
MethodName
:
""
,
position
:=
core_domain
.
CodePosition
{
StartLine
:
ctx
.
GetStart
()
.
GetLine
(),
StartLinePosition
:
ctx
.
GetStart
()
.
GetColumn
(),
StopLine
:
ctx
.
GetStop
()
.
GetLine
(),
StopLinePosition
:
ctx
.
GetStop
()
.
GetColumn
(),
}
jMethodCall
:=
&
core_domain
.
CodeCall
{
Package
:
RemoveTarget
(
fullType
),
Type
:
"CreatorClass"
,
Class
:
createdName
,
Position
:
position
,
}
method
.
MethodCalls
=
append
(
method
.
MethodCalls
,
*
jMethodCall
)
methodMap
[
getMethodMapName
(
currentMethod
)]
=
method
}
func
(
s
*
JavaFullListener
)
EnterMethodCall
(
ctx
*
parser
.
MethodCallContext
)
{
var
jMethodCall
=
jdomain
.
NewJ
MethodCall
()
var
jMethodCall
=
core_domain
.
NewCode
MethodCall
()
targetCtx
:=
ctx
.
GetParent
()
.
GetChild
(
0
)
.
(
antlr
.
ParseTree
)
var
targetType
=
ParseTargetType
(
targetCtx
.
GetText
())
...
...
@@ -506,7 +509,7 @@ func (s *JavaFullListener) EnterMethodCall(ctx *parser.MethodCallContext) {
sendResultToMethodCallMap
(
jMethodCall
)
}
func
sendResultToMethodCallMap
(
jMethodCall
jdomain
.
JMethod
Call
)
{
func
sendResultToMethodCallMap
(
jMethodCall
core_domain
.
Code
Call
)
{
methodCalls
=
append
(
methodCalls
,
jMethodCall
)
method
:=
methodMap
[
getMethodMapName
(
currentMethod
)]
...
...
@@ -544,21 +547,21 @@ func (s *JavaFullListener) EnterExpression(ctx *parser.ExpressionContext) {
fullType
,
_
:=
WarpTargetFullType
(
targetType
)
startLine
:=
ctx
.
GetStart
()
.
GetLine
()
startLinePosition
:=
ctx
.
GetStart
()
.
GetColumn
()
stopLine
:=
ctx
.
GetStop
()
.
GetLine
()
stopLinePosition
:=
startLinePosition
+
len
(
text
)
jMethodCall
:=
&
jdomain
.
JMethodCall
{
Package
:
RemoveTarget
(
fullType
),
Type
:
"lambda"
,
Class
:
targetType
,
MethodName
:
methodName
,
Parameters
:
nil
,
StartLine
:
startLine
,
position
:=
core_domain
.
CodePosition
{
StartLine
:
ctx
.
GetStart
()
.
GetLine
(),
StartLinePosition
:
startLinePosition
,
StopLine
:
stopLine
,
StopLinePosition
:
stopLinePosition
,
StopLine
:
ctx
.
GetStop
()
.
GetLine
(),
StopLinePosition
:
startLinePosition
+
len
(
text
),
}
jMethodCall
:=
&
core_domain
.
CodeCall
{
Package
:
RemoveTarget
(
fullType
),
Type
:
"lambda"
,
Class
:
targetType
,
MethodName
:
methodName
,
Position
:
position
,
}
sendResultToMethodCallMap
(
*
jMethodCall
)
}
...
...
@@ -578,17 +581,20 @@ func buildExtend(extendName string) {
func
buildFieldCall
(
typeType
string
,
ctx
*
parser
.
FieldDeclarationContext
)
{
target
,
_
:=
WarpTargetFullType
(
typeType
)
if
target
!=
""
{
jMethodCall
:=
&
jdomain
.
JMethodCall
{
Package
:
RemoveTarget
(
target
),
Type
:
"field"
,
Class
:
typeType
,
MethodName
:
""
,
position
:=
core_domain
.
CodePosition
{
StartLine
:
ctx
.
GetStart
()
.
GetLine
(),
StartLinePosition
:
ctx
.
GetStart
()
.
GetColumn
(),
StopLine
:
ctx
.
GetStop
()
.
GetLine
(),
StopLinePosition
:
ctx
.
GetStop
()
.
GetColumn
(),
}
jMethodCall
:=
&
core_domain
.
CodeCall
{
Package
:
RemoveTarget
(
target
),
Type
:
"field"
,
Class
:
typeType
,
Position
:
position
,
}
currentNode
.
MethodCalls
=
append
(
currentNode
.
MethodCalls
,
*
jMethodCall
)
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录