autocomplete-swift icon indicating copy to clipboard operation
autocomplete-swift copied to clipboard

Unknown function: autocomplete_swift#jump_to_placeholder

Open pedrofranceschi opened this issue 9 years ago • 5 comments

Hi,

I'm getting this error when running (i.e. <C-K> on insert mode):

Error detected while processing /Users/pedrofranceschi/.dot/vim/plugged/autocomplete-swift/autoload/autocomplete_swift.vim:
line   13:
E122: Function <SNR>118_get_xcode_toolchain already exists, add ! to replace it
Press ENTER or type command to continue
E117: Unknown function: autocomplete_swift#jump_to_placeholder
Press ENTER or type command to continue
E15: Invalid expression: autocomplete_swift#jump_to_placeholder()
Press ENTER or type command to continue

I have no other functions named "s:118_get_xcode_toolchain", plus "autocomplete_swift#jump_to_placeholder" is declared on the plugin itself. I'm loading the plugin and deoplete with Plug:

Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'mitsuse/autocomplete-swift'

SourceKitten, Neovim and Python are installed and working. Neovim:

:version
NVIM 0.1.7
Build type: RelWithDebInfo
Compilation: /usr/local/Homebrew/Library/Homebrew/shims/super/clang -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -g -DDISABLE_LOG -Wall -Wextra -pedantic -Wno-unused-pa
rameter -Wstrict-prototypes -std=gnu99 -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -DHAVE_CONFIG_H -I/tmp/neovim-20161201-87907-4t6ro
1/neovim-0.1.7/build/config -I/tmp/neovim-20161201-87907-4t6ro1/neovim-0.1.7/src -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/
include -I/usr/local/opt/gettext/include -I/usr/include -I/usr/include -I/tmp/neovim-20161201-87907-4t6ro1/neovim-0.1.7/build/src/nvim/auto -I/tmp/neovim-20161201-87907-4t6ro1/ne
ovim-0.1.7/build/include
Compiled by [email protected]

Optional features included (+) or not (-): +acl   +iconv    -jemalloc +tui
For differences from Vim, see :help vim-differences

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/local/Cellar/neovim/0.1.7/share/nvim"

Press ENTER or type command to continue

Any idea why I get this error? Thanks!

pedrofranceschi avatar Dec 26 '16 04:12 pedrofranceschi

@pedrofranceschi Thanks for reporting and sorry, it is a bug. I released the fixed version just now, please update the plugin.

mitsuse avatar Dec 26 '16 13:12 mitsuse

Thanks for the quick update! Now I don't get any errors, but neither I get the autocomplete menu on <C-K>. Nothing happens.

pedrofranceschi avatar Dec 26 '16 16:12 pedrofranceschi

@pedrofranceschi

Please tell me the following two things:

  1. Is <C-K> bound to <Plug>autocomplete_swift_jump_to_placeholder?
  2. What do placeholders look like?

Thanks.

mitsuse avatar Dec 29 '16 08:12 mitsuse

Actually, neither <C-K> (which is bound to <Plug>autocomplete_swift_jump_to_placeholder) nor the regular autocomplete is working. I have a UIViewController subclass and when completing self.xxx only shows previously used methods in the autocomplete, and none of the possible instance methods for a UIViewController (i.e. the plugin seems not to use SourceKitten to generate completion results):

screen shot 2016-12-29 at 2 21 39 pm

Please let me know if you need anything else. Thanks!

pedrofranceschi avatar Dec 29 '16 16:12 pedrofranceschi

@pedrofranceschi

The file is contained in an Xcode project which implements ViewController, isn't it? Autocomplete-swift supports completion only on a single file or file managed in SPM project. If your file is managed with Xcode, completion works on the context of the file.

Completion on Xcode project was experimentally supported in previous release, but the feature was dropped because the completion server has bugs.

<C-K> can be used to jumpt to placeholders like <1:Int> or <#T##Int#>.

If you have other questions/issue, please open a new issue. Thanks!

mitsuse avatar Dec 31 '16 08:12 mitsuse