Quramy / tsuquyomi

A Vim plugin for TypeScript
http://www.vim.org/scripts/script.php?script_id=5151
1.39k stars 72 forks source link

Not an editor command: TsuRenameSymbol #224

Open rachaeldawn opened 6 years ago

rachaeldawn commented 6 years ago

Basically all of the Tsu commands excluding the status, restart, stopping, and start of the server do not exist as commands.

I'm using Vundle to install this, gVim on Windows (and MacVim) with the same VimRC. I'm not entirely certain what is causing these to not exist, as the completions work just fine. Any help would be great 😄

set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
set encoding=utf8

call vundle#begin()

  Plugin 'dracula/vim'
  Plugin 'vim-airline/vim-airline'
  Plugin 'scrooloose/nerdtree'
  Plugin 'yuttie/comfortable-motion.vim'
  Plugin 'vim-scripts/greenvision'

  " Typescript plugins
  Plugin 'leafgarland/typescript-vim'
  Plugin 'Quramy/vim-js-pretty-template'
  Plugin 'jason0x43/vim-js-indent'
  Plugin 'mattn/emmet-vim'
  Plugin 'Valloric/YouCompleteMe'
  Plugin 'Shougo/vimproc.vim'
  Plugin 'Quramy/tsuquyomi'

  " Code Formatting tools
  Plugin 'google/vim-maktaba'
  Plugin 'google/vim-codefmt'
  Plugin 'google/vim-glaive'

  " Extra languages
  Plugin 'cakebaker/scss-syntax.vim'

call vundle#end()

colors dracula
set tabstop=2
set expandtab
set shiftwidth=2
set number
set backspace=indent,eol,start
set mouse=a
syntax on
if !exists("g:ycm_semantic_triggers")
  let g:ycm_semantic_triggers = {}
endif
let g:ycm_semantic_triggers['typescript'] = ['.']
set omnifunc=syntaxcomplete#Complete
set guioptions=
set guifont=Fira_Code:h10
set wrap!
set nowrap
set wildignore+=*.pyc,*.o,*.obj,*.svn,*.swp,*.class,*.hg,*.DS_Store,*.min.*      
let NERDTreeIgnore=[ '\~$', '__pycache__', 'node_modules' ]
set smartindent

let g:NERDTreeMouseMode=2
map <F1> :NERDTree<CR>
map <F2> :NERDTree %<CR>
let g:tsuquyomi_completion_detail = 1
nickspoons commented 6 years ago

The Tsu commands get loaded when you open a .ts file.

I'm not sure but I suspect your completion is working because it's being done independently by YCM, without using tsuquyomi

rachaeldawn commented 6 years ago

@nickspoons I believe it is the Tsuquyomi providing the completions, since the completion detail var does change the details of the popup menu. But what throws me for a loop is when I run the TsuStatusServer, it says dead (with a change in popup behavior), and running it before opening a .ts file doesn't fix the behavior.

nickspoons commented 6 years ago

OK that's good to know.

And do you have the Tsu commands (e.g. TsuOpen) when inside a .ts buffer?

If not, is anything getting logged to your messages? (:messages) What is the value of :let g:tsuquyomi_is_available? What is the ouput of :echo tsuquyomi#config#tsscmd()? Is typescript/tsserver installed globally? (i.e. with npm i -g typescript) Is typescript/tsserver installed in a local node_modules? If so, try setting let g:tsuquyomi_use_local_typescript = 1

rachaeldawn commented 6 years ago

Note: I reloaded MacVim, navigated to the dir, and ran TsuStartServer

If not, is anything getting logged to your messages? (:messages)
Messages maintainer: Bram Moolenaar <Bram@vim.org>
/Users/jschmold/Documents/<DIR>/App
"imports/api/accounts/server/index.ts" 213L, 5768C
E492: Not an editor command: TsuRenameSymbol
E492: Not an editor command: TsuOpen
What is the value of :let g:tsuquyomi_is_available?
> #1
What is the ouput of :echo tsuquyomi#config#tsscmd()?
> tsserver
Is typescript/tsserver installed globally? (i.e. with npm i -g typescript)
> tsc --version: 2.8.1
nickspoons commented 6 years ago

Navigated how? What's your workflow? Are you running vim in the same directory as your tsconfig? :pwd?

rachaeldawn commented 6 years ago

Opened Vim, used cd to navigate in. :pwd gives /Users/jschmold/Documents/<DIR>/App (

to shorten), and the TSConfig is in the root of that folder

nickspoons commented 6 years ago

Well everything sounds OK, I'm out of ideas. Perhaps just jump into the source and add some debug flags? Like add a echom 'initBuffer' to line 291 of autoload/tsuquyomi/config.vim, and add echom 'createBufLocalCommand' to line 180

rachaeldawn commented 6 years ago

I'm not even getting any output from that. Is there something weird with Vundle? Even doing gvim . in the directory I want doesn't make it load, and no debug messages either

nickspoons commented 6 years ago

You could put debug messages earlier in the stack. The first place is ftplugin/typescript/tsuquyomi.vim - perhaps try adding several echoms in there - as the first line, before and after the if block

All this should be triggered as soon as you load a typescript file. So open a .ts file and check your filetype is correct with :verbose set filetype?

simianhacker commented 6 years ago

I'm also having issues with this, I'm using Neovim. I've never been able to get :TsuRenameSymbol to show up in the commands. I've tried everything in this tread to no avail.

andrewgregorywright commented 5 years ago

Try typing :filetype to make sure that Plugin: ON is displayed. If not, enter the command :filetype plugin on towards the end of your ~/.vimrc file. Then restart vim. Try opening a .ts file and typing :command. The majority of Tsu* related commands should be loaded.

MadBrozzeR commented 5 years ago

@andrewgregorywright Thank you! Fixed this problem for me.