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

Help: include signature info in completion menu? #148

Closed
valentin-krasontovitsch opened this issue Jan 14, 2024 · 3 comments
Closed

Help: include signature info in completion menu? #148

valentin-krasontovitsch opened this issue Jan 14, 2024 · 3 comments

Comments

@valentin-krasontovitsch

Problems summary

I would like to see function signatures in completion menu when using nvim-lsp source with ddc, and cannot figure out how to achieve this.

I'm sorry for bothering you, but after many hours of trying many things I cannot figure this out. Looking at omnifunc completion menu (triggered by C-x C-o), there are function signatures, but with ddc (with native interface) these are not there. you only have name, type, and mark.

I'm aware of the popup preview (matsui54/denops-popup-preview.vim), but i would like to see all signatures immediately. I have tried the pum UI, but did not find options for adding more columns (or at least could not figure it out).

I have to say that I'm a noob when it comes to the inner working of vim or nvim, and plugins, and lsp in vim, ... so I'm sorry if this is a silly question. it seems like it should be possible though, based on recording from @amikai in screenshot issue - but even studying his vim config, I could not see the trick : (

Expected

(option to) show function signatures in completion menu when using nvim-lsp source

Environment Information

  • ddc.vim version (SHA1): abe8c86

  • denops.vim version (SHA1): 83f167b034e9e56913d8a89b026a6b0eb79b52b4

  • deno version(deno -V output): deno 1.39.2

  • OS: MacOS Sonoma 14.2.1

  • neovim/Vim :version output:
    NVIM v0.9.5
    Build type: Release
    LuaJIT 2.1.1703358377

Provide a minimal init.vim/vimrc without plugin managers (Required!)

vim.cmd('set nocompatible') -- be iMproved

vim.cmd([[ set runtimepath+=~/.cache/dein/repos/github.com/neovim/nvim-lspconfig/ ]])
vim.cmd([[ set runtimepath+=~/.cache/dein/repos/github.com/vim-denops/denops.vim ]])
vim.cmd([[ set runtimepath+=~/.cache/dein/repos/github.com/Shougo/ddc.vim ]])
vim.cmd([[ set runtimepath+=~/.cache/dein/repos/github.com/Shougo/ddc-ui-native ]])
vim.cmd([[ set runtimepath+=~/.cache/dein/repos/github.com/Shougo/ddc-matcher_head ]])
vim.cmd([[ set runtimepath+=~/.cache/dein/repos/github.com/Shougo/ddc-sorter_rank ]])
vim.cmd([[ set runtimepath+=~/.cache/dein/repos/github.com/Shougo/ddc-source-lsp ]])

vim.call('ddc#enable')

lspconfig = require('lspconfig')
local capabilities = require("ddc_source_lsp").make_client_capabilities()
lspconfig.gopls.setup{
	capabilities = capabilities,
}

vim.call('ddc#custom#patch_global', 'ui', 'native')
vim.call('ddc#custom#patch_global',
  'sourceOptions', {_ = {matchers = {'matcher_head'}}})
vim.call('ddc#custom#patch_global',
  'sourceOptions', {_ = {sorters = {'sorter_rank'}}})
vim.call('ddc#custom#patch_filetype', 'go',
  'sources', {'lsp'})
vim.call('ddc#custom#patch_filetype', 'go',
  'sourceOptions', {
    ['lsp'] = {
      mark = '[LSP]',
      forceCompletionPattern = {[[\.\w*]]}
    }
  })

How to reproduce the problem from neovim/Vim startup (Required!)

  1. open for instance following go file with nvim -u [path_to_minimal_config]:
package main

import (
	"fmt"
)

func main() {
}
  1. Start typing in the main func: fmt.Pr
  2. Wait for completions menu

Screenshot (if possible)

  1. with ddc
Screenshot 2024-01-14 at 23 20 26
  1. with omnifunc from nvim-lsp
Screenshot 2024-01-14 at 23 20 20
@Shougo
Copy link
Owner

Shougo commented Jan 15, 2024

Sorry. It is not ddc.vim's issue. It should be ddc-source-lsp issue.

https://github.com/Shougo/ddc-source-lsp/issues

@Shougo
Copy link
Owner

Shougo commented Jan 15, 2024

Please use enableDisplayDetail param.

@valentin-krasontovitsch
Copy link
Author

thank you so much, genious : )

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

No branches or pull requests

2 participants