Open Integralist opened 2 years ago
I'm trying something like the following within an lsp on_attach but it's not working:
Are you defining such autocommand within the attach? If so, then the autocommand is defined only when LSP is attached, thereby not executed at attach. It should however work if you define it generally (why exactly are you defining it on attach by the way?).
why exactly are you defining it on attach by the way?
So my thinking was that this plugin was only useful when I have an LSP server running on a file, otherwise nothing would happen.
Since seeing your suggestion I tried running :lua require("symbols-outline").open_outline()
on an empty buffer and it didn't complain or error, so I guess it wouldn't matter too much if it's a more general autocommand.
UPDATE: I tried your suggestion and it didn't work for the first file I opened (as the LSP server hadn't started up by the time the 'BufEnter' was first triggered), but it did for the second file I opened (as the LSP server was started). The problem was that when the sidebar opened, the autocommand tried to execute open_outline
inside the sidebar which caused an error.
👋🏻
I'm trying to figure out the best way to trigger
SymbolsOutlineOpen
so that we automatically open the symbols sidebar whenever a buffer is opened or entered.I'm trying something like the following within an lsp on_attach but it's not working: