@@ -2,6 +2,7 @@ local Class = require("nvim-tree.classic")
2
2
3
3
--- Abstract Node class.
4
4
--- @class (exact ) Node : Class
5
+ --- @field uid_node number vim.loop.hrtime () at construction time
5
6
--- @field type " file" | " directory" | " link" uv.fs_stat.result.type
6
7
--- @field explorer Explorer
7
8
--- @field absolute_path string
@@ -11,6 +12,7 @@ local Class = require("nvim-tree.classic")
11
12
--- @field hidden boolean
12
13
--- @field name string
13
14
--- @field parent DirectoryNode ?
15
+ --- TODO split this into diag_severity and diag_severity_cache_version
14
16
--- @field diag_status DiagStatus ?
15
17
--- @field private is_dot boolean cached is_dotfile
16
18
local Node = Class :extend ()
@@ -25,6 +27,7 @@ local Node = Class:extend()
25
27
--- @protected
26
28
--- @param args NodeArgs
27
29
function Node :new (args )
30
+ self .uid_node = vim .loop .hrtime ()
28
31
self .explorer = args .explorer
29
32
self .absolute_path = args .absolute_path
30
33
self .executable = false
@@ -112,30 +115,26 @@ end
112
115
113
116
--- Highlighted name for the node
114
117
--- Empty for base Node
115
- --- @return HighlightedString icon
118
+ --- @return HighlightedString name
116
119
function Node :highlighted_name ()
117
120
return self :highlighted_name_empty ()
118
121
end
119
122
120
123
--- Create a sanitized partial copy of a node, populating children recursively.
121
- --- @return Node cloned
124
+ --- @return nvim_tree.api. Node cloned
122
125
function Node :clone ()
123
- --- @type Explorer
124
- local explorer_placeholder = nil
125
-
126
- --- @type Node
126
+ --- @type nvim_tree.api.Node
127
127
local clone = {
128
+ uid_node = self .uid_node ,
128
129
type = self .type ,
129
- explorer = explorer_placeholder ,
130
130
absolute_path = self .absolute_path ,
131
131
executable = self .executable ,
132
132
fs_stat = self .fs_stat ,
133
133
git_status = self .git_status ,
134
134
hidden = self .hidden ,
135
135
name = self .name ,
136
136
parent = nil ,
137
- diag_status = nil ,
138
- is_dot = self .is_dot ,
137
+ diag_severity = self .diag_status and self .diag_status .value or nil ,
139
138
}
140
139
141
140
return clone
0 commit comments