-
Notifications
You must be signed in to change notification settings - Fork 100
Current symbol preview is Empty #176
Comments
Until #181 is merged you can try this instead: use {
"rbjorklin/symbols-outline.nvim",
branch = "fix-outline-detection"
} |
I tried it and it works fine, thanks |
I get the following error when using that branch:
E5108: Error executing lua ...acker/start/symbols-outline.nvim/lua/symbols-outline.lua:307: attempt to index field 'view' (a nil value)
stack traceback:
...acker/start/symbols-outline.nvim/lua/symbols-outline.lua:307: in function 'toggle_outline'
[string ":lua"]:1: in main chunk
E5108: Error executing lua ...acker/start/symbols-outline.nvim/lua/symbols-outline.lua:315: attempt to index field 'view' (a nil value)
stack traceback:
...acker/start/symbols-outline.nvim/lua/symbols-outline.lua:315: in function 'open_outline'
[string ":lua"]:1: in main chunk |
@AniAggarwal I can recreate that error if I comment out all my configuration. Are you not initializing the plugin? You need to explicitly configure this plugin in a file, for example: local status, symbols = pcall(require, "symbols-outline")
if (not status) then return end
symbols.setup({
-- <config from README goes here>
}) |
I am, except I'm just doing it at once as it should be equivalent. Config using packer: use {
"rbjorklin/symbols-outline.nvim",
branch = "fix-outline-detection",
config = function()
require("symbols-outline").setup({ wrap = true })
end,
}
Error with this current setup: Error executing vim.schedule lua callback: ...tart/symbols-outline.nvim/lua/symbols-outline/parser.lua:254: attempt to index a nil value
stack traceback:
...tart/symbols-outline.nvim/lua/symbols-outline/parser.lua:254: in function 'get_lines'
...tart/symbols-outline.nvim/lua/symbols-outline/writer.lua:91: in function 'parse_and_write'
...acker/start/symbols-outline.nvim/lua/symbols-outline.lua:301: in function 'callback'
/opt/nvim/usr/share/nvim/runtime/lua/vim/lsp.lua:1958: in function 'handler'
/opt/nvim/usr/share/nvim/runtime/lua/vim/lsp.lua:1390: in function ''
vim/_editor.lua: in function <vim/_editor.lua:0> EDIT: |
Just to be clear, this plugin doesn't seem to have a working default configuration so you need to provide the entire config block from the README for it to work. |
Oh, I didn't realize that. Packer config: use {
"rbjorklin/symbols-outline.nvim",
branch = "fix-outline-detection",
} Symbols outline config: local status, symbols = pcall(require, "symbols-outline")
if (not status) then return end
symbols.setup({
highlight_hovered_item = true,
show_guides = true,
auto_preview = false,
position = "right",
relative_width = true,
width = 25,
auto_close = false,
show_numbers = false,
show_relative_numbers = false,
show_symbol_details = true,
preview_bg_highlight = "Pmenu",
autofold_depth = nil,
auto_unfold_hover = true,
fold_markers = { "", "" },
wrap = false,
keymaps = { -- These keymaps can be a string or a table for multiple keys
close = { "<Esc>", "q" },
goto_location = "<Cr>",
focus_location = "o",
hover_symbol = "<C-space>",
toggle_preview = "K",
rename_symbol = "r",
code_actions = "a",
fold = "h",
unfold = "l",
fold_all = "W",
unfold_all = "E",
fold_reset = "R",
},
lsp_blacklist = {},
symbol_blacklist = {},
symbols = {
File = { icon = "", hl = "TSURI" },
Module = { icon = "", hl = "TSNamespace" },
Namespace = { icon = "", hl = "TSNamespace" },
Package = { icon = "", hl = "TSNamespace" },
Class = { icon = "𝓒", hl = "TSType" },
Method = { icon = "ƒ", hl = "TSMethod" },
Property = { icon = "", hl = "TSMethod" },
Field = { icon = "", hl = "TSField" },
Constructor = { icon = "", hl = "TSConstructor" },
Enum = { icon = "ℰ", hl = "TSType" },
Interface = { icon = "ﰮ", hl = "TSType" },
Function = { icon = "", hl = "TSFunction" },
Variable = { icon = "", hl = "TSConstant" },
Constant = { icon = "", hl = "TSConstant" },
String = { icon = "𝓐", hl = "TSString" },
Number = { icon = "#", hl = "TSNumber" },
Boolean = { icon = "⊨", hl = "TSBoolean" },
Array = { icon = "", hl = "TSConstant" },
Object = { icon = "⦿", hl = "TSType" },
Key = { icon = "🔐", hl = "TSType" },
Null = { icon = "NULL", hl = "TSType" },
EnumMember = { icon = "", hl = "TSField" },
Struct = { icon = "𝓢", hl = "TSType" },
Event = { icon = "🗲", hl = "TSType" },
Operator = { icon = "+", hl = "TSOperator" },
TypeParameter = { icon = "𝙏", hl = "TSParameter" },
},
}) Error: Error executing vim.schedule lua callback: ...tart/symbols-outline.nvim/lua/symbols-outline/parser.lua:254: attempt to index a nil value
stack traceback:
...tart/symbols-outline.nvim/lua/symbols-outline/parser.lua:254: in function 'get_lines'
...tart/symbols-outline.nvim/lua/symbols-outline/writer.lua:91: in function 'parse_and_write'
...acker/start/symbols-outline.nvim/lua/symbols-outline.lua:301: in function 'callback'
/opt/nvim/usr/share/nvim/runtime/lua/vim/lsp.lua:1958: in function 'handler'
/opt/nvim/usr/share/nvim/runtime/lua/vim/lsp.lua:1390: in function ''
vim/_editor.lua: in function <vim/_editor.lua:0> |
Facing the same issue - were you able to fix this? |
Yes. A few things: Make sure this plugin and nvim treesitter are updated to the lastest version. Furthermore, the config needs to be changed to the following to fit the new namespaces with the latest treesitter update. symbols = require("symbols-outline")
symbols.setup({
highlight_hovered_item = true,
show_guides = true,
auto_preview = false,
position = "right",
relative_width = true,
width = 25,
auto_close = false,
show_numbers = false,
show_relative_numbers = false,
show_symbol_details = true,
preview_bg_highlight = "Pmenu",
autofold_depth = nil,
auto_unfold_hover = true,
fold_markers = { "", "" },
wrap = false,
keymaps = { -- These keymaps can be a string or a table for multiple keys
close = { "<Esc>", "q" },
goto_location = "<Cr>",
focus_location = "o",
hover_symbol = "<C-space>",
toggle_preview = "K",
rename_symbol = "r",
code_actions = "a",
fold = "h",
unfold = "l",
fold_all = "W",
unfold_all = "E",
fold_reset = "R",
},
lsp_blacklist = {},
symbol_blacklist = {},
symbols = {
File = { icon = "", hl = "@text.uri" },
Module = { icon = "", hl = "@namespace" },
Namespace = { icon = "", hl = "@namespace" },
Package = { icon = "", hl = "@namespace" },
Class = { icon = "𝓒", hl = "@type" },
Method = { icon = "ƒ", hl = "@method" },
Property = { icon = "", hl = "@method" },
Field = { icon = "", hl = "@field" },
Constructor = { icon = "", hl = "@constructor" },
Enum = { icon = "ℰ", hl = "@type" },
Interface = { icon = "ﰮ", hl = "@type" },
Function = { icon = "", hl = "@function" },
Variable = { icon = "", hl = "@constant" },
Constant = { icon = "", hl = "@constant" },
String = { icon = "𝓐", hl = "@string" },
Number = { icon = "#", hl = "@number" },
Boolean = { icon = "⊨", hl = "@boolean" },
Array = { icon = "", hl = "@constant" },
Object = { icon = "⦿", hl = "@type" },
Key = { icon = "🔐", hl = "@type" },
Null = { icon = "NULL", hl = "@type" },
EnumMember = { icon = "", hl = "@field" },
Struct = { icon = "𝓢", hl = "@type" },
Event = { icon = "🗲", hl = "@type" },
Operator = { icon = "+", hl = "@operator" },
TypeParameter = { icon = "𝙏", hl = "@parameter" },
},
})
Check out this PR that updates the code in the README if you want to copy it from there instead of my config above: |
I'm still having issues with PHP files… |
Still getting an empty symbol preview even with the config in @AniAggarwal last post with the changes from the PR mentioned there. Using latest versions of both |
The issues should be fixed now |
Still getting an empty current symbol preview. It shows only the top-most elements. Are you able |
Same here. I get empty symbol preview except for the top level.
|
@simrat39 This issue still exists and it should be re-opened. |
I am also now experiencing this issue again and seeing as many others are, I'll reopen it. |
same here |
@RobertLemmens @AniAggarwal @rockyzhang24 @dpetka2001 @pipoprods @simrat39 use({
'enddeadroyal/symbols-outline.nvim', branch = 'bugfix/symbol-hover-misplacement'
}) because The following code has a problem local node = so.state.outline_items[hovered_line] fix is:(reference to hover.lua) local node = so.state.flattened_outline_items[hovered_line] |
@enddeadroyal Thank you for the fix. It works as supposed. Would you be willing to make a PR, so it can get merged upstream hopefully? |
Fix simrat39/symbols-outline.nvim#176 I was going to pull @enddeadroyal's commit from their 'bugfix/symbol-hover-misplacement' branch in their fork but they changed indentation so I had to apply the relevant changes myself instead. However, credits for this fix goes to @enddeadroyal from the issue commit in 176. Also fixed the "No info available" markdown as it wasn't rendering properly for me without a space after the '###'.
When using this plugin, the symbol preview is always empty, regardless of which LSP is used.
Screenshots:
On sumneko_lua:
On Pyright:
On Jdtls:
Let me know if you need any other details on my config.
The text was updated successfully, but these errors were encountered: