uga-rosa / ddu-source-lsp

Ddu source for lsp.
MIT License
20 stars 6 forks source link

Cannot gether candidate by lsp_definition with vim-lsp #30

Closed nekowasabi closed 1 year ago

nekowasabi commented 1 year ago

Environment

Description

Cannot gather candidate by lsp_definition with vim-lsp. But enable gather canddidate by lsp_documentSymbol.

slack URL

https://vim-jp.slack.com/archives/CLKR04BEF/p1699429772613499

minimal vimrc

if &compatible
  set nocompatible               " Be iMproved
endif

if empty(glob('~/.config/nvim/autoload/plug.vim'))
  silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
       \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  autocmd VimEnter * PlugInstall | source $MYVIMRC
endif

call plug#begin('~/.config/nvim/plugged')
Plug 'vim-denops/denops.vim'
Plug 'prabirshrestha/vim-lsp'
Plug 'mattn/vim-lsp-settings'
Plug 'Shougo/ddu.vim'
Plug 'Shougo/ddu-ui-ff'
Plug 'Shougo/ddu-kind-file'
Plug 'Shougo/ddu-filter-matcher_substring'
Plug 'uga-rosa/ddu-source-lsp'
call plug#end()

call ddu#custom#patch_global(#{
            \   ui: 'ff',
            \ })

call ddu#custom#paaatch_global(#{
            \   kindOptions: #{
            \     file: #{
            \       defaultAction: 'open',
            \     },
            \   }
            \ })

call ddu#custom#patch_global(#{
            \   sourceOptions: #{
            \     _: #{
            \       matchers: ['matcher_substring'],
            \     },
            \   }
            \ })

let g:ddu_source_lsp_clientName = 'vim-lsp'
call ddu#custom#patch_global(#{
      \ kindOptions: #{
      \   lsp: #{
      \     defaultAction: 'open',
      \   },
      \   lsp_codeAction: #{
      \     defaultAction: 'apply',
      \   },
      \ },
      \})

nnoremap <silent> O 
    \ <Cmd>call ddu#start(#{
    \ sync: v:true,
    \ sources: [#{
    \   name: 'lsp_documentSymbol',
    \ }],
    \ uiParams: #{
    \   ff: #{
    \     immediateAction: 'open',
    \   },
    \ }
    \})<CR>

Reproduce process

  1. Open neovim
  2. execute :PlugUpdate<CR>
  3. Open code(see example)
  4. Type O aaaa

example

<?php

class A
{
    public function __construct()
    {
    }

    /**
     * @return string
     */
    public function aaa()
    {
        return 'ok';
    }

    public function bbb()
    {
        return 'no';
    }
}

$obj = new A();
nekowasabi commented 1 year ago

Sorry, It's my environment mistake.