-
Notifications
You must be signed in to change notification settings - Fork 467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(plugins): add Glance.nvim
#920
Conversation
Maybe a better LSP functions redirecting implementation ---@diagnostic disable: duplicate-set-field
-- Override LSP handler functions
-- stylua: ignore start
vim.lsp.buf.references = function() glance.open('references') end
vim.lsp.buf.definition = function() glance.open('definitions') end
vim.lsp.buf.type_definition = function() glance.open('type_definitions') end
vim.lsp.buf.implementations = function() glance.open('implementations') end
-- stylua: ignore end
---@diagnostic enable: duplicate-set-field |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A little fix of appearance.
|
||
glance.setup({ | ||
height = 20, | ||
zindex = 50, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Catppuccin use darker colors for higher layers.
theme = {
mode = 'darken',
},
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But IMO it would be better to make this slightly brighter cause it would help distinguish the main window from other floating ones.
If the definition target are the current buffer, will glance destroy all keymap in the buffer? I fix lspsaga for this nvimdev/lspsaga.nvim#1188? |
I have used |
That will cause troulbe only in certain case, say you are using a repl should contact to your current buffer or you have some keymap conflict with it, like I set |
Ah sorry I forgot to mention this - I made this change intentionally. But after cfeea4f, indeed it's better to bring the original functionality back. Will push a fix for this. |
@fecet I scanned the source code while setting up this plugin, and I don't think it's an issue b/c Glance works quite similarly to our :noremap <silent> <nowait> <buffer> Q <Cmd>echo 'MSG'<CR> |
Great, I will test if it works will with my repl later |
Co-authored-by: Aaron Pham <29749331+aarnphm@users.noreply.github.com> Signed-off-by: 冷酔閑吟 <50296129+Jint-lzxy@users.noreply.github.com>
I originally thought we were going to use glance to replace the peek function of lspsaga, so my previous concerns were irrelevant. But why not? |
Does it support definition preview? |
Doesn't know now but I used glance to preview definition before switching to lspsaga |
|
glance's |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works on my end
* feat: add `Glance.nvim` * feat(glance): override lsp handler functions * fixup! the spec is missing :'( * fix(Glance): resolve target URI correctly * fix(glance-override): future proof arg from all buf lsp handler Co-authored-by: Aaron Pham <29749331+aarnphm@users.noreply.github.com> Signed-off-by: 冷酔閑吟 <50296129+Jint-lzxy@users.noreply.github.com> * fix CI * fix formatting * feat: use glance to preview definitions * cleanup * style(catppuccin): cleanup --------- Signed-off-by: 冷酔閑吟 <50296129+Jint-lzxy@users.noreply.github.com> Co-authored-by: Aaron Pham <29749331+aarnphm@users.noreply.github.com>
Works for me too. |
#494 (reply in thread)