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: add types to lsp-related pickers #3036

Conversation

mikavilpas
Copy link

Description

This change

  • fixes the lua_ls language server not providing some LSP features documentation and autocompletion when I used require("telescope.builtin").lsp_definitions({ jump_type = "vsplit" }) in my config (link to my config: mikavilpas/dotfiles@0f6c0e5)
  • adds working documentation (lsp hover) and autocompletion (lsp) for parameters

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • This change requires a documentation update

How Has This Been Tested?

As the change only changes the lua annotations, I have tested that the LSP features are now available. Details below:

The hover documentation I got before this change

image
I also got no other features such as autocompletion.

The effect after applying the change

Hover documentation now works
image

Autocompletion also works for sum types
image

Configuration:

  • Neovim version (nvim --version): NVIM v0.10.0-dev-2799+ge016f5bee
  • Operating system and version: osx 14.4.1

Checklist:

  • My code follows the style guidelines of this project (stylua)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (lua annotations)

@mikavilpas
Copy link
Author

Just saw there already is #2856 although the contents seem to have a different focus:

  • my PR is only about this one file, the other one is for many other files as well
  • the PRs seem to have a different syntax. I'm not sure if they have the same result or not.

I wonder what would be the best thing to do here. 🙂

@Conni2461
Copy link
Member

unfortunately we decided to build our vimdocumentation based on lua emmy comments, see https://github.com/nvim-telescope/telescope.nvim/blob/master/CONTRIBUTING.md#documentation-with-treesitter

its currently autogenerated and merging this would result in us loosing this feature, which is imo more important than having types for lsp (at this point in time). I know its nice but we basically have redo parts of the grammar and the docgen algorithm or we have to drop docgen.

@mikavilpas
Copy link
Author

I see - this must be the reason I was not getting any help from the LSP. I thought it was a syntax error and "easily fixable" 🙂

I noticed there has already been some interest in adding support for a new grammar tjdevries/tree-sitter-lua#52. If you're open to that idea in the future, it might be a promising option.

But I think that might take weeks or months. I think it's not worth it to keep this open at this point. I'll close these PRs, and in case that future materializes, I can always reopen/redo them.

@mikavilpas mikavilpas closed this Apr 8, 2024
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.

2 participants