mirror of
https://git.alemi.dev/neo-tree-symbolmap.git
synced 2024-11-23 16:14:48 +01:00
fix: refresh after starting worker
This commit is contained in:
parent
b212ec18a0
commit
4bcf829eae
1 changed files with 5 additions and 3 deletions
|
@ -1,4 +1,5 @@
|
||||||
local cc = require("neo-tree.sources.common.commands")
|
local cc = require("neo-tree.sources.common.commands")
|
||||||
|
local manager = require("neo-tree.sources.manager")
|
||||||
local vim = vim
|
local vim = vim
|
||||||
|
|
||||||
local M = {}
|
local M = {}
|
||||||
|
@ -69,13 +70,13 @@ local function find_last_buffer()
|
||||||
return buf
|
return buf
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return nil
|
return 0
|
||||||
end
|
end
|
||||||
|
|
||||||
M.add = function(state)
|
M.add = function(state)
|
||||||
vim.ui.input({ prompt = "query" }, function(input)
|
vim.ui.input({ prompt = "query" }, function(input)
|
||||||
local buf = find_last_buffer()
|
local buf = find_last_buffer()
|
||||||
local _ = vim.lsp.buf_request(buf, 'workspace/symbol', { query = input }, function(err, data, _, _)
|
vim.lsp.buf_request(buf, 'workspace/symbol', { query = input }, function(err, data, _, _)
|
||||||
local root = {
|
local root = {
|
||||||
id = "root",
|
id = "root",
|
||||||
name = "no workspace symbols loaded",
|
name = "no workspace symbols loaded",
|
||||||
|
@ -87,7 +88,7 @@ M.add = function(state)
|
||||||
root = parse_tree(map, 'root', 'workspace symbols')
|
root = parse_tree(map, 'root', 'workspace symbols')
|
||||||
end
|
end
|
||||||
state.symboltree = { root }
|
state.symboltree = { root }
|
||||||
require("neo-tree.sources.manager").refresh("symbolmap")
|
manager.refresh("symbolmap")
|
||||||
end)
|
end)
|
||||||
state.symboltree = { {
|
state.symboltree = { {
|
||||||
id = "root",
|
id = "root",
|
||||||
|
@ -95,6 +96,7 @@ M.add = function(state)
|
||||||
type = "directory",
|
type = "directory",
|
||||||
children = {}
|
children = {}
|
||||||
} }
|
} }
|
||||||
|
manager.refresh("symbolmap")
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue