Closed ulises closed 3 years ago
Duplicate of #295
I think we should set imenu-auto-rescan
to t by default for lsp-ui.
Sounds like a good idea! :)
But I'm not sure which hook we should use to reload the imenu entries.
It feel like we have to setup the rule for this... feature?
there is one implementation in lsp-treemacs-symbols which uses a timer. IMO it should be reworked to use lsp-on-idle-hook
Maybe we can add a generic solution that can be used for different use cases.
Should setting imenu-auto-rescan
to t
manually fix this? Because for me doesn't have any effect. Still not auto refreshing.
Should setting imenu-auto-rescan to t manually fix this? Because for me doesn't have any effect. Still not auto refreshing.
Would calling lsp-ui-imenu
again do the trick? 😕 The current implementation should work in this scenario.
yes it does
it is possible to launch it when file is saved in a specific mode (cpp in this case) note the last argument set to true of add-hook in order to apply it to the local-mode and select-window to reset keyboard focus where it was originally
(add-hook 'c++-mode-hook
'(lambda ()
(add-hook 'after-save-hook (lambda ()
(let ((cur-window (selected-window)))
(lsp-ui-imenu)
(select-window cur-window)
)
) 0 t)))
Got it! Thanks for confirming.
I'm working on #515. I think this issue would be resolved after this PR is merged!
After commit 982b4669721c8bcd4dcf2fc100d07824b5d89437. Please customize variable to lsp-ui-imenu-auto-refresh
for this feature! Thanks!
Does lsp-ui-imenu-auto-refresh
care about switching between buffers?
lsp-ui-imenu
is great to quickly see the layout of a Java class however the buffer is not updated once the accompanying buffer changes, i.e. visiting a different class.The
imenu
buffer should auto-update when this happens (like itstreemacs
counterpart).