kiteco / issue-tracker

User-reported issues for Kite
https://Kite.com
1.75k stars 136 forks source link

Enabling all languages turns off all languages #682

Open nschurmann opened 3 years ago

nschurmann commented 3 years ago

When I try to enable all supported languages:

" kite
let g:kite_supported_languages = ['*']

Then all languages are turned off, I need to manually specify them:

let g:kite_supported_languages = ['javascript', 'python']

in order to make them work.

airblade commented 3 years ago

Are you on v1.0.74+ ? You can check with :echo kite#utils#plugin_version().

When that variable is set to ['*'] and you're in a Python or JavaScript file, what do these two echo statements produce?

:echo kite#languages#supported_by_plugin()
:echo kite#languages#supported_by_kited()
nschurmann commented 3 years ago

Not really, I'm on 1.0.73, I'm using the Kite GUI to install the plugins, I've tried with Vim and Neovim plugin, it seems that both install version 1.0.73

airblade commented 3 years ago

@jansorg How can one get Kite to update the plugins?

nschurmann commented 3 years ago

I did a manual install, I’m also using it together with COC, I think the plug-in auto update it’s not working as stated in the docs, I also think the docs may be out of date. Like the goto definition. Can we get that updated? Is a bit confusing.

airblade commented 3 years ago

Currently the Kite plugin doesn't integrate with COC but I believe @metalogical is working on that.

Regarding goto definition, please could you detail what you expect to happen and what actually happens?

nschurmann commented 3 years ago

About kite and COC, they do work together and pretty well I must say (I pulled the master branch though instead of using kite plugin manager), however there is a warning message every time that I open a file with kite and COC support. You may find the message here: https://github.com/kiteco/vim-plugin/blob/fd5ae30f8917a8760c1d738e302dd9672b664e41/autoload/kite.vim#L233

As for the goto definition, I expect the same behaviour as coc definition

nmap <silent> gd <Plug>(coc-definition)

If you position the cursor on a function call and then I press gd, I expect it to take me to the file where the function was defined, but if it was defined on the same file, a jump to the function in the same file will work too. I think it only works for python but not for javascript, as is stated in a warning message.

That is a main feature that keeps me using coc with kite. I also have this in my vim config:

" Use <c-space> to trigger completion.
if &filetype == "javascript" || &filetype == "python"
  inoremap <c-space> <C-x><C-u>
else
  inoremap <silent><expr> <c-space> coc#refresh()
endif

So I can have kite on my supported files and COC on the rest, I think for neovim there's only support for python and javascript

airblade commented 3 years ago

... there is a warning message every time that I open a file with kite and COC support

We thought that until we had a good way to feed Kite's completions to COC, COC's completions would conflict with Kite's. So we put up a warning.

However we would like to allow users to set up a Kite as a completion source for COC, if they want to. Is that what you have done?

If you position the cursor on a function call and then I press gd, I expect it to take me to the file where the function was defined, but if it was defined on the same file, a jump to the function in the same file will work too.

That's what this plugin should do, though I chose to map <C-]> instead of gd or gD (https://github.com/kiteco/vim-plugin/issues/291#issuecomment-664320435). You can use gd instead by putting this in your vimrc:

nmap <silent> gd :KiteGotoDefinition<CR>

Thanks for the ctrl-space snippet!

jansorg commented 3 years ago

Kite's way to update the vim-plugin is to start the Copilot, click settings and then "Update" in the Plugins tab. Published releases might be delayed compared to manual installation and updating via git.

joaoruntime commented 3 years ago

Same behavior as nschurmann with kite_supported_languages... How to add c and c++ let g:kite_supported_languages = ['c', 'c++'] ??

airblade commented 3 years ago

@joaopixeles let g:kite_supported_languages = ['c', 'cpp']. The list values are vim filetypes.

airblade commented 3 years ago

@nschurmann Have you managed to upgrade the plugin yet?

Jack-lss commented 3 years ago

Use the tips from the following URL:https://github.com/kiteco/vim-plugin/blob/master/DEVELOPMENT.md to update kite.vim.

Starslayerx commented 3 years ago

I got same issue, when using coc together with kite.(kite will disable coc) Now I'm using coc.kite.Is there and difference with kite?

airblade commented 3 years ago

@Starslayerx Have you seen the info on running Kite with CoC?

Also, does commenting out these lines help?

https://github.com/kiteco/vim-plugin/blob/bdf7f549fa6c03e0afd8bfee4c48e7a8b1e4f168/autoload/kite.vim#L234-L240

@metalogical Do you know what coc-kite does?

metalogical commented 3 years ago

I have no idea if coc-kite does anything fancier than the manual configuration. At some point we may also publish a coc plugin, but coc-kite appears to be a 3rd party integration and I can't find the source anywhere.

Re-awake commented 3 years ago

I write let g:kite_supported_languages = ['cpp']. in .vimrc but it doesn't work. I also write let g:kite_supported_languages = ['*']. in .vimrc but all types completion seem to be turned off. Only let g:kite_supported_languages = ['c', 'python','java']. can work correctly. How can I solve this problem? Thanks.

airblade commented 3 years ago

@Re-awake what version of the plugin are you on? :echo kite#utils#plugin_version()

Re-awake commented 3 years ago

@Re-awake what version of the plugin are you on? :echo kite#utils#plugin_version()

In MacVim, it's 1.0.73.

airblade commented 3 years ago

@Re-awake Thanks. You need 1.0.74 for this to work.

Re-awake commented 3 years ago

@Re-awake Thanks. You need 1.0.74 for this to work.

The Kite doesn't update it automatically. How can I get 1.0.74? I am looking forward to it.

airblade commented 3 years ago

See https://github.com/kiteco/vim-plugin/issues/320#issuecomment-734901214.

Re-awake commented 3 years ago

See #320 (comment).

Thanks.