ycm-core / YouCompleteMe

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

could not import golang.org/x/net/html #3976

Closed avdb13 closed 2 years ago

avdb13 commented 2 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

I was editing a .go file and when I tried to import an external package (golang.org/x/net/html) and then YCM started complaining about not being able to load the module. I tried restarting Vim, creating a local workspace with go mod init foo, go get golang.org/x/net/html, go doc golang.org/x/net/html to see if my go tools weren't broken and reading the error logs with no luck. I expected it to not throw an error, let me read documentation about the package and provide autocompletion.

Diagnostic data

Output of vim --version

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Sep 19 2021 21:30:55)
Included patches: 1-814
Modified by Gentoo-8.2.0814-r100
Compiled by anon@localhost
Huge version with GTK3 GUI.  Features included (+) or not (-):
+acl               -farsi             +mouse_sgr         +tag_binary
+arabic            +file_in_path      -mouse_sysmouse    -tag_old_static
+autocmd           +find_in_path      +mouse_urxvt       -tag_any_white
+autochdir         +float             +mouse_xterm       -tcl
-autoservername    +folding           +multi_byte        +termguicolors
+balloon_eval      -footer            +multi_lang        +terminal
+balloon_eval_term +fork()            -mzscheme          +terminfo
+browse            +gettext           -netbeans_intg     +termresponse
++builtin_terms    -hangul_input      +num64             +textobjects
+byte_offset       +iconv             +packages          +textprop
+channel           +insert_expand     +path_extra        +timers
+cindent           +ipv6              -perl              +title
+clientserver      +job               +persistent_undo   +toolbar
+clipboard         +jumplist          +popupwin          +user_commands
+cmdline_compl     +keymap            +postscript        +vartabs
+cmdline_hist      +lambda            +printer           +vertsplit
+cmdline_info      +langmap           +profile           +virtualedit
+comments          +libcall           -python            +visual
+conceal           +linebreak         +python3           +visualextra
+cryptv            +lispindent        +quickfix          +viminfo
-cscope            +listcmds          +reltime           +vreplace
+cursorbind        +localmap          +rightleft         +wildignore
+cursorshape       -lua               -ruby              +wildmenu
+dialog_con_gui    +menu              +scrollbind        +windows
+diff              +mksession         +signs             +writebackup
+digraphs          +modify_fname      +smartindent       +X11
+dnd               +mouse             +sound             -xfontset
-ebcdic            +mouseshape        +spell             +xim
+emacs_tags        +mouse_dec         +startuptime       +xpm
+eval              -mouse_gpm         +statusline        -xsmp
+ex_extra          -mouse_jsbterm     -sun_workshop      +xterm_clipboard
+extra_search      +mouse_netterm     +syntax            -xterm_save
   system vimrc file: "/etc/vim/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "/etc/vim/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: x86_64-pc-linux-gnu-gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/lib64/libffi/include -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/uuid -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gio-unix-2.0 -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/at-spi-2.0 -pthread    -march=native -O2 -pipe -fstack-protector-strong -fstack-clash-protection -fno-plt -D_REENTRANT  -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: x86_64-pc-linux-gnu-gcc   -Wl,-O1 -L/usr/local/lib -Wl,--as-needed -o gvim   -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0  -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE  -lm -ltinfo -lelf   -lcanberra  -lacl -lattr -ldl     -lpython3.9 -lcrypt -lpthread -ldl -lutil -lm -lm

Printing YouCompleteMe debug information...

-- Resolve completions: Up front
-- Client logfile: /tmp/ycm_ac0f6fu6.log
-- Server Python interpreter: /usr/lib/python-exec/python3.9/python3
-- Server Python version: 3.9.7
-- Server has Clang support compiled in: True
-- Clang version: clang version 12.0.0
-- Extra configuration file found and loaded
-- Extra configuration path: /home/anon/.config/YCM/.ycm_c-c++_conf.py
-- Go completer debug information:
--   gopls running
--   gopls process ID: 26469
--   gopls executable: ['/home/anon/.vim/plugged/YouCompleteMe/third_party/ycmd/third_party/go/bin/gopls', '-logfile', '/tmp/gopls_stderrsdit7yfz.log']
--   gopls logfiles:
--     /tmp/gopls_stderrsdit7yfz.log
--   gopls Server State: Initialized
--   gopls Project Directory: /home/anon/Documents/Programming
--   gopls Settings: {
--   "hoverKind": "Structured"
-- }
-- Server running at: http://127.0.0.1:47449
-- Server process ID: 26363
-- Server logfiles:
--   /tmp/ycmd_47449_stdout_tlv_ifp6.log
--   /tmp/ycmd_47449_stderr_g96x4l8f.log
findlinks1.go|8 col 2 error| could not import golang.org/x/net/html (cannot find package "golang.org/x/net/html" in any of  /usr/lib/go/src/golang.org/x/net/html (from $GOROOT) /home/anon/go/src/golang.org/x/net/html (from $GOPATH))
findlinks1.go|16 col 23 error| visit(nil, doc) (no value) used as value

Output of git rev-parse HEAD in YouCompleteMe installation directory

518275b599ab6dd7844c24022f6aec505fb4b07c

Contents of YCM, ycmd and completion engine logfiles

https://pomf2.lain.la/f/ksah4a0o.7z

OS version, distribution, etc.

Gentoo GNU/Linux with the 5.14.15-gentoo-x86_64 kernel

Output of build/install commands

Include link to a gist containing the invocation and entire output of install.py if reporting an installation issue.

puremourning commented 2 years ago

Please provide steps to reproduce using the minimal vimrc.

puremourning commented 2 years ago

If filing a bug report, I have included a minimal test case that reproduces my issue, using vim -Nu /path/to/YCM/vimrc_ycm_minimal, including what I expected to happen and what actually happened.

avdb13 commented 2 years ago

The bug disappeared suddenly.