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

supporting kind information to auto-complete for LSP like output #4

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

akh2008
Copy link

@akh2008 akh2008 commented May 20, 2022

Parse the additional info for autocompletion, so that pop-up window can display the detail as help and Kind info like Function, struct, property, macro, method etc similar to LSP. The enhanced omnicompletion is inspired from coq.thirdparty omnicompletion.

Autocompletion after the fix.
Screenshot 2022-05-12 at 11 47 44 AM

Prior to fix:
Screenshot 2022-05-12 at 11 50 01 AM

@RaafatTurki
Copy link

RaafatTurki commented Aug 6, 2022

I've done a hacky little thing in the cmp format function to improve omnifunc a bit

before:
image
after:
image

format = function(entry, vim_item)
  if entry.source.name == 'omni' then
    if entry.completion_item.documentation == nil then
      entry.completion_item.documentation = vim_item.menu
      vim_item.menu = nil
    end
    vim_item.kind = 'Ω'
    vim_item.kind_hl_group = 'CmpItemKindProperty'
  else
    -- set vim_item.kind to an lsp related icon depending on vim_item.kind
  end

  return vim_item
end

@hrsh7th
Copy link
Owner

hrsh7th commented Nov 16, 2022

Out of curiosity, why not use the cmp-nvim-lsp sources?


return acc
end)()
local completefunc_items = function(matches)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this function does not support string[] and { word: string}[] forms.

What omnifunc did you test with?
I think the error occurs in omnifunc outside the test scope.

@wookayin
Copy link

I think this feature can be useful for treesitter omnifunc completion (try :PreviewQuery). It requires some rebase and fix applied, such as #6 (01f0f66). @akh2008 Would you want to work on rebasing and wraping it up? I can help and provide some reviews.

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.

4 participants