ycm-core / YouCompleteMe

A code-completion engine for Vim
http://ycm-core.github.io/YouCompleteMe/
GNU General Public License v3.0
25.44k stars 2.81k forks source link

Completion doesn't work for some third party packages #3664

Closed devanshuDesai closed 4 years ago

devanshuDesai commented 4 years ago

Issue Prelude

Please complete these steps and check these boxes (by putting an x inside the brackets) before filing your issue:

Thank you for adhering to this process! It ensures your issue is resolved quickly and that neither your nor our time is needlessly wasted.

Issue Details

Provide a clear description of the problem, including the following key questions:

  1. Type import torch into vim (or any other third party package)

See suggestions like torch.nn and torch.optim

Suggestions didn't show up

Diagnostic data

Output of vim --version

VIM - Vi IMproved 8.1 (2018 May 18, compiled Jun  9 2019 07:22:39)
macOS version
Included patches: 1-1500
Compiled by Homebrew
Huge version without GUI.  Features included (+) or not (-):
+acl               +extra_search      +mouse_netterm     -tag_old_static
+arabic            -farsi             +mouse_sgr         -tag_any_white
+autocmd           +file_in_path      -mouse_sysmouse    -tcl
+autochdir         +find_in_path      +mouse_urxvt       +termguicolors
-autoservername    +float             +mouse_xterm       +terminal
-balloon_eval      +folding           +multi_byte        +terminfo
+balloon_eval_term -footer            +multi_lang        +termresponse
-browse            +fork()            -mzscheme          +textobjects
++builtin_terms    +gettext           +netbeans_intg     +textprop
+byte_offset       -hangul_input      +num64             +timers
+channel           +iconv             +packages          +title
+cindent           +insert_expand     +path_extra        -toolbar
-clientserver      +job               +perl              +user_commands
+clipboard         +jumplist          +persistent_undo   +vartabs
+cmdline_compl     +keymap            +postscript        +vertsplit
+cmdline_hist      +lambda            +printer           +virtualedit
+cmdline_info      +langmap           +profile           +visual
+comments          +libcall           -python            +visualextra
+conceal           +linebreak         +python3           +viminfo
+cryptv            +lispindent        +quickfix          +vreplace
+cscope            +listcmds          +reltime           +wildignore
+cursorbind        +localmap          +rightleft         +wildmenu
+cursorshape       +lua               +ruby              +windows
+dialog_con        +menu              +scrollbind        +writebackup
+diff              +mksession         +signs             -X11
+digraphs          +modify_fname      +smartindent       -xfontset
-dnd               +mouse             +startuptime       -xim
-ebcdic            -mouseshape        +statusline        -xpm
+emacs_tags        +mouse_dec         -sun_workshop      -xsmp
+eval              -mouse_gpm         +syntax            -xterm_clipboard
+ex_extra          -mouse_jsbterm     +tag_binary        -xterm_save
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/local/share/vim"
Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H   -DMACOS_X -DMACOS_X_DARWIN  -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: clang   -L. -fstack-protector-strong -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib  -L/usr/local/lib -o vim        -lncurses -liconv -lintl -framework AppKit  -L/usr/local/opt/lua/lib -llua5.3 -mmacosx-version-min=10.14 -fstack-protector-strong -L/usr/local/lib  -L/usr/local/Cellar/perl/5.30.0/lib/perl5/5.30.0/darwin-thread-multi-2level/CORE -lperl -lm -lutil -lc  -L/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib/python3.7/config-3.7m-darwin -lpython3.7m -framework CoreFoundation  -lruby.2.6

Output of YcmDebugInfo

Printing YouCompleteMe debug information...
 YcmDebugInfo
Printing YouCompleteMe debug information...
 YcmDebugInfo
 YcmDebugInfo
Printing YouCompleteMe debug information...
-- Completion API: 1
-- Client logfile: /var/folders/j0/8vhbm9ys3dz_mlrctdt87jcr0000gn/T/ycm_7pxx6amn
 YcmDebugInfo
Printing YouCompleteMe debug information...
-- Completion API: 1
-- Client logfile: /var/folders/j0/8vhbm9ys3dz_mlrctdt87jcr0000gn/T/ycm_7pxx6amn
.log
-- Server Python interpreter: /Applications/Xcode.app/Contents/Developer/usr/bin
/python3
-- Server Python version: 3.7.3
-- Server has Clang support compiled in: False
-- Clang version: None
-- No extra configuration file found
-- Python completer debug information:
--   Python interpreter: /Users/devanshu/miniconda3/bin/python
--   Python root: /Users/devanshu/repos/ece_208/homework-3-devanshuDesai
--   Python path: ['/Users/devanshu/miniconda3/lib/python36.zip', '/Users/devans
hu/miniconda3/lib/python3.6', '/Users/devanshu/miniconda3/lib/python3.6/lib-dynl
oad', '/Users/devanshu/.local/lib/python3.6/site-packages', '/Users/devanshu/min
iconda3/lib/python3.6/site-packages', '/Users/devanshu/miniconda3/lib/python3.6/
site-packages/dove-0.1-py3.6.egg']
--   Python version: 3.6.9
--   Jedi version: 0.17.0
--   Parso version: 0.7.0
-- Server running at: http://127.0.0.1:51077
-- Server process ID: 10644
-- Server logfiles:
--   /var/folders/j0/8vhbm9ys3dz_mlrctdt87jcr0000gn/T/ycmd_51077_stdout_ulnwqx8h
.log
--   /var/folders/j0/8vhbm9ys3dz_mlrctdt87jcr0000gn/T/ycmd_51077_stderr_svrunn16
.log```

## Output of `YcmDiags`

No output

## Output of `git rev-parse HEAD` in YouCompleteMe installation directory

7849c8ec5e21ab0ab79e9023e93304f5b7c09159



## OS version, distribution, etc.

> MacOS 10.15.1 Beta
devanshuDesai commented 4 years ago

What's weird is that the completion works just fine for numpy and that's it. No other third party packages have working completion. numpy is installed in the same directory as all other third party packages. I also tried setting up a conf file with no luck. I'm using miniconda3 as my package manager and read through the FAQ already. The packages that don't get completed are installed in: ~/miniconda3/lib/python3.6/site-packages/

bstaletic commented 4 years ago

I've tried to install pytorch globally. Then I tried the following:

import torch
torch. # <- complete here

2020-05-01-025806_1600x900_scrot

Keep in mind that pytorch is complex and will slow jedi down. Can you provide a minimal repro?

devanshuDesai commented 4 years ago

Never mind. My suggestions are all working correctly now (including torch) after restarting my terminal. Closing the issue.