Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Phodal
Coca
提交
1dab543b
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,体验更适合开发者的 AI 搜索 >>
未验证
提交
1dab543b
编写于
1月 16, 2020
作者:
P
Phodal Huang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: remove JImport
上级
71ca983b
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
23 addition
and
25 deletion
+23
-25
pkg/application/deps/dep_app.go
pkg/application/deps/dep_app.go
+3
-2
pkg/domain/core_domain/code_member.go
pkg/domain/core_domain/code_member.go
+1
-5
pkg/domain/jdomain/jclass_node.go
pkg/domain/jdomain/jclass_node.go
+5
-2
pkg/domain/jdomain/jimport.go
pkg/domain/jdomain/jimport.go
+3
-5
trial/cocago/testdata/node_infos/basic_interface.json
trial/cocago/testdata/node_infos/basic_interface.json
+3
-3
trial/cocago/testdata/node_infos/data_struct_property.json
trial/cocago/testdata/node_infos/data_struct_property.json
+1
-1
trial/cocago/testdata/node_infos/hello_world.json
trial/cocago/testdata/node_infos/hello_world.json
+1
-1
trial/cocago/testdata/node_infos/nested_method.json
trial/cocago/testdata/node_infos/nested_method.json
+1
-1
trial/cocago/testdata/node_infos/normal_method.json
trial/cocago/testdata/node_infos/normal_method.json
+2
-2
trial/cocago/testdata/node_infos/struct_type_zero.json
trial/cocago/testdata/node_infos/struct_type_zero.json
+1
-1
trial/cocago/testdata/node_infos/struct_with_func.json
trial/cocago/testdata/node_infos/struct_with_func.json
+1
-1
trial/cocago/testdata/node_infos/struct_with_func_decl.json
trial/cocago/testdata/node_infos/struct_with_func_decl.json
+1
-1
未找到文件。
pkg/application/deps/dep_app.go
浏览文件 @
1dab543b
...
...
@@ -2,6 +2,7 @@ package deps
import
(
"github.com/phodal/coca/pkg/adapter/cocafile"
"github.com/phodal/coca/pkg/domain/core_domain"
"github.com/phodal/coca/pkg/domain/jdomain"
"github.com/phodal/coca/pkg/domain/support_domain"
"path/filepath"
...
...
@@ -15,8 +16,8 @@ func NewDepApp() *DepAnalysisApp {
return
&
DepAnalysisApp
{}
}
func
(
d
*
DepAnalysisApp
)
BuildImportMap
(
deps
[]
jdomain
.
JClassNode
)
map
[
string
]
jdomain
.
J
Import
{
var
impMap
=
make
(
map
[
string
]
jdomain
.
J
Import
)
func
(
d
*
DepAnalysisApp
)
BuildImportMap
(
deps
[]
jdomain
.
JClassNode
)
map
[
string
]
core_domain
.
Code
Import
{
var
impMap
=
make
(
map
[
string
]
core_domain
.
Code
Import
)
for
_
,
clz
:=
range
deps
{
for
_
,
imp
:=
range
clz
.
Imports
{
impMap
[
imp
.
Source
]
=
imp
...
...
pkg/domain/core_domain/code_member.go
浏览文件 @
1dab543b
package
core_domain
import
(
"github.com/phodal/coca/pkg/domain/jdomain"
)
type
CodeMember
struct
{
ID
string
Name
string
Type
string
ClassNodes
[]
jdomain
.
JClassNode
Structures
[]
CodeDataStruct
FunctionNodes
[]
CodeFunction
Namespace
[]
string
FileID
string
...
...
pkg/domain/jdomain/jclass_node.go
浏览文件 @
1dab543b
package
jdomain
import
"strings"
import
(
"github.com/phodal/coca/pkg/domain/core_domain"
"strings"
)
type
JClassNode
struct
{
Package
string
...
...
@@ -14,7 +17,7 @@ type JClassNode struct {
Implements
[]
string
Annotations
[]
Annotation
InnerClass
[]
JClassNode
Imports
[]
J
Import
Imports
[]
core_domain
.
Code
Import
}
type
JField
struct
{
...
...
pkg/domain/jdomain/jimport.go
浏览文件 @
1dab543b
package
jdomain
type
JImport
struct
{
Source
string
}
import
"github.com/phodal/coca/pkg/domain/core_domain"
func
NewJImport
(
str
string
)
J
Import
{
return
J
Import
{
func
NewJImport
(
str
string
)
core_domain
.
Code
Import
{
return
core_domain
.
Code
Import
{
Source
:
str
,
}
}
trial/cocago/testdata/node_infos/basic_interface.json
浏览文件 @
1dab543b
...
...
@@ -112,7 +112,6 @@
"Imports"
:
null
,
"Members"
:
[
{
"ClassNodes"
:
null
,
"DataStructID"
:
"Shape"
,
"FileID"
:
""
,
"FunctionNodes"
:
null
,
...
...
@@ -125,10 +124,10 @@
"StopLine"
:
0
,
"StopLinePosition"
:
0
},
"Structures"
:
null
,
"Type"
:
"interface"
},
{
"ClassNodes"
:
null
,
"DataStructID"
:
"Object"
,
"FileID"
:
""
,
"FunctionNodes"
:
null
,
...
...
@@ -141,10 +140,10 @@
"StopLine"
:
0
,
"StopLinePosition"
:
0
},
"Structures"
:
null
,
"Type"
:
"interface"
},
{
"ClassNodes"
:
null
,
"DataStructID"
:
"Material"
,
"FileID"
:
""
,
"FunctionNodes"
:
null
,
...
...
@@ -157,6 +156,7 @@
"StopLine"
:
0
,
"StopLinePosition"
:
0
},
"Structures"
:
null
,
"Type"
:
"interface"
}
],
...
...
trial/cocago/testdata/node_infos/data_struct_property.json
浏览文件 @
1dab543b
...
...
@@ -69,7 +69,6 @@
],
"Members"
:
[
{
"ClassNodes"
:
null
,
"DataStructID"
:
"CodeFile"
,
"FileID"
:
"testdata/node_infos/data_struct_property.code"
,
"FunctionNodes"
:
null
,
...
...
@@ -82,6 +81,7 @@
"StopLine"
:
0
,
"StopLinePosition"
:
0
},
"Structures"
:
null
,
"Type"
:
"struct"
}
],
...
...
trial/cocago/testdata/node_infos/hello_world.json
浏览文件 @
1dab543b
...
...
@@ -12,7 +12,6 @@
],
"Members"
:
[
{
"ClassNodes"
:
null
,
"DataStructID"
:
"default"
,
"FileID"
:
""
,
"FunctionNodes"
:
[
...
...
@@ -67,6 +66,7 @@
"StopLine"
:
0
,
"StopLinePosition"
:
0
},
"Structures"
:
null
,
"Type"
:
"method"
}
],
...
...
trial/cocago/testdata/node_infos/nested_method.json
浏览文件 @
1dab543b
...
...
@@ -12,7 +12,6 @@
],
"Members"
:
[
{
"ClassNodes"
:
null
,
"DataStructID"
:
"default"
,
"FileID"
:
""
,
"FunctionNodes"
:
[
...
...
@@ -67,6 +66,7 @@
"StopLine"
:
0
,
"StopLinePosition"
:
0
},
"Structures"
:
null
,
"Type"
:
"method"
}
],
...
...
trial/cocago/testdata/node_infos/normal_method.json
浏览文件 @
1dab543b
...
...
@@ -19,7 +19,6 @@
],
"Members"
:
[
{
"ClassNodes"
:
null
,
"DataStructID"
:
"default"
,
"FileID"
:
""
,
"FunctionNodes"
:
[
...
...
@@ -121,10 +120,10 @@
"StopLine"
:
0
,
"StopLinePosition"
:
0
},
"Structures"
:
null
,
"Type"
:
"method"
},
{
"ClassNodes"
:
null
,
"DataStructID"
:
"default"
,
"FileID"
:
""
,
"FunctionNodes"
:
[
...
...
@@ -226,6 +225,7 @@
"StopLine"
:
0
,
"StopLinePosition"
:
0
},
"Structures"
:
null
,
"Type"
:
"method"
}
],
...
...
trial/cocago/testdata/node_infos/struct_type_zero.json
浏览文件 @
1dab543b
...
...
@@ -20,7 +20,6 @@
"Imports"
:
null
,
"Members"
:
[
{
"ClassNodes"
:
null
,
"DataStructID"
:
"O"
,
"FileID"
:
""
,
"FunctionNodes"
:
[
...
...
@@ -52,6 +51,7 @@
"StopLine"
:
0
,
"StopLinePosition"
:
0
},
"Structures"
:
null
,
"Type"
:
"struct"
}
],
...
...
trial/cocago/testdata/node_infos/struct_with_func.json
浏览文件 @
1dab543b
...
...
@@ -45,7 +45,6 @@
"Imports"
:
null
,
"Members"
:
[
{
"ClassNodes"
:
null
,
"DataStructID"
:
"Person"
,
"FileID"
:
"testdata/node_infos/struct_with_func.code"
,
"FunctionNodes"
:
null
,
...
...
@@ -58,6 +57,7 @@
"StopLine"
:
0
,
"StopLinePosition"
:
0
},
"Structures"
:
null
,
"Type"
:
"struct"
}
],
...
...
trial/cocago/testdata/node_infos/struct_with_func_decl.json
浏览文件 @
1dab543b
...
...
@@ -53,7 +53,6 @@
],
"Members"
:
[
{
"ClassNodes"
:
null
,
"DataStructID"
:
"person"
,
"FileID"
:
"testdata/node_infos/struct_with_func_decl.code"
,
"FunctionNodes"
:
[
...
...
@@ -108,6 +107,7 @@
"StopLine"
:
0
,
"StopLinePosition"
:
0
},
"Structures"
:
null
,
"Type"
:
"struct"
}
],
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录