kiteco / issue-tracker

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

Kite: unable to find a definition. #760

Open JackPanLoveXin opened 3 years ago

JackPanLoveXin commented 3 years ago

I tried to use vim with Kite to jump to the definition of the function, and then I would report this error: Kite: unable to find a definition. The document help will not be displayed when the mouse stays at the function name. Then I tried to use ctags instead, and the result Kite will disable the hotkey ctrl+] of ctags. Faced with such a situation, how can I solve it? kite-vim.log

airblade commented 3 years ago

Thanks for the log file – most helpful.

I tried to use vim with Kite to jump to the definition of the function, and then I would report this error: Kite: unable to find a definition.

Every time you invoked goto-definition, Kite reported:

file not found: /Users/panchaojian/Me/Developer/Private/Python/04_QFDe70/[non-ascii characters].py

I wonder if the problem is the non-ASCII filenames you appear to use; perhaps they are being incorrectly encoded by the vim plugin or Kite somewhere along the way. What alphabet are the filenames in?

The document help will not be displayed when the mouse stays at the function name.

Do you mean that when you move the mouse over a function name, you expect documentation to be displayed but it isn't?

The plugin doesn't support that yet, though if you click on the function name you should see the documentation.

I tried to use ctags instead, and the result Kite will disable the hotkey ctrl+] of ctags.

Kite maps <C-]> if it isn't already mapped so you could keep the original behaviour with this in your vimrc:

:nmap <C-]> :execute "tag" expand("<cword>")<CR>

Alternatively, if you're using a mouse, you can use g<LeftMouse> or <C-LeftMouse>.

JackPanLoveXin commented 3 years ago

Thank you very much for your answer. It is very enlightening and helpful to me. In order to further solve this problem, I tried to create a new .py file on the ASCII path, and I wanted to jump to the print function. , But unfortunately this error is still reported. In addition, I did not find a link to check the detailed documentation of print in the kite window. kite-vim.log Screen Shot 2021-05-22 at 12 16 20 AM

airblade commented 3 years ago

The goto-definition only works for your own code (@metalogical – would you mind confirming that's correct?). print is part of Python's standard library so Kite won't jump to its definition.

I did not find a link to check the detailed documentation of print in the kite window.

Do you mean that the Kite window (in your screenshot) didn't have a link to more detailed documentation for print? Or do you mean that there wasn't a link in Vim which would show print's documentation in the Kite window?

I assume it's the former because in your screenshot the docs are following the cursor so the print docs should show automatically when your cursor is on print in your buffer.

If it's the former, I'll have to pass that question to @metalogical because I don't know whether there should be a link to further documentation.

JackPanLoveXin commented 3 years ago

Yes, my question is the former you are referring to. Is there a way to jump to the definition part of the Python standard library in vim? Although this question has gone beyond kite's answer, I really want to know , If you know, can you tell me? And I am moving the cursor to the function, and there is no link to jump to the kite window around the function. Is this normal? Is it the original way for kite?