File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ local utils = require("nvim-tree.utils")
3
3
local view = require (" nvim-tree.view" )
4
4
local log = require (" nvim-tree.log" )
5
5
6
+ local DirectoryNode = require (" nvim-tree.node.directory" )
7
+
6
8
local M = {}
7
9
8
10
--- COC severity level strings to LSP severity levels
125
127
local function from_cache (node )
126
128
local nodepath = uniformize_path (node .absolute_path )
127
129
local max_severity = nil
128
- if not node . nodes then
130
+ if not node : is ( DirectoryNode ) then
129
131
-- direct cache hit for files
130
132
max_severity = NODE_SEVERITIES [nodepath ]
131
133
else
@@ -184,7 +186,7 @@ function M.get_diag_status(node)
184
186
end
185
187
186
188
-- dir but we shouldn't show on dirs at all
187
- if node . nodes ~= nil and not M .show_on_dirs then
189
+ if node : is ( DirectoryNode ) and not M .show_on_dirs then
188
190
return nil
189
191
end
190
192
@@ -195,13 +197,15 @@ function M.get_diag_status(node)
195
197
node .diag_status = from_cache (node )
196
198
end
197
199
200
+ local dir = node :as (DirectoryNode )
201
+
198
202
-- file
199
- if not node . nodes then
203
+ if not dir then
200
204
return node .diag_status
201
205
end
202
206
203
207
-- dir is closed or we should show on open_dirs
204
- if not node .open or M .show_on_open_dirs then
208
+ if not dir .open or M .show_on_open_dirs then
205
209
return node .diag_status
206
210
end
207
211
return nil
You can’t perform that action at this time.
0 commit comments