puremourning / vimspector

vimspector - A multi-language debugging system for Vim
http://puremourning.github.io/vimspector-web
Apache License 2.0
4.1k stars 173 forks source link

E492: Not an editor command: VimspectorInstall #438

Closed luisdavim closed 3 years ago

luisdavim commented 3 years ago

Describe the bug

The README mentions commands like VimspectorInstall but non seems to work, if I try them I get something like E492: Not an editor command: VimspectorInstall I have installed the plugin using vim-plug https://github.com/luisdavim/dotfiles/blob/master/files/vim/config/01.plugins.vim#L102-L109

Minimal reproduciton

List of steps to reproduce:

  1. Run vim ---clean Nu /path/to/vimspector/support/minimal_vimrc
  2. type :VimspectorInstall

Expected behaviour

I would expect commands like VimspectorInstall and VimspectorUpdate to work from any place.

Actual behaviour

The commands are not found.

There's no logs because I didn't start a debug sessions.

Environemnt

I'm using neovim on macOS but I can reproduce the issue with vim as well

git rev-parse HEAD
57ce0992803fcf22c0557550fff45e3fe869f70
E492: Not an editor command: VimspectorDebugInfo
vim --version
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Aug 10 2021 19:39:20)
macOS version - x86_64
Included patches: 1-3325
Compiled by Homebrew
Huge version without GUI.  Features included (+) or not (-):
+acl               +file_in_path      +mouse_urxvt       -tag_any_white
+arabic            +find_in_path      +mouse_xterm       -tcl
+autocmd           +float             +multi_byte        +termguicolors
+autochdir         +folding           +multi_lang        +terminal
-autoservername    -footer            -mzscheme          +terminfo
-balloon_eval      +fork()            +netbeans_intg     +termresponse
+balloon_eval_term +gettext           +num64             +textobjects
-browse            -hangul_input      +packages          +textprop
++builtin_terms    +iconv             +path_extra        +timers
+byte_offset       +insert_expand     +perl              +title
+channel           +ipv6              +persistent_undo   -toolbar
+cindent           +job               +popupwin          +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        +mksession         +smartindent       -X11
+diff              +modify_fname      -sodium            -xfontset
+digraphs          +mouse             -sound             -xim
-dnd               -mouseshape        +spell             -xpm
-ebcdic            +mouse_dec         +startuptime       -xsmp
+emacs_tags        -mouse_gpm         +statusline        -xterm_clipboard
+eval              -mouse_jsbterm     -sun_workshop      -xterm_save
+ex_extra          +mouse_netterm     +syntax
+extra_search      +mouse_sgr         +tag_binary
-farsi             -mouse_sysmouse    -tag_old_static
   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@1.1/lib -L/usr/local/opt/readline/lib -L/usr/local/lib -o vim -lm -lncurses -liconv -lintl -framework AppKit -L/usr/local/opt/lua/lib -llua5.4 -mmacosx-version-min=11.3 -fstack-protector-strong -L/usr/local/lib -L/usr/local/Cellar/perl/5.34.0/lib/perl5/5.34.0/darwin-thread-multi-2level/CORE -lperl -L/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/config-3.9-darwin -lpython3.9 -framework CoreFoundation -lruby.3.0 -L/usr/local/Cellar/ruby/3.0.2/lib
nvim --version
NVIM v0.5.0
Build type: Release
LuaJIT 2.1.0-beta3
Compilation: clang -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -O2 -DNDEBUG -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/tmp/neovim-20210702-14987-rep9di/neovim-0.5.0/build/config -I/tmp/neovim-20210702-14987-rep9di/neovim-0.5.0/src -I/usr/local/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/usr/local/opt/gettext/include -I/tmp/neovim-20210702-14987-rep9di/neovim-0.5.0/build/src/nvim/auto -I/tmp/neovim-20210702-14987-rep9di/neovim-0.5.0/build/include
Compiled by brew@BigSur

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/local/Cellar/neovim/0.5.0/share/nvim"

Run :checkhealth for more info
which nvim
/usr/local/bin/nvim
which vim
/usr/local/bin/vim
3.9.6 (default, Jun 29 2021, 05:25:02)                                                                                                                                                                                                                                                                                                                                                      
[Clang 12.0.5 (clang-1205.0.22.9)]
no output
Traceback (most recent call last):                                                                                                                                                                                                                                                                                                                                                          
  File "<string>", line 1, in <module>                                                                                                                                                                                                                                                                                                                                           
ModuleNotFoundError: No module named 'vimspector'
Press ENTER or type command to continue

health#floaterm#check
========================================================================
## common
  - INFO: Platform: macos
  - INFO: Nvim: NVIM v0.5.0
  - INFO: Plugin: 9716765

## terminal
  - OK: Terminal emulator is available

## floating
  - OK: Floating window is available

health#coc#check
========================================================================
  - OK: Environment check passed

  - OK: Javascript bundle build/index.js found
  - OK: Service started

health#nvim#check
========================================================================
## Configuration
  - OK: no issues found

## Performance
  - OK: Build type: Release
    LuaJIT

## Remote Plugins
  - OK: Up to date

## terminal
  - INFO: key_backspace (kbs) terminfo entry: key_backspace=^H
  - INFO: key_dc (kdch1) terminfo entry: key_dc=\E[3~
  - INFO: $TERM_PROGRAM='tmux'
  - INFO: $COLORTERM='truecolor'

## tmux
  - OK: escape-time: 10
  - INFO: Checking stuff
  - OK: focus-events: on
  - INFO: $TERM: xterm-256color
  - ERROR: $TERM should be "screen-256color" or "tmux-256color" in tmux. Colors might look wrong.
    - ADVICE:
      - Set default-terminal in ~/.tmux.conf:
          set-option -g default-terminal "screen-256color"
      - https://github.com/neovim/neovim/wiki/FAQ

health#provider#check
========================================================================
## Clipboard (optional)
  - OK: Clipboard tool found: pbcopy

## Python 2 provider (optional)
  - INFO: pyenv: Path: /usr/local/Cellar/pyenv/2.0.4/libexec/pyenv
  - INFO: pyenv: $PYENV_ROOT is not set. Infer from `pyenv root`.
  - WARNING: pyenv: Root does not exist: /Users/luisdavim/.pyenv. Ignoring pyenv for all following checks.
  - WARNING: No Python executable found that can `import neovim`. Using the first available executable for diagnostics.
  - ERROR: Python provider error:
    - ADVICE:
      - provider/pythonx: Could not load Python 2:
          /usr/bin/python2 does not have the "neovim" module. :help |provider-python
|          /usr/bin/python2.7 does not have the "neovim" module. :help |provider-python
|          python2.6 not found in search path or not executable.
          /usr/local/opt/python/libexec/bin/python is Python 3.9 and cannot provide Python 2.
  - INFO: Executable: Not found

## Python 3 provider (optional)
  - INFO: pyenv: Path: /usr/local/Cellar/pyenv/2.0.4/libexec/pyenv
  - INFO: pyenv: $PYENV_ROOT is not set. Infer from `pyenv root`.
  - WARNING: pyenv: Root does not exist: /Users/luisdavim/.pyenv. Ignoring pyenv for all following checks.
  - INFO: `g:python3_host_prog` is not set.  Searching for python3 in the environment.
  - INFO: Multiple python3 executables found.  Set `g:python3_host_prog` to avoid surprises.
  - INFO: Executable: /usr/local/bin/python3
  - INFO: Other python executable: /usr/bin/python3
  - INFO: Python version: 3.9.6
  - INFO: pynvim version: 0.4.3
  - OK: Latest pynvim is installed.

## Python virtualenv
  - OK: no $VIRTUAL_ENV

## Ruby provider (optional)
  - INFO: Ruby: ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-darwin20]
  - WARNING: `neovim-ruby-host` not found.
    - ADVICE:
      - Run `gem install neovim` to ensure the neovim RubyGem is installed.
      - Run `gem environment` to ensure the gem bin directory is in $PATH.
      - If you are using rvm/rbenv/chruby, try "rehashing".
      - See :help |g:ruby_host_prog| for non-standard gem installations.

## Node.js provider (optional)
  - INFO: Node.js: v16.6.1
  - WARNING: Missing "neovim" npm (or yarn) package.
    - ADVICE:
      - Run in shell: npm install -g neovim
      - Run in shell (if you use yarn): yarn global add neovim

## Perl provider (optional)
  - ERROR: perl provider error:
    - ADVICE:
      - "Neovim::Ext" cpan module is not installed

health#treesitter#check
========================================================================
## Checking treesitter configuration
  - INFO: Runtime ABI version : 13
macOS 11.5.1 20G80 x86_64

Declaration

puremourning commented 3 years ago

You’re saying that with the minimal vimrc you get not vimspector but also no errors?

can you record an asciinema showing that? I’m pretty baffled why that might be!

luisdavim commented 3 years ago

vimspector seems to work, for example, I can press <F5> and start a debugging session but my vim doesn't recognise/find any of the commands the plugin provides....

luisdavim commented 3 years ago

sorry, my bad, I think the problem was vim-plug lazy loading and the plugin not being loaded on certain buffers. I'm sorry to have wasted your time.

puremourning commented 3 years ago

the problem was vim-plug lazy loading

I don't understand how that can have possibly affected the minimal vimrc reproduction.

luisdavim commented 3 years ago

yeah, that's right maybe there is a problem there.

puremourning commented 3 years ago

only if you actually performed the test per the instructions, which I kinda doubt tbh. If you can record a asciienma showing it then I can believe it ;)

List of steps to reproduce:

Run vim ---clean Nu /path/to/vimspector/support/minimal_vimrc type :VimspectorInstall

naturally, I can't reproduce (after correcting the command line above to vim --clean -Nu ...

puremourning commented 3 years ago

you copied the incorrect command line - please use the correct command. You have like vim ---clean Nu not vim --clean -Nu

luisdavim commented 3 years ago

image