delphinus / ddc-ctags

A source for ddc.vim to gather candidates from Universal Ctags
Other
8 stars 1 forks source link

Don't work at present time #2

Closed Jurik-Phys closed 11 months ago

Jurik-Phys commented 11 months ago

After install and setup ddc-ctag gives an error into vim after trying found data for autocomplete (after typing second charset). File 'tags' exists into root of c++/qt project

[ddc] TypeError: source.gather is not a function^@ at callSourceGather (file:///home//.vim/bundle/ddc.vim/denops/ddc/ddc.ts:1290:34)^@ at file:///home//.vim/bundle/ddc.vim/denops/ddc/ddc.ts:307:30^@ at eventL oopTick (ext:core/01_core.js:183:11)^@ at async Promise.all (index 0)^@ at async Ddc.gatherResults (file:///ho...///home//.vim/bundle/ddc.vim/denops/ddc/app.ts#1870.607886:315:5)^@ at async file:///home//.vim/bundle/ddc.vim/denops/ddc/app.ts#1870.607886:200:11^@ at async Lock.lock (https://deno.land/x/async@v2.0.2/lock.ts:51:14)^@ at async Object.onEvent (file:///home//.vim/bundle/ddc.vim/denops/ddc/app.ts#1870.607886:196:7)

Vim - 9.0.1499 deno 1.38.0 (release, x86_64-unknown-linux-gnu) v8 12.0.267.1 typescript 5.2.2 ddc.vim - 2023.07.08; denops.vim - v5.0.0 Universal Ctags 5.9.0, Copyright (C) 2015 Universal Ctags Team

Help me, I need to automatically complete names of methods in my classes

Shougo commented 11 months ago

Unfortunately, this source is too old(it is two years ago). And latest ddc.vim does not support it.

@delphinus Ping.

Shougo commented 11 months ago

Please test this.

https://github.com/delphinus/ddc-ctags/pull/3

Jurik-Phys commented 11 months ago

Please test this.

3

Just nothing

I used Vundle plugin manager

Plugin 'Shougo/ddc.vim'                           
   Plugin 'vim-denops/denops.vim'              
   Plugin 'Shougo/ddc-ui-native'           
   Plugin 'delphinus/ddc-ctags' 
   Plugin 'tani/ddc-fuzzy'

I installed 'delphinus/ddc-ctags' and replace ~/.vim/bundle/ddc-ctags/deonps/@ddc-sources/ctags.ts from pull request

Set sources only 'ctags' call ddc#custom#patch_global('sources', [ 'ctags' ])

Set source options

call ddc#custom#patch_global('sourceOptions', {
   \ '_': {
   \   'matchers': ['matcher_fuzzy'],
   \   'sorters': ['sorter_fuzzy'],
   \   'converters': ['converter_fuzzy', 'converter_remove_overlap' ],
   \ },
   \ 'ctags' : { 
     \ 'mark' : '[C]',
   \ },
   \ })

Also set actual path to 'ctags'

call ddc#custom#patch_global('sourceParams', {
  \ 'ctags': {'executable': '/usr/bin/ctags'},
  \ })

In root of my project I have actual ctag file with name "tags"

When I typing "socket->wr" in projects *.cpp file nothing to do, no pop-up menu.

When I manual pressing <Ctrl-]> internal vim autocomplete arise pop-up menu with "writeData", "writeError", "writeHeaders" and other words for inserted.

Where can I read about debugging this plugin? I don't understand where to look for debugging information about the plugin's operation.

Shougo commented 11 months ago

It worked for me.

set nocompatible

set runtimepath+=~/work/denops.vim
set runtimepath+=~/work/ddc.vim
set runtimepath+=~/work/ddc-ui-native
set runtimepath+=~/work/ddc-filter-matcher_head
set runtimepath+=~/work/ddc-filter-sorter_rank
set runtimepath+=~/src/ddc-ctags

call ddc#custom#patch_global('sources', ['ctags'])
call ddc#custom#patch_global('ui', 'native')
call ddc#custom#patch_global('sourceOptions', {
   \   '_': {
   \     'matchers': ['matcher_head'],
   \     'sorters': ['sorter_rank'],
   \   },
   \   'ctags' : {
   \     'mark' : '[C]',
   \   },
   \ })

call ddc#enable()

cd ~/src/vim
edit src/eval.c

I think you don't set ui option.

Jurik-Phys commented 11 months ago

Hm, work but very strange.

In some case work

After write this post I see that ddc-ctags found other function no "createToyResponse" but "createToy'. All variants of "createToyResponse" was found by ddc-around-sources. Also I see that this function in first place when used native autocomplete by <Ctrl-x><Ctrl-]>. All autocomlete function (createToyResponse, writeHeaders) present in tags file in root of project.

call ddc#custom#patch_global('sources', ['ctags'])

only-ctag

call ddc#custom#patch_global('sources', ['ctags', 'around', 'buffer']) ctag_aroud_buffer

But in some case don't work

delphinus commented 11 months ago

Sorry for late and lacking update. #3 is merged (thx @Shougo). Is the problem solved?

Jurik-Phys commented 11 months ago

Sorry for late and lacking update. #3 is merged (thx @Shougo). Is the problem solved?

No, because I experimented with version from pull request

Shougo commented 11 months ago

@Jurik-Phys the source seems filter the item by the file. To complete A.txt tag, you need to edit A.txt file. And it is different issue. Your original issue(ctags source does not work) is solved. It should be closed.

Shougo commented 11 months ago

If you have another problem, you need to create minimal config with minimal tags and minimal edit file and instructions.