Closed Paul-Aime closed 2 years ago
Can't reproduce.
Workspace: /home/p20aime
Try this in a folder, not $HOME, this will make Pyright to scan the whole $HOME to analyze.
I tried in a custom folder and it is the same. The issue doesn't seem to be related to the analyze, since the problem is recognized as fixed but only the underline remains.
I don't know if it is particular to my installation, I tried with no other plugins than coc
and it is the same:
Plug 'neoclide/coc.nvim', {'branch': 'release'}
let g:coc_global_extensions = ['coc-pyright', 'coc-json']
Is there a way do deactivate the underline / shadowing ... as a quick fix?
Your installation is OK, but I still can't reproduce this.
My tests:
mkdir /tmp/test
cd /tmp/test
python3 -m venv .venv
source .venv/bin/activate
touch bug.py
and vim open itI can reproduce it on a second machine with same installation. I can't reproduce it on a third machine (Android tablet with termux), where there is no underlining for some reason, but when I fix the unused import problem (and not the type error), then the shadowing correctly goes away, although it sometimes goes away for all unused variables, even if still unused (see screenshots).
No underlining | fixing unused os, but re highlighting also goes away | retyping line 6, re shadowed again |
---|---|---|
@Paul-Aime What colorscheme are you using? Does the same problem recur if you change the colorscheme? If you are using nvim-treesitter, please try disabling nvim-treesitter as well.
@yaegassy I am using morhetz/gruvbox
as a plugin, but it seems to have nothing to do with the issue, since if my .vimrc
is strictly reduced to the following, the issue persists:
call plug#begin('~/.vim/plugged')
Plug 'neoclide/coc.nvim', {'branch': 'release'}
let g:coc_global_extensions = ['coc-pyright', 'coc-json']
call plug#end()
@Paul-Aime I've tried it in my environment, but I can't reproduce the problem. I tried it with both Vim8 and Neovim. :(
@yaegassy thank you for your tests. @Paul-Aime what's the output of :CocList extensions
and CocList services
?
I use vim-gtk3
(Ubuntu focal repo).
I updated coc-pyright
but still have the same issue.
:CocCommand pyright.version
[coc.nvim] coc-pyright 1.1.185 with Pyright 1.1.186
:CocList extensions
* coc-pyright 1.1.185 ~/.config/coc/extensions/node_modules/coc-pyright
+ coc-json 1.3.6 ~/.config/coc/extensions/node_modules/coc-json
:CocList services
* pyright [running] python
What's your vim version?
$ vim --version
VIM - Vi IMproved 8.1 (2018 May 18, compiled Sep 20 2021 11:42:42)
Included patches: 1-2269
Modified by team+vim@tracker.debian.org
Compiled by team+vim@tracker.debian.org
Huge version with GTK3 GUI. Features included (+) or not (-):
+acl -farsi -mouse_sysmouse -tag_any_white
+arabic +file_in_path +mouse_urxvt +tcl
+autocmd +find_in_path +mouse_xterm +termguicolors
+autochdir +float +multi_byte +terminal
-autoservername +folding +multi_lang +terminfo
+balloon_eval -footer -mzscheme +termresponse
+balloon_eval_term +fork() +netbeans_intg +textobjects
+browse +gettext +num64 +textprop
++builtin_terms -hangul_input +packages +timers
+byte_offset +iconv +path_extra +title
+channel +insert_expand +perl +toolbar
+cindent +job +persistent_undo +user_commands
+clientserver +jumplist +postscript +vartabs
+clipboard +keymap +printer +vertsplit
+cmdline_compl +lambda +profile +virtualedit
+cmdline_hist +langmap -python +visual
+cmdline_info +libcall +python3 +visualextra
+comments +linebreak +quickfix +viminfo
+conceal +lispindent +reltime +vreplace
+cryptv +listcmds +rightleft +wildignore
+cscope +localmap -ruby +wildmenu
+cursorbind +lua +scrollbind +windows
+cursorshape +menu +signs +writebackup
+dialog_con_gui +mksession +smartindent +X11
+diff +modify_fname +sound -xfontset
+digraphs +mouse +spell +xim
+dnd +mouseshape +startuptime +xpm
-ebcdic +mouse_dec +statusline +xsmp_interact
+emacs_tags +mouse_gpm -sun_workshop +xterm_clipboard
+eval -mouse_jsbterm +syntax -xterm_save
+ex_extra +mouse_netterm +tag_binary
+extra_search +mouse_sgr -tag_old_static
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
system gvimrc file: "$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: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/harfbuzz -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Wdate-time -g -O2 -fdebug-prefix-map=/build/vim-RjZCd2/vim-8.1.2269=. -fstack-protector-strong -Wformat -Werror=format-security -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -Wl,-E -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -o vim -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 -lnsl -lselinux -lcanberra -lacl -lattr -lgpm -ldl -L/usr/lib -llua5.2 -Wl,-E -fstack-protector-strong -L/usr/local/lib -L/usr/lib/x86_64-linux-gnu/perl/5.30/CORE -lperl -ldl -lm -lpthread -lcrypt -L/usr/lib/python3.8/config-3.8-x86_64-linux-gnu -lpython3.8 -lcrypt -lpthread -ldl -lutil -lm -lm -L/usr/lib/x86_64-linux-gnu -ltcl8.6 -ldl -lz -lpthread -lm
I've tested with Vim 8.2, can't reproduce.
So I removed all vim installations and installed vim 8.2 from ppa:jonathonf/vim
and there is no issue anymore
Parts of the code where there is a problem to be fixed are underlined, and variables that are unused are shadowed. This goes away when the problem is fixed, but NOT if there is still other problems to be fixed in the file.
For example, let's take the following file with 2 problems:
The
os
variable is shadowed, anda+b
is underlined.If I fix the error [E] by modifying
b = 2
intob = "bar"
, then the error [E] goes away buta + b
is style underlined.Highlighting becomes OK only if I also fix the [H] problem, or if I reload the file.
Any idea on what's wrong here ?
I also noticed that if only fixing the [E] and writing (
:w
), then reloading (:e
) will correctly remove the underlineda + b
, but undoing (u
) will redo the underlining ofa + b
(and not any other modificaition).Edit: Screenshots:
What's the output of
:CocCommand pyright.version
What's the output of
:CocCommand workspace.showOutput Pyright