Skip to content
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

refactor LspHover #1063

Merged
merged 3 commits into from
Feb 22, 2021
Merged

refactor LspHover #1063

merged 3 commits into from
Feb 22, 2021

Conversation

prabirshrestha
Copy link
Owner

@prabirshrestha prabirshrestha commented Jan 31, 2021

  • use callbag
  • use new floating window api with markup content
  • add support for using preview window instead of floating window - LspHover is blank when lsp_preview_float=0 #1047
  • verify bug no longer exists LspHover no longer work #1045
  • verify scroll works - Add scroll keymapping #1058
  • verify complete doc floating window closes when using hover and vice versa
  • verify diagnostics floating window closes when using hover and vice versa. (might need to port diagnostics to floating window api first)
  • double tap support i.e. focus on neovim.

@prabirshrestha
Copy link
Owner Author

@hrsh7th can you have a look at this PR and help convert to the new floating api. We might want to getting the scroll api first.

Few questions.

  1. should we have a high level popup manager api. feel free to propose or send PRs on how you were thinking about it.
  2. similar to floating window api, should we have a preview window api in vim-vital-vs?

@hrsh7th
Copy link
Collaborator

hrsh7th commented Feb 7, 2021

I was considered adding preview-window support in vim-vital-vs but I gave up it.
I didn't found the correct abstraction for it...

Hm... I think if we vim-lsp should support preview-window as a fallback, we should create lsp#internal#ui#preview utility (it only focussing to handle preview window, not a floating window).

@hrsh7th
Copy link
Collaborator

hrsh7th commented Feb 16, 2021

Currently, VS.Vim.Window.FloatingWindow has the following APIs.

new
get_size
set_bufnr
get_bufnr
get_winid
info
set_var
get_var
open
close
enter
is_visible

I think it's difficult to support the same APIs in VS.Vim.Window.SplitedWindow.
I think get_size/info/open` will be a different signature.

If you can allow these differences, I can create SplitedWindow module.

@prabirshrestha
Copy link
Owner Author

I don't think preview and hover can be same api. It should be different.

We can create SplitWindow module. We should have an option to stack at a particular position such as top or bottom.

For now I have been converting everything to callbag api so it becomes easy to refactor.

Now that scroll PR is checked in this should be good to merge and we can move to the new popup api after it.

@prabirshrestha prabirshrestha merged commit a78536a into master Feb 22, 2021
@prabirshrestha prabirshrestha deleted the hover branch February 22, 2021 12:35
@prabirshrestha
Copy link
Owner Author

@hrsh7th Feel free to convert the hover to use the new popup api.

I will work on converting other apis to callbag.

@hrsh7th
Copy link
Collaborator

hrsh7th commented Feb 22, 2021

OK. I will create SplitWindow module (I don't know which is the better name SplitedWindow or SplitWindow).

@rafi
Copy link

rafi commented Feb 24, 2021

This revision stopped hover documentation working for a file with multiple servers, e.g. html & tailwindcss. Previously I could see tailwindcss hover information, now it seems only the first server is queried.

@polyzen polyzen mentioned this pull request Apr 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants