Skip to content
This repository was archived by the owner on Oct 24, 2021. It is now read-only.
This repository was archived by the owner on Oct 24, 2021. It is now read-only.

TSImport error #88

@fox-eye

Description

@fox-eye

Warning: I will close the issue without the minimal vimrc and the reproduce ways.

Problems summary

TSImport is not working.
I place cursor under a symbol I want to auto import, type :TSImport

This displays an error and nothing is imported.

error caught in async handler '/Users/fox/.vim/plugged/nvim-typescript/rplugin/python3/nvim-typescript:command:TSImport []' Traceback (most recent call last): File "/Users/fox/.vim/plugged/nvim-typescript/rplugin/python3/nvim-typescript/__init__.py", line 348, in tsimport currentlyImportedItems, lastImportLine = utils.getCurrentImports(self._client, self.relative_file()) File "/Users/fox/.vim/plugged/nvim-typescript/rplugin/python3/nvim-typescript/utils.py", line 86, in getCurrentImports imports = [x for x in client.getDocumentSymbols(inspectedFile)["childItems"] TypeError: list indices must be integers, not str

Expected

I should see an import declaration.

Environment Information

  • terminal: ITerm / zsh
  • vim/nvim version: v0.2.1-dev

Mac OS X 10.13

Provide a minimal vim rc with less than 50 lines (Required!)

" should be always first, use Vim settings instead of VI
set nocompatible

filetype plugin indent on
syntax on

let $NVIM_TUI_ENABLE_TRUE_COLOR=1 " This line enables the true color support.

set number
set backspace=indent,eol,start "Allow backspace in insert mode
set history=200 "command history length
set ruler
set laststatus=2
set visualbell "no sounds
set autoread  "reload files changed outside of vim

" Vim plug - plugins - :PlugInstall to install 
call plug#begin('~/.vim/plugged')
Plug 'scrooloose/nerdtree'
Plug 'kien/ctrlp.vim'
Plug 'mattn/emmet-vim'
Plug 'vim-airline/vim-airline'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-fugitive'
Plug 'airblade/vim-gitgutter'
Plug 'tpope/vim-surround'
Plug 'rakr/vim-one'
Plug 'jlanzarotta/bufexplorer'
Plug 'mhartington/nvim-typescript'
Plug 'brooth/far.vim'
Plug 'HerringtonDarkholme/yats.vim'

if has('nvim')
  Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
else
  Plug 'Shougo/deoplete.nvim'
  Plug 'roxma/nvim-yarp'
  Plug 'roxma/vim-hug-neovim-rpc'
endif

call plug#end()

" Deoplete
let g:deoplete#enable_at_startup = 1

" Python
let g:python3_host_prog = '/Users/fox/.pyenv/versions/neovim3/bin/python'

The reproduce ways from neovim starting

  1. Place cursor on a symbol (like a angular 2 service type declaration in a constructor)
  2. Type :TSImport
  3. See error message as described above

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions