-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathicons.lua
More file actions
45 lines (41 loc) · 1.25 KB
/
icons.lua
File metadata and controls
45 lines (41 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
local node_data = require("java-deps.java.nodeData")
local PackageRootKind = require("java-deps.java.IPackageRootNodeData").PackageRootKind
local NodeKind = node_data.NodeKind
local TypeKind = node_data.TypeKind
---@class Icon
---@field icon string
---@field hl string?
local M = {
NodeKind = {
[NodeKind.Workspace] = { icon = "", hl = "Type" },
[NodeKind.Project] = { icon = "" },
[NodeKind.PackageRoot] = { icon = "" },
[NodeKind.Package] = { icon = "" },
[NodeKind.PrimaryType] = { icon = "" },
[NodeKind.CompilationUnit] = { icon = "" },
[NodeKind.ClassFile] = { icon = "" },
[NodeKind.Container] = { icon = "" },
[NodeKind.Folder] = { icon = "" },
[NodeKind.File] = { icon = "" },
},
TypeKind = {
[TypeKind.Class] = { icon = "" },
[TypeKind.Interface] = { icon = "" },
[TypeKind.Enum] = { icon = "" },
},
EntryKind = {
[PackageRootKind.K_SOURCE] = { icon = "" },
[PackageRootKind.K_BINARY] = { icon = "" },
},
}
---@param node DataNode
---@return Icon
M.get_icon = function(node)
local kind = node:kind()
if kind == node_data.NodeKind.PrimaryType then
return M.TypeKind[node:typeKind()]
else
return M.NodeKind[kind]
end
end
return M