Giter Site home page Giter Site logo

nvim-typescript's Introduction

Nvim-Typescript

DEPRECATED

The time has finally come. Since Neovim 0.5 is out, and LSP is officially supported, I'd suggest you migrate over to it. I have been using it instead of this plugin for a while and it solves many pain points that I've not been able to. This will stay around for older neovim release, but everyone should upgrade. Thanks for the support and for using this plugin ๐Ÿš€

nvim language service plugin for typescript

Installation

First make sure you have Neovim 0.3.8 or higher. This includes the node-host that is required for this plugin.

You will need a global install of the neovim client as well. This will make sure that neovim and node can communicate.

npm install -g neovim

After installing the neovim client, you will have to run :UpdateRemotePlugins.

You might want to also have typescript install globally. By default, this plugin will look in your node_modules folder first for typescript, but if that does not exist, it will use the global install.

npm -g install typescript

Then add the following plugins. This example shows Dein.vim and Plug.vim, but any plugin manager will work.

 " Dein
 # REQUIRED: Add a syntax file. YATS is the best
  call dein#add('HerringtonDarkholme/yats.vim')
  call dein#add('mhartington/nvim-typescript', {'build': './install.sh'})
 " For async completion
  call dein#add('Shougo/deoplete.nvim')
 " For Denite features
  call dein#add('Shougo/denite.nvim')


 " Vim-Plug
 # REQUIRED: Add a syntax file. YATS is the best
  Plug 'HerringtonDarkholme/yats.vim'
  Plug 'mhartington/nvim-typescript', {'do': './install.sh'}
 " For async completion
  Plug 'Shougo/deoplete.nvim'
 " For Denite features
  Plug 'Shougo/denite.nvim'


" Enable deoplete at startup

  let g:deoplete#enable_at_startup = 1

If errors occur after installing, make sure to run ./install.sh in the plugin directory. And try to run :UpdateRemotePlugins if you haven't already.

Limitation

If no completion is happening, please be sure to have a Typescript syntax file in your RTP. Older versions of Neovim do not include a default syntax for Typescript, so be sure to include one. A popular syntax file for Typescript is yats.vim. As of v0.4.3, Neovim includes a default Typescript syntax file that is based off yats. Running nvim-typescript with no syntax file could lead to unexpected behavior.

Open Open Source, or how to make this everyone's code

If you happened to build something and would love to make a PR, I would be more than happy to add contributors. If something you do add happens to get merged (most likely it will ๐Ÿ˜ ) you'll get a collaborator request. This has worked out very well in the Node community and I want it to happen here. This is as much my code as it is your code.

See:

Debugging

There are a few things you'll have to modify in your nvim config in order to be able to effectively work on this plugin:

  call dein#local('~/GitHub', {},['nvim-typescript'])
  let $NVIM_NODE_LOG_FILE='nvim-node.log'
  let $NVIM_NODE_LOG_LEVEL='warn'

This plug will try to log most things to warn as the node-client logs a lot of verbose output to debug/info. You will now be able to tail -f /PATH_TO/nvim-node.log, and see debug output appear.

TODOS

If there's a feature that you would like to see, feel free to open an issue or send a PR.

Like this plugin? Buy me a coffee on KoFI

nvim-typescript's People

Contributors

alextes avatar btbtravis avatar dlants avatar donniewest avatar faceleg avatar herringtondarkholme avatar jeffwillette avatar johngalambos avatar justanotherdot avatar kris-swann avatar laino avatar mhartington avatar minamorl avatar n10v avatar nbardiuk avatar paul1999 avatar pocari avatar pyrho avatar rafaelsq avatar raviqqe avatar reissbaker avatar roxma avatar rsslldnphy avatar samdfonseca avatar stephenyu avatar symbyte avatar tbo avatar tiush avatar williamboman avatar yymm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nvim-typescript's Issues

E117: Unknown function: TSOnBufEnter

Problems summary

Error on loading any ts file:

Error detected while processing BufEnter Auto commands for "*.ts":
E117: Unknown function: TSOnBufEnter

Expected

No Error

Environment Information

  • terminal: iTerm2 3.0.15
  • vim/nvim version:
NVIM v0.2.0
Build type: Release
Compilation: /usr/local/Homebrew/Library/Homebrew/shims/super/clang -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_MSGPACK_HAS_FLOAT32 -DNDEBUG -DDISABLE_LOG -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -I/tmp/neovim-20170707-80027-1bg0wcx/neovim-0.2.0/build/config -I/tmp/neovim-20170707-80027-1bg0wcx/neovim-0.2.0/src -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/opt/gettext/include -I/usr/include -I/tmp/neovim-20170707-80027-1bg0wcx/neovim-0.2.0/build/src/nvim/auto -I/tmp/neovim-20170707-80027-1bg0wcx/neovim-0.2.0/build/include
Compiled by [email protected]

Optional features included (+) or not (-): +acl   +iconv    +jemalloc +tui
For differences from Vim, see :help vim-differences

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/local/Cellar/neovim/0.2.0_1/share/nvim"
  • relevant plugins:
silent! let g:plugs['deoplete.nvim'].commit = '45f23f1'
silent! let g:plugs['yats.vim'].commit = '3bb50d3'
silent! let g:plugs['nvim-typescript'].commit = '8d09628'

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

call plug#begin('~/.vim/plugged')
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'HerringtonDarkholme/yats.vim'
Plug 'mhartington/nvim-typescript'
call plug#end()
...
let g:deoplete#enable_at_startup = 1
...

The reproduce ways from neovim starting

nvim src/index.ts

Example project repo?

This is almost certainly related to an environment incorrectly configured. If it isn't then I'll put something together.

Screen shot (if possible)

screen shot 2017-10-10 at 09 49 16

screen shot 2017-10-10 at 10 04 18

Feature requests/Implementations

Not really sure where to put this or how to broach this so I'm putting it here

I've created a fork here where I just kind of started making changes that were applicable to my needs and I realized some of them might be merged upstream with some care:

Namely, the changes I've made are:

  1. Better completion info within the menu
  2. Stripped out extraneous information
  3. Ability to use this project for Javascript projects using typescript tooling

Other things I would like to do:

  1. Make javascript support able to be toggled
  2. Update this to work with Typescript 2.0 (not really sure where to begin here, all I know is the plugin crashes when I use 2.0 and my tsserver knowledge is limited)

So, do you want any of this? I don't want to spend the time creating PRs and bugging you if it's not wanted

E117: Unknown function: NvimTSEnter

When I open a .ts file with vim, I get the following errors:

Error detected while processing BufEnter Auto commands for "*.ts":
E117: Unknown function: NvimTSEnter

Autocompletion with deoplete doesn't work. It works in other file types (e.g. JavaScript files).

I'm using NeoVim 0.1.7 and have tsc 2.1.6 globally installed. My dotfiles with all installed plugins and .vimrc can be found here: https://github.com/mastertinner/dotfiles/tree/master/vim

I'm not sure if it's a problem that I'm using leafgarland/typescript-vim as a TypeScript syntax file.

Javascript support

I noticed this was removed: what is specifically holding us back? How can we make this more ideal?

Make deoplete-typescript even more responsive

Deoplete-typescript is quite fast for now. But if it is used in a huge file, like TypeScript compiler's checker.ts, it becomes quite laggy.

The problem here is every gather_candidates call requires an expensive self._reload. If we can reduce the overhead of reloading, then deopelte-typescript can be much faster!

Currently I can come up with two solutions:

  1. utilize tsserver's change: for every textchange, tsserver does not need the reload the entire file, rather it can incrementally parse new text inserted.
    However, vim's beloved text manipulation is quite hard to be translated into tsserver's format. For example, a macro call/ a block editing/ an autocomplete will change the buffer at multiple places. So deoplete cannot easily tell tsserver where is modified.
  2. throttle reload event:
    It is very easy and understandable. say, tsserver does not reload file unless it has not reloaded 1 second ago. It it will break completion sometimes. But deoplete-typescript can make it up by forcing reload.

screen shot 2016-06-18 at 15 10 35

This is my try to the second approach. Mere three lines are added. And it will always reload if user inputs a dot. So method hinting is always correct.

After this change, deoplete-typescript is as fast as vscode. Though it is possible to encouter bad completion, I personally does not find it distracting. If you are interesed in this, please tell me if I could submit a pull request.

Realtime (as you type) error reporing

Like it is done in VSCode:
image

I believe it should be done using the same TSServer running by nvm-typescript not by some syntax or linter checkers, as errors should be shown as you type, not as you save.

Not work on '*.tsx' file

This plugin causes python error on editing files set "filetype=typescript" but the extension is not .ts.

[deoplete] Traceback (most recent call last):
[deoplete]   File "/home/yuki/.config/nvim/dein.vim/.cache/init.vim/.dein/rplugin/python3/deoplete/deoplete.py", line 98, in gather_results
[deoplete]     ctx['candidates'] = source.gather_candidates(ctx)
[deoplete]   File "/home/yuki/.config/nvim/dein.vim/.cache/init.vim/.dein/rplugin/python3/deoplete/sources/typescript.py", line 75, in gather_candidates
[deoplete]     prefix=context["complete_str"]
[deoplete]   File "/home/yuki/.config/nvim/dein.vim/.cache/init.vim/.dein/rplugin/python3/nvim-typescript/client.py", line 217, in completions
[deoplete]     "completions", args, wait_for_response=True)
[deoplete]   File "/home/yuki/.config/nvim/dein.vim/.cache/init.vim/.dein/rplugin/python3/nvim-typescript/client.py", line 95, in send_request
[deoplete]     self.__send_data_to_server(request)
[deoplete]   File "/home/yuki/.config/nvim/dein.vim/.cache/init.vim/.dein/rplugin/python3/nvim-typescript/client.py", line 58, in __send_data_to_server
[deoplete]     Client.__server_handle.stdin.write(json.dumps(data))
[deoplete] AttributeError: 'NoneType' object has no attribute 'stdin'
[deoplete] Could not get completions from: typescript.  Use :messages for error details.

TS Server doesn't start in such situation.
In my case, it is when edit .tsx file.

Thanks.

Plugin opens preview window by itself

Problems summary

Plugin opens preview window on completion (tab, c-n, c-p), how do disable this?

Expected

On gif there was no preview window, which opened on its own

Environment Information

Termite, arch, CheckHealth norm, g:nvim_typescript#type_info_on_hold = 0, g:nvim_typescript#signature_complete = 0, NVIM v0.2.0-1147-g58422f17d

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

call dein#add('mhartington/nvim-typescript')
call dein#add('leafgarland/typescript-vim')

call dein#add('Shougo/deoplete.nvim') " {{{
  let g:deoplete#enable_at_startup = 1
  let g:deoplete#auto_complete_delay = 150
" }}}
call dein#add('Shougo/echodoc.vim') " {{{
  set cmdheight=2
  let g:echodoc_enable_at_startup = 1
" }}}

call dein#add('Shougo/neosnippet-snippets')
call dein#add('Shougo/neosnippet') " {{{
  set conceallevel=2 concealcursor=niv
  let g:neosnippet#snippets_directory='~/.config/nvim/snippets'

  imap <C-k> <Plug>(neosnippet_expand_or_jump)
  smap <C-k> <Plug>(neosnippet_expand_or_jump)
  xmap <C-k> <Plug>(neosnippet_expand_target)

  inoremap <expr><TAB>
    \ pumvisible() ? "\<C-n>" :
    \ neosnippet#expandable_or_jumpable() ?
    \    "\<Plug>(neosnippet_expand_or_jump)" : "\<TAB>"
  snoremap <expr><TAB> neosnippet#expandable_or_jumpable() ?
    \ "\<Plug>(neosnippet_expand_or_jump)" : "\<TAB>"

" }}}

Screen shot (if possible)

https://asciinema.org/a/enhb67cp8zp54j8ow25pkqnkj

Thanks for awesome plugin btw

Not working with typescript

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

Problems summary

in some project:
yarn add [email protected] - :TSDoc will work
yarn add [email protected] and restart neovim - :TSDoc just stop working, without errors

Environment Information

  • terminal: termite, tmux
  • vim/nvim version:
 ~/projects/linted-git-commit ๎‚ฐ ๎‚  master โ— ๎‚ฐ nvim --version
NVIM v0.2.0
Build type: Release
Compilation: /nix/store/m3hr6jjlg637240q67as3js21dg6h218-gcc-wrapper-6.4.0/bin/gcc -Wconversion -O2 -DNDEBUG -DDISABLE_LOG -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -I/build/neovim-v0.2.0-src/build/config -I/build/neovim-v0.2.0-src/src -I/nix/store/m4gim49s3dm99rzghb7yr044269qxi2v-libuv-1.14.1/include -I/nix/store/230mys6z9g3ip8xv0kr05y44bddw8kyq-libmsgpack-2.0.0/include -I/nix/store/3yj32waw64f0hq3731nlbdb4cc7pxzc6-unibilium-1.2.0/include -I/nix/store/22nhx625br245w8mkc7kxs8vqdmb31rp-libtermkey-0.19/include -I/nix/store/apcb9alqnp7zssf3blkaqkrxdyqrnx9i-neovim-libvterm-2016-10-07/include -I/nix/store/5sxk93h247vp5b9qycdpzfnj1m42n3gm-jemalloc-4.5.0/include -I/nix/store/50jw5m7lda3rylirxyly9diy55lh149z-glibc-2.25-49-dev/include -I/build/neovim-v0.2.0-src/build/src/nvim/auto -I/build/neovim-v0.2.0-src/build/include
Compiled by nixbld

Optional features included (+) or not (-): +acl   +iconv    +jemalloc +tui
For differences from Vim, see :help vim-differences

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "
/nix/store/97y76w5f0g8h2jk2pw3nqm4423fpkgvk-neovim-0.2.0/share/nvim"

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

" typescript
call dein#add('mhartington/nvim-typescript', { 'on_ft':['typescript'] })
call dein#add('leafgarland/typescript-vim', { 'on_ft':['typescript'] })

Example project repo?

https://github.com/BjornMelgaard/linted-git-commit

Ability to add missing import

Coming from Tsuquyomi I'm really missing the :TsuImport command which automatically adds missing imports (and allows to choose the proper one when there's a conflict).

I plan on looking into it in the near future, but in the meantime pointers are welcomed :)

Completion disabled when open many tabs

Great plugin! I heavily use this.
Currently, it seems completions are disabled at another opened tabs.
It is frequently occured when I opened other filetype files.

No candidates appear

Problems summary

I can't see any candidates from this source.

I have used nvim-typescript. However, when I enter typescript buffer, I got a little time freeze everytime. I guessed that was TSServer staring time, so I tried reinstall, and I got this situation.

Expected

I want completion like README.md screenshot.

Environment Information

  • terminal: iTerm 2 Build 3.0.14 / tmux 2.3
  • vim/nvim version: nvim 0.1.7
  • OS: MaxOS Sierra 10.12.3

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

if &compatible
  set nocompatible
endif

let s:dein_dir = expand('~/.cache/dein')
let s:dein_repo_dir = s:dein_dir . '/repos/github.com/Shougo/dein.vim'

if &runtimepath !~# '/dein.vim'
  if !isdirectory(s:dein_repo_dir)
    execute '!git clone https://github.com/Shougo/dein.vim' s:dein_repo_dir
  endif
  execute 'set runtimepath^=' . fnamemodify(s:dein_repo_dir, ':p')
endif

if dein#load_state(s:dein_dir)
  call dein#begin(s:dein_dir)

  call dein#add('Shougo/deoplete.nvim')
  call dein#add('mhartington/nvim-typescript')
  call dein#add('HerringtonDarkholme/yats.vim')

  call dein#end()
  call dein#save_state()
endif

if dein#check_install()
  call dein#install()
  "call :UpdateRemotePlugins
endif
let g:deoplete#enable_at_startup = 1
let g:deoplete#enable_at_startup = 1
let g:deoplete#enable_debug = 1
let g:deoplete#enable_profile = 1
call deoplete#enable_logging('DEBUG', 'deoplete.log')

The reproduce ways from neovim starting

  1. start nvim
  2. :UpdateRemotePlugins
  3. start typing
  4. I can't see any candidates from this source.

Example project repo?

Sorry, this is not a minimal project.

https://github.com/uzimith/twitch-comment/tree/nvim-typescript

Screen shot (if possible)

When I didn't call :TSStart

yvedohtgki

screen shot 2017-03-11 at 17 23 33

When I call :TSStart

a

Sometimes I can see some candidates from other sources.

5p9svra1rn

Default mapping

I know that no mapping is a feature and I understand why not do this for commands that don't have a standard keybinding but for example KK or ctrl + ] are a standard in vim and it will be very convenient to have it as default. Ctags doesn't have typescript support anyway. Maybe add it as a variable option?

TSImport error

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

[Feature Request] Show warnings on save

Problems summary

Are you planning to add a list of syntax and semantics errors to Vim quickfix window? I've never built a plugin for vim, but if you need help, I'd like to add this feature.

deoplete-typescript is not using my tsconfig.json file

Hello,
in a project (inferno/jsx) i receive the issue:

TS17004: Cannot use JSX unless the '--jsx' flag is provided.

but my tsconfig.json provides this flag in the main project directory. I also tried to put the tsconfig.json file into the same directory where the source is located. Still not used. Any idea, what i could miss?

My nvim configs: https://github.com/HendrikRoth/Dotfiles/tree/master/nvim

tsconfig.json:

{
    "compilerOptions": {
        "outDir": "dist",
        "rootDir": "src",
        "experimentalDecorators": true,
        "emitDecoratorMetadata": true,
        "sourceMap": true,
        "noImplicitAny": true,
        "target": "es5",
        "jsx": "preserve",
        "module": "commonjs"
    },
    "filesGlob": [
        "typings/index.d.ts",
        "src/**/*.tsx"
    ]
}

Thanks for your help, HR.

AttributeError: 'NoneType' object has no attribute 'stdin'

From :messages

[deoplete]     Client.__server_handle.stdin.write(json.dumps(data))
[deoplete] AttributeError: 'NoneType' object has no attribute 'stdin'
[deoplete] Could not get completions from: typescript.  Use :messages for error details.``

Deoplete log:

2017-01-04 18:28:15,849 INFO     (deoplete.logging) --- Deoplete Log Start ---
2017-01-04 18:28:15,849 INFO     (deoplete.logging) NVIM 0.1.7, Python 3.5.2, neovim client 0.1.12
2017-01-04 18:28:24,264 DEBUG    (deoplete.typescript) Request: {"command": "reload", "type": "request", "seq": 0, "arguments": {"tmpfile": "/var/folders/_2/s71xc7jn1l36zzc4_wtdf3hr0000gn/T/tmpp2_4nhuf", "file": "/src/app.ts"}}
:^[;^[2017-01-04 18:35:00,123 DEBUG    (deoplete.typescript) Request: {"command": "reload", "type": "request", "seq": 1, "arguments": {"tmpfile": "/var/folders/_2/s71xc7jn1l36zzc4_wtdf3hr0000gn/T/tmpi2xovfdq", "file": "/src/app.ts"}}

init.vim:

let g:deoplete#enable_at_startup = 1
let g:deoplete#enable_ignore_case = 1
let g:deoplete#auto_complete_start_length = 0
let g:auto_complete_start_length = 0
let g:deoplete#enable_refresh_always = 1
let g:deoplete#enable_debug = 1
let g:deoplete#enable_profile = 1
call deoplete#enable_logging('DEBUG', '/tmp/deoplete.log')

Neovim API b'Key not found' following current instructions

I can't get this to work at all based on the README instructions. I'm sorry for a somewhat general / support issue, but maybe this is a bug in this library, deoplete, neovim, or something that will help someone else out.

$ nvim --version
NVIM 0.1.5
  • python3 support is installed.
  • typescript package is installed globally.

Gist of .vimrc files: https://gist.github.com/ajcrites/9d5d0418af1f9256c8cd4b954100fb48 -- the top file is what I'm using to still test / reproduce this. The .bak file is my usual vimrc which seems to have exactly the same problem.

Example of a .ts and tsconfig.json I'm using: https://gist.github.com/ajcrites/7a985e8a487c050c6126b462b532cb68

If I type finalB<C-p> it will complete. After finalBusinessCategories., <C-o> or <C-x> do not work. <C-p> will just list all of the words in the file.

When I open the file, I get:

Error detected while processing function deoplete#enable_logging:
line    6:
error caught in async handler 'deoplete_on_event [{'max_menu_width': 52, 'filetype': 'nothing', 'encoding': 'utf-8', 'bufnr': 1, 'cwd': '/Users/acrites/projects/personal/business-web', 'input': '', 'dict__dictionary': '', 'complete_str': '', 'bufvars': {}, 'camelcase': 0, 'bufname': '/Users/acrites/.vimrc', 'filetypes': ['nothing'], 'rpc': 'deoplete_on_event', 'keyword_patterns': '[a-zA-Z_][a-zA-Z@0-9_ร€-รฟ]*', 'delay': 50, 'start_complete': '\udc80\udcfdR(deoplete_start_complete)', 'sources': [], 'position': [0, 1, 1, 0], 'omni__omnifunc': '', 'ignorecase': 1, 'custom': {'_': {}}, 'max_abbr_width': 52, 'vars': {'deoplete#max_list': 100, 'deoplete#disable_auto_complete': 0, 'deoplete#member#prefix_patterns': {}, 'deoplete#enable_refresh_always': 1, 'deoplete#enable_at_startup': 1, 'deoplete#max_abbr_width': 80, 'deoplete#enable_smart_case': 0, 'deoplete#omni#functions': {}, 'deoplete#delimiters': ['/', '.', '::', ':', '#'], 'deoplete#_neovim_python_version': '0.1.9', 'deoplete#max_menu_width': 40, 'deoplete#omni_patterns': {}, 'deoplete#auto_complete_delay': 50, 'deoplete#keyword_patterns': {}, 'deoplete#_omni_patterns': {'xhtml': ['<', '<[^>]*\\s[[:alnum:]-]*'], 'xml': ['<', '<[^>]*\\s[[:alnum:]-]*'], 'mkd': ['<', '<[^>]*\\s[[:alnum:]-]*'], 'markdown': ['<', '<[^>]*\\s[[:alnum:]-]*'], 'html': ['<', '<[^>]*\\s[[:alnum:]-]*']}, 'deoplete#enable_debug': 1, 'deoplete#_keyword_patterns': {'_': '[a-zA-Z_]\\k*'}, 'deoplete#_channel_id': 1, 'deoplete#enable_ignore_case': 1, 'deoplete#enable_profile': 1, 'deoplete#_rank': {}, 'deoplete#enable_camel_case': 0, 'deoplete#_context': {}, 'deoplete#auto_complete_start_length': 0, 'deoplete#omni#input_patterns': {}, 'deoplete#ignore_sources': {}, 'deoplete#sources': {}}, 'runtimepath': '/Users/acrites/.config/nvim/dein/repos/github.com/Shougo/vimproc.vim,/Users/acrites/.config/nvim/dein/.dein,/Users/acrites/.config/nvim/dein/repos/github.com/Shougo/dein.vim,/Users/acrites/.config/nvim,/etc/xdg/nvim,/Users/acrites/.local/share/nvim/site,/usr/local/share/nvim/site,/usr/share/nvim/site,/usr/local/Cellar/neovim/0.1.5/share/nvim/runtime,/usr/share/nvim/site/after,/usr/local/share/nvim/site/after,/Users/acrites/.local/share/nvim/site/after,/etc/xdg/nvim/after,/Users/acrites/.config/nvim/after,/Users/acrites/.config/nvim/dein/.dein/after', 'next_input': '', 'smartcase': 0, 'changedtick': 2, 'event': ''}]'
Traceback (most recent call last):
  File "/Users/acrites/.config/nvim/dein/.dein/rplugin/python3/deoplete/__init__.py", line 57, in on_event
    self.__deoplete.on_event(context)
  File "/Users/acrites/.config/nvim/dein/.dein/rplugin/python3/deoplete/deoplete.py", line 372, in on_event
    self.check_recache(context)
  File "/Users/acrites/.config/nvim/dein/.dein/rplugin/python3/deoplete/deoplete.py", line 360, in check_recache
    self.load_sources(context)
  File "/Users/acrites/.config/nvim/dein/.dein/rplugin/python3/deoplete/deoplete.py", line 254, in load_sources
    source = module.Source(self.__vim)
  File "/Users/acrites/.config/nvim/dein/.dein/rplugin/python3/deoplete/sources/typescript.py", line 26, in __init__
    self.filetypes = ["typescript", "tsx", "typescript.tsx", "javascript", "jsx", "javascript.jsx"] if vim.vars["deoplete#sources#tss#javascript_support"] else ["typescript"]
neovim.api.nvim.NvimError: b'Key not found'
[deoplete] Logging to deoplete.log
Press ENTER or type command to continue

However I think this is just related to the debug logging. If I remove that line, I get no errors when I start the file.

Anything suggestions would be a ton of help. I'm also not sure of the best way to walk through debugging this since I've followed the README instructions exactly, but this doesn't seem to work at all.

Error while trying to use local dev version

Wanted to setup for local dev:

Cloned nvm-typescirpt to /mnt/d/Code/nvim-typescript

added local plugin config:

  call dein#local('/mnt/d/Code', {}, ['nvim-typescript'])

and params:

  let g:deoplete#enable_at_startup = 1
  let g:deoplete#enable_ignore_case = 1
  let g:deoplete#auto_complete_start_length = 1
  let g:auto_complete_start_length = 1
  let g:deoplete#enable_refresh_always = 1
  let g:deoplete#enable_debug = 1
  let g:deoplete#enable_profile = 1
  call deoplete#enable_logging('DEBUG', '/deoplete.log')
 

And got such erros in the neovim:

image

Any ideas?

Work required to make it work with tss directly?

For some reason Tsuquyomi is amazingly slow and not reliable with my setup.

  • I'm using Neomake for tsc error checking, and YCM for autocomplete.
  • I'd rather use deoplete because compiling C code is annoying.

How much work would be required to make this deoplete source work directly with TSS?

Could you point me in the right direction, in terms of where to start?

TSImport: incorrect import statements

Problems summary

TSImport inserts import statements with wrong modules (here: it imports @angular instead of @angular/core)

Expected

TSImport inserts import statements with correct modules.

Environment Information

  • terminal: termite, zsh
  • vim/nvim version: nvim 0.2.0

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

" Used plugins                                                                   
call plug#begin('~/.config/nvim/plugged')                                                           
                                                                                                     
Plug 'bling/vim-airline'                                                                            
Plug 'tomasr/molokai'                                                                               
Plug 'morhetz/gruvbox'                                                                              
Plug 'Shougo/deoplete.nvim'                                                                         
Plug 'ctrlpvim/ctrlp.vim'                                                                           
                                                                                                     
" TypeScript                                                                                        
Plug 'leafgarland/typescript-vim'                                                                   
Plug 'mhartington/nvim-typescript'                                                                  
                                                                                                     
" Initialize plugin system                                                                          
call plug#end()   " Use deoplete                                                                                      

let g:deoplete#enable_at_startup = 1  

The reproduce ways from neovim starting

  1. Create Angular project.
  2. Create module / component.
  3. Open component .ts file.
  4. Remove import for Component.
  5. Move cursor to @Component.
  6. Call TSImport.
  7. Select module.

Example project repo?

Screen shot (if possible)

Example file, import for Component is missing.
2017-10-18-212724_532x444_scrot
Select module.
2017-10-18-212744_950x170_scrot
Result (imported using module @angular instead of @angular/core).
2017-10-18-212800_518x184_scrot

Import fails majority of the time.

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

Problems summary

When I run TSImport, it seems to fail for the most part. I've only had it succeed once.

Expected

Expect TSImport to give a detailed error about what I possibly could have done wrong rather than a stack trace.

Environment Information

  • terminal: gnome-terminal
  • vim/nvim version: VIM 8.0 / NVIM v0.2.0

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

I am using a brand new installation of spacevim with the typescript layer added and only one custom config.

let g:deoplete#enable_at_startup = 1  

The reproduce ways from neovim starting

  1. Install Spacevim
  2. Create fresh typescript project
  3. Create a file with exported class/const/etc
  4. Create another file to attempt to perform import in

Stack Trace / Error

Traceback (most recent call last):                                                                                                                                                                                                                        
  File "/home/matthew/.cache/vimfiles/.cache/init.vim/.dein/rplugin/python3/nvim-typescript/__init__.py", line 349, in tsimport                                                                                                                           
    self._client, self.relative_file())                                                                                                                                                                                                                   
  File "/home/matthew/.cache/vimfiles/.cache/init.vim/.dein/rplugin/python3/nvim-typescript/utils.py", line 96, in getCurrentImports                                                                                                                      
    return (list(*map(lambda x: x["text"], imports)), lastImportLine)                                                                                                                                                                                     
TypeError: list() takes at most 1 argument (4 given)

Screen shot (if possible)

Screencast of issue in case I'm simply just using this incorrectly.
https://asciinema.org/a/kUERxcPPxxymqkre7DGEVIVqQ

Error when editing a ts file

When editing a .ts file I get the error stack at the end of the issue.
The working directory has a tsconfig.json file, and I am editing a file from which tsc yields /home/txh/.nvm/versions/node/v6.5.0/bin/tsc.

(possibly) Relevant parts of init.vim:

 Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
 Plug 'mhartington/deoplete-typescript', {'for': ['typescript']}
 Plug 'ternjs/tern_for_vim', { 'do': 'npm install', 'for': ['javascript'] }
 Plug 'carlitux/deoplete-ternjs', {'for': ['javascript']}
 Plug 'othree/jspc.vim', {'for': ['javascript']}
 Plug 'pangloss/vim-javascript'
 Plug 'HerringtonDarkholme/yats.vim'

" Enable deoplete on startup
let g:deoplete#enable_at_startup = 1
let g:deoplete#enable_smart_case = 1

if !exists('g:deoplete#omni#input_patterns')
  let g:deoplete#omni#input_patterns = {}
endif

if !exists('g:deoplete#omni#functions')
  let g:deoplete#omni#functions = {}
endif

if !exists('g:deoplete#sources')
  let g:deoplete#sources = {}
endif

" Close the documentation window when completion is done
autocmd InsertLeave,CompleteDone * if pumvisible() == 0 | pclose | endif

augroup omni_complete
  " clear commands before resetting
  autocmd!

  " Enable omnicomplete for supported filetypes
  autocmd FileType css,scss setlocal omnifunc=csscomplete#CompleteCSS
  autocmd FileType html,htm.twig,twig,markdown setlocal omnifunc=emmet#CompleteTags
  autocmd FileType javascript setlocal omnifunc=jspc#omni
  autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
  autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
augroup END

let g:deoplete#omni#functions.javascript = [
  \ 'tern#Complete',
  \ 'jspc#omni'
\]

" Disable deoplete when multiple cursors are used
function! g:Multiple_cursors_before()
  let g:deoplete#disable_auto_complete = 1
endfunction

" Reenable deoplete after multiple cursors are used
function! g:Multiple_cursors_after()
  let g:deoplete#disable_auto_complete = 0
endfunction

let g:deoplete#sources['javascript'] = ['file', 'ternjs', 'ultisnips', 'omni']
let g:deoplete#sources['css\|scss'] = ['file', 'ultisnips', 'omni', 'tag']

Any advice would be greatly appreciated.

Error stack:

[deoplete] Traceback (most recent call last):
[deoplete]   File "/home/txh/.config/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/deoplete.py", line 110, in gather_results
[deoplete]     ctx['candidates'] = source.gather_candidates(ctx)
[deoplete]   File "/home/txh/.config/nvim/plugged/deoplete-typescript/rplugin/python3/deoplete/sources/typescript.py", line 82, in gather_candidates
[deoplete]     self.reload()
[deoplete]   File "/home/txh/.config/nvim/plugged/deoplete-typescript/rplugin/python3/deoplete/sources/typescript.py", line 56, in reload
[deoplete] Traceback (most recent call last):
[deoplete]     self._client.reload(filename, tmpfile.name)
[deoplete]   File "/home/txh/.config/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/deoplete.py", line 110, in gather_results
[deoplete]   File "/home/txh/.config/nvim/plugged/deoplete-typescript/rplugin/python3/deoplete/sources/../../nvim-typescript/client.py", line 180, in reload
[deoplete]     ctx['candidates'] = source.gather_candidates(ctx)
[deoplete]     response = self.send_request("reload", args, True)
[deoplete]   File "/home/txh/.config/nvim/plugged/deoplete-typescript/rplugin/python3/deoplete/sources/typescript.py", line 82, in gather_candidates
[deoplete]   File "/home/txh/.config/nvim/plugged/deoplete-typescript/rplugin/python3/deoplete/sources/../../nvim-typescript/client.py", line 103, in send_request
[deoplete]     self.reload()
[deoplete]     self.__send_data_to_server(request)
[deoplete]   File "/home/txh/.config/nvim/plugged/deoplete-typescript/rplugin/python3/deoplete/sources/typescript.py", line 56, in reload
[deoplete]   File "/home/txh/.config/nvim/plugged/deoplete-typescript/rplugin/python3/deoplete/sources/../../nvim-typescript/client.py", line 68, in __send_data_to_server
[deoplete]     self._client.reload(filename, tmpfile.name)
[deoplete]     Client.__server_handle.stdin.write(json.dumps(data))
[deoplete]   File "/home/txh/.config/nvim/plugged/deoplete-typescript/rplugin/python3/deoplete/sources/../../nvim-typescript/client.py", line 180, in reload
[deoplete] AttributeError: 'NoneType' object has no attribute 'stdin'
[deoplete]     response = self.send_request("reload", args, True)
[deoplete] Could not get completions from: typescript.  Use :messages for error details.
[deoplete]   File "/home/txh/.config/nvim/plugged/deoplete-typescript/rplugin/python3/deoplete/sources/../../nvim-typescript/client.py", line 103, in send_request
[deoplete]     self.__send_data_to_server(request)
[deoplete]   File "/home/txh/.config/nvim/plugged/deoplete-typescript/rplugin/python3/deoplete/sources/../../nvim-typescript/client.py", line 68, in __send_data_to_server
[deoplete]     Client.__server_handle.stdin.write(json.dumps(data))
[deoplete] AttributeError: 'NoneType' object has no attribute 'stdin'
[deoplete] Could not get completions from: typescript.  Use :messages for error details.

Disable typechecking / setting error list

I would like to use ALE do to my typechecking which levering nvim-typescript for renaming, importing, etc. Is there any way I can stop nvim-typscript from populating errors?

Love the plugin, it has given me a huge productivity boost!

Cheers,
Ian

CompletionDetail locks up on string type

I've noticed that trying to perform completeEntryDetail on string types locks everything up. I've spent some time trying to debug this but have not been able to track down where the issue is. If any contributors have a moment and could help me out here, I would really appreciate it.

Logging out ret here

https://github.com/mhartington/nvim-typescript/blob/master/rplugin/python3/nvim-typescript/client.py#L129

Returns all the expected results but the whole process locks up when trying to do completionEntryDetail request. Only for string types though, if the value is any other type, it works fine.

cc @HerringtonDarkholme or @TiuSh

deoplete crashes in gather_results

Problems summary

Whenever completion starts deoplete crashes saying it coulndn't get completions from: typescript.

I have seen issue #46, although similar errors appear, I have the tsconfig.json file in :pwd directory

Expected

Completion options should show up in vim's completion candidates box

Environment Information

  • OS: Arch Linux running Linux 4.9.17-1-lts
  • terminal: Terminator running ZSH inside TMUX session
  • vim/nvim version: NVIM v0.1.7
  • python3: 3.6.0
  • pip3 freeze | grep neovim: neovim==0.1.13
  • :CheckHealth: Here

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

syntax on

"" Init Plug
let plugged_path=expand('~/myMinimalConfig/plugged')
call plug#begin(plugged_path)

Plug 'mhartington/nvim-typescript'
  Plug 'Shougo/deoplete.nvim'
  Plug 'HerringtonDarkholme/yats.vim'

call plug#end()
filetype plugin indent on
" Plug Done

" deoplete config {
  let g:deoplete#enable_at_startup = 1
  let g:deoplete#enable_debug = 1
  let g:deoplete#enable_profile = 1
  let g:deoplete#enable_ignore_case = 1
  call deoplete#enable_logging('DEBUG', '/tmp/deoplete/deoplete.log')
" }

(vimrc assuming Plug to be installed and :PlugInstall already ran)

The reproduce ways from neovim starting

  1. cd to base ionic app root (directory that has tsconfig.json in it)
  2. open nvim nvim -u ~/myMinimalConfig/vimrc test.ts
  3. update remote plugins (:UpdateRemotePlugins)
  4. paste simple class
class Animal {}
  1. type o to enter insert mode on next line
  2. type An and wait for automatic completion to kick in
  3. Screenshot 1 shows up
  4. ESC to exit insert mode
  5. :message
  6. Screenshot 2 shows up

Example project repo?

base ionic app
installed using ionic start test --v2

Screen shot (if possible)

Screenshot 1

2017-03-25-183723_1366x768_scrot

Screenshot 2

2017-03-25-184005_1366x768_scrot

Text:

[deoplete] Logging to /tmp/deoplete/deoplete.log
TS: Server Started
[deoplete] Traceback (most recent call last):
[deoplete]   File "/home/roberto/testNvim/plugged/deoplete.nvim/rplugin/python3/deoplete/deoplete.py", line 124, in gather_results
[deoplete]     ctx['candidates'] = source.gather_candidates(ctx)
[deoplete]   File "/home/roberto/testNvim/plugged/nvim-typescript/rplugin/python3/deoplete/sources/typescript.py", line 84, in gather_ca
ndidates
[deoplete]     self.reload()
[deoplete]   File "/home/roberto/testNvim/plugged/nvim-typescript/rplugin/python3/deoplete/sources/typescript.py", line 58, in reload
[deoplete]     self._client.reload(filename, tmpfile.name)
[deoplete]   File "/home/roberto/testNvim/plugged/nvim-typescript/rplugin/python3/nvim-typescript/client.py", line 186, in reload
[deoplete]     response = self.send_request("reload", args, True)
[deoplete]   File "/home/roberto/testNvim/plugged/nvim-typescript/rplugin/python3/nvim-typescript/client.py", line 134, in send_request
[deoplete]     ret = json.loads(returned_string)
[deoplete]   File "/usr/lib/python3.6/json/__init__.py", line 354, in loads
[deoplete]     return _default_decoder.decode(s)
[deoplete]   File "/usr/lib/python3.6/json/decoder.py", line 342, in decode
[deoplete]     raise JSONDecodeError("Extra data", s, end)
[deoplete] json.decoder.JSONDecodeError: Extra data: line 3 column 1 (char 165)
[deoplete] Could not get completions from: typescript.  Use :messages for error details.

Add a :TSTypeDef command

Similar to Tsuquyomi's :TsuTypeDefinition.

:TsuTypeDefinition command is similar to :TsuDefinition. :TsuTypeDefinition navigates to the location where the type of the symbol under the cursor is defined.

This is pretty useful when types are inferred by the compiler.

More detailed auto complete

What do you think about adding more details like VSCode provides:

image

When you press (i):

image

In general VScode TS experience (where TS if a first class citizen) could be taken as a role model.

Unable to locate tsconfig.json or tslint.json in path. Unable to debug required location of file.

Problems summary

On running of :CheckHealth there is no reported tsconfig.json or tslint.json but both are present in the root of the project as well as the src directory.

Expected

I expect that :CheckHealth would locate the config files in either the source or the root of the project. I have reviewed the code and verified that the .git directory as well as the .gitignore files are present in the root of the project. It is my understanding that these are used to help locate the root of the project.

I have attempted to debug the issue by writing to a file during execution of TSFindConfig during the CheckHealth call. and was supprised at the output. The results of self._config.path is returning None

I have executed the CheckHealth from the root of the project, the src directory, as well as after opening a *.ts file. as show here:

selection_049

I have also added

let g:deoplete#enable_at_startup = 1
let g:deoplete#enable_debug = 1
let g:deoplete#enable_profile = 1
call deoplete#enable_logging('DEBUG', '/tmp/deoplete.log')

as was suggested in another post. This did not provide any useful information as Deoplete appears to be functioning as expected.

Environment Information

  • terminal: Gnome Terminal 3.24.2
  • vim/nvim version: NVIM v0.2.0 with Python2/3 support
  • Fedora 26
  • npm 5.3.0
  • Node 7.4.0
  • tsc --version - Version 2.4.2

minimal vim rc

filetype off                  " required

"dein Scripts-----------------------------
if &compatible
  set nocompatible               " Be iMproved
endif

" Required:
set runtimepath+=/home/thief/.vim/dein/repos/github.com/Shougo/dein.vim
let s:dien_basepath = expand('~/.vim/dein/repos/github.com/Shougo/dein.vim')

" Required:
if dein#load_state('/home/thief/.vim/dein')
  call dein#begin('/home/thief/.vim/dein')

  " Let dein manage dein
  " Required:
  call dein#add('/home/thief/.vim/dein/repos/github.com/Shougo/dein.vim')

  call dein#add('Shougo/deoplete.nvim')
  call dein#add('mhartington/nvim-typescript')
  call dein#add('HerringtonDarkholme/yats.vim')

  " Required
  call dein#end()
  call dein#save_state()

endif

" Required
filetype plugin indent on
syntax enable

I am using the default angular project to reduce complexity

  1. git clone https://github.com/angular/quickstart.git quickstart
  2. cd quickstart
  3. npm install
  4. tsc init <- creation of default tsconfig.json and tslint.json
  5. cp ts*.json src/
  6. nvim .
  7. :CheckHealth

Screen shot

selection_048

[Bug] deoplete-typescript breaks with TypeScript compiler nightly

Reproduction:

npm install -g typescript@next

With latest nvim, deoplete and deoplete-typescript, expression like obj.metho does not have correct completion, but global variable and function.

It works with current stable compiler, more specifically, nightly@20160929 also works.

Really don't what happened here... But I believe it's tsserver's bug.

Better omni-func support

Right now, we have a very limited omni-func support in place. The method it uses to get the prefix is not great, and can be improved.

        if args[0]:
            while start > 0 and re.match('a-z,A-Z,48-57,_,.,-,', line_str[start - 1]):
                start -= 1
            return start
        else:

Is what we have now, but only catches the first letter, and not the full word. Need to fix this.

Pass arguments to TSC?

Maybe I'm just failing to grok something about makeprg (is makeprg being used behind the scenes here? I don't even know), but it would be killer to be able to use the -p flag to tell the completer that tsconfig.json is not in the same directory.

Issues with TS 2.0?

Getting this in :messages when using with TypeScript@2:

[deoplete] Traceback (most recent call last):
[deoplete]   File "/Users/faceleg/.cache/nvim/dein/.dein/rplugin/python3/deoplete/deoplete.py", line 47, in completion_begin
[deoplete]     complete_position, candidates = self.gather_candidates(context)
[deoplete]   File "/Users/faceleg/.cache/nvim/dein/.dein/rplugin/python3/deoplete/deoplete.py", line 73, in gather_candidates
[deoplete]     results = self.gather_results(context)
[deoplete]   File "/Users/faceleg/.cache/nvim/dein/.dein/rplugin/python3/deoplete/deoplete.py", line 124, in gather_results
[deoplete]     context['candidates'] = source.gather_candidates(context)
[deoplete]   File "/Users/faceleg/.cache/nvim/dein/.dein/rplugin/python3/deoplete/sources/typescript.py", line 139, in gather_candidates
[deoplete]     if (entry["kind"] != "warning"):
[deoplete] TypeError: string indices must be integers
[deoplete] An error has occurred. Please execute :messages command.
[deoplete] Traceback (most recent call last):
[deoplete]   File "/Users/faceleg/.cache/nvim/dein/.dein/rplugin/python3/deoplete/deoplete.py", line 47, in completion_begin
[deoplete]     complete_position, candidates = self.gather_candidates(context)
[deoplete]   File "/Users/faceleg/.cache/nvim/dein/.dein/rplugin/python3/deoplete/deoplete.py", line 73, in gather_candidates
[deoplete]     results = self.gather_results(context)
[deoplete]   File "/Users/faceleg/.cache/nvim/dein/.dein/rplugin/python3/deoplete/deoplete.py", line 124, in gather_results
[deoplete]     context['candidates'] = source.gather_candidates(context)
[deoplete]   File "/Users/faceleg/.cache/nvim/dein/.dein/rplugin/python3/deoplete/sources/typescript.py", line 139, in gather_candidates
[deoplete]     if (entry["kind"] != "warning"):
[deoplete] TypeError: string indices must be integers
[deoplete] An error has occurred. Please execute :messages command.
[deoplete] Traceback (most recent call last):
[deoplete]   File "/Users/faceleg/.cache/nvim/dein/.dein/rplugin/python3/deoplete/deoplete.py", line 47, in completion_begin
[deoplete]     complete_position, candidates = self.gather_candidates(context)
[deoplete]   File "/Users/faceleg/.cache/nvim/dein/.dein/rplugin/python3/deoplete/deoplete.py", line 73, in gather_candidates
[deoplete]     results = self.gather_results(context)
[deoplete]   File "/Users/faceleg/.cache/nvim/dein/.dein/rplugin/python3/deoplete/deoplete.py", line 124, in gather_results

Haven't had a chance to start debugging.

Deoplete stops showing Typescript completions

While using nvim-typescript deoplete just stop showing Typescript completions after a few completions are done. I've debuged the deoplete log, and I've some spamming messages. I am not really sure what is the problem, but while using this plugin it occurs.

Environment Information

Gnome terminal: 3.16
Neovim: 0.2.1

let g:deoplete#enable_at_startup = 1
let g:deoplete#enable_smart_case = 1

The reproduce ways from neovim starting

Completions works for a couple of words than just stops, sometimes it comes back after several minutes.

Example project repo?

I am using typesript 2.5.2.

Screenshots

deoplete_typescript_screenshot

deoplete-typescript-screenshot2

Log file

The messages are comming non stop...

Key point is: sent [0, 75771, 'nvim_get_var', ('nvim_typescript#kind_symbols',)]

2017-11-13 20:45:10,972 [DEBUG @ msgpack_stream.py:send:33] 13024 - sent [0, 80941, 'nvim_get_var', ('nvim_typescript#kind_symbols',)]
2017-11-13 20:45:10,972 [DEBUG @ base.py:send:113] 13024 - Sending 'b'\x94\x00\xce\x00\x01<-\xacnvim_get_var\x91\xbcnvim_typescript#kind_symbols''
2017-11-13 20:45:10,972 [DEBUG @ session.py:_yielding_request:152] 13024 - yielding from greenlet <greenlet.greenlet object at 0x7ffa5b412b90> to wait for response
2017-11-13 20:45:10,972 [DEBUG @ msgpack_stream.py:_on_data:54] 13024 - waiting for message...
2017-11-13 20:45:10,972 [DEBUG @ msgpack_stream.py:_on_data:59] 13024 - unpacker needs more data...
2017-11-13 20:45:10,972 [DEBUG @ msgpack_stream.py:_on_data:54] 13024 - waiting for message...
2017-11-13 20:45:10,973 [DEBUG @ msgpack_stream.py:_on_data:56] 13024 - received message: [1, 80940, None, {b'property': b'prop', b'type': b'type', b'let': b'let', b'method': b'method', b'interface': b'interface', b'index': b'index', b'module': b'module', b'type parameter': b'type param', b'setter': b'setter', b'label': b'label', b'var': b'var', b'alias': b'alias', b'keyword': b'keyword', b'call': b'call', b'parameter': b'param', b'primitive type': b'primitive type', b'function': b'function', b'getter': b'getter', b'local class': b'local class', b'local var': b'local var', b'local function': b'local function', b'constructor': b'constructor', b'script': b'script', b'class': b'class', b'enum': b'enum', b'const': b'const'}]
2017-11-13 20:45:10,973 [DEBUG @ async_session.py:_on_response:95] 13024 - received response: None, {b'property': b'prop', b'type': b'type', b'let': b'let', b'method': b'method', b'interface': b'interface', b'index': b'index', b'module': b'module', b'type parameter': b'type param', b'setter': b'setter', b'label': b'label', b'var': b'var', b'alias': b'alias', b'keyword': b'keyword', b'call': b'call', b'parameter': b'param', b'primitive type': b'primitive type', b'function': b'function', b'getter': b'getter', b'local class': b'local class', b'local var': b'local var', b'local function': b'local function', b'constructor': b'constructor', b'script': b'script', b'class': b'class', b'enum': b'enum', b'const': b'const'}
2017-11-13 20:45:10,973 [DEBUG @ session.py:response_cb:148] 13024 - response is available for greenlet <greenlet.greenlet object at 0x7ffa5a8c5f20>, switching back
2017-11-13 20:45:10,973 [DEBUG @ msgpack_stream.py:send:33] 13024 - sent [0, 80942, 'nvim_get_var', ('nvim_typescript#kind_symbols',)]
2017-11-13 20:45:10,973 [DEBUG @ base.py:send:113] 13024 - Sending 'b'\x94\x00\xce\x00\x01<.\xacnvim_get_var\x91\xbcnvim_typescript#kind_symbols''
2017-11-13 20:45:10,973 [DEBUG @ session.py:_yielding_request:152] 13024 - yielding from greenlet <greenlet.greenlet object at 0x7ffa5a8c5f20> to wait for response
2017-11-13 20:45:10,973 [DEBUG @ msgpack_stream.py:_on_data:54] 13024 - waiting for message...
2017-11-13 20:45:10,974 [DEBUG @ msgpack_stream.py:_on_data:56] 13024 - received message: [1, 80941, None, {b'property': b'prop', b'type': b'type', b'let': b'let', b'method': b'method', b'interface': b'interface', b'index': b'index', b'module': b'module', b'type parameter': b'type param', b'setter': b'setter', b'label': b'label', b'var': b'var', b'alias': b'alias', b'keyword': b'keyword', b'call': b'call', b'parameter': b'param', b'primitive type': b'primitive type', b'function': b'function', b'getter': b'getter', b'local class': b'local class', b'local var': b'local var', b'local function': b'local function', b'constructor': b'constructor', b'script': b'script', b'class': b'class', b'enum': b'enum', b'const': b'const'}]
2017-11-13 20:45:10,974 [DEBUG @ async_session.py:_on_response:95] 13024 - received response: None, {b'property': b'prop', b'type': b'type', b'let': b'let', b'method': b'method', b'interface': b'interface', b'index': b'index', b'module': b'module', b'type parameter': b'type param', b'setter': b'setter', b'label': b'label', b'var': b'var', b'alias': b'alias', b'keyword': b'keyword', b'call': b'call', b'parameter': b'param', b'primitive type': b'primitive type', b'function': b'function', b'getter': b'getter', b'local class': b'local class', b'local var': b'local var', b'local function': b'local function', b'constructor': b'constructor', b'script': b'script', b'class': b'class', b'enum': b'enum', b'const': b'const'}
2017-11-13 20:45:10,974 [DEBUG @ session.py:response_cb:148] 13024 - response is available for greenlet <greenlet.greenlet object at 0x7ffa5b412b90>, switching back
2017-11-13 20:45:10,974 [DEBUG @ msgpack_stream.py:send:33] 13024 - sent [0, 80943, 'nvim_get_var', ('nvim_typescript#kind_symbols',)]
2017-11-13 20:45:10,974 [DEBUG @ base.py:send:113] 13024 - Sending 'b'\x94\x00\xce\x00\x01</\xacnvim_get_var\x91\xbcnvim_typescript#kind_symbols''
2017-11-13 20:45:10,974 [DEBUG @ session.py:_yielding_request:152] 13024 - yielding from greenlet <greenlet.greenlet object at 0x7ffa5b412b90> to wait for response
2017-11-13 20:45:10,975 [DEBUG @ msgpack_stream.py:_on_data:54] 13024 - waiting for message...
2017-11-13 20:45:10,975 [DEBUG @ msgpack_stream.py:_on_data:59] 13024 - unpacker needs more data...
2017-11-13 20:45:10,975 [DEBUG @ msgpack_stream.py:_on_data:54] 13024 - waiting for message...
2017-11-13 20:45:10,975 [DEBUG @ msgpack_stream.py:_on_data:56] 13024 - received message: [1, 80942, None, {b'property': b'prop', b'type': b'type', b'let': b'let', b'method': b'method', b'interface': b'interface', b'index': b'index', b'module': b'module', b'type parameter': b'type param', b'setter': b'setter', b'label': b'label', b'var': b'var', b'alias': b'alias', b'keyword': b'keyword', b'call': b'call', b'parameter': b'param', b'primitive type': b'primitive type', b'function': b'function', b'getter': b'getter', b'local class': b'local class', b'local var': b'local var', b'local function': b'local function', b'constructor': b'constructor', b'script': b'script', b'class': b'class', b'enum': b'enum', b'const': b'const'}]
2017-11-13 20:45:10,975 [DEBUG @ async_session.py:_on_response:95] 13024 - received response: None, {b'property': b'prop', b'type': b'type', b'let': b'let', b'method': b'method', b'interface': b'interface', b'index': b'index', b'module': b'module', b'type parameter': b'type param', b'setter': b'setter', b'label': b'label', b'var': b'var', b'alias': b'alias', b'keyword': b'keyword', b'call': b'call', b'parameter': b'param', b'primitive type': b'primitive type', b'function': b'function', b'getter': b'getter', b'local class': b'local class', b'local var': b'local var', b'local function': b'local function', b'constructor': b'constructor', b'script': b'script', b'class': b'class', b'enum': b'enum', b'const': b'const'}
2017-11-13 20:45:10,975 [DEBUG @ session.py:response_cb:148] 13024 - response is available for greenlet <greenlet.greenlet object at 0x7ffa5a8c5f20>, switching back
2017-11-13 20:45:10,975 [DEBUG @ msgpack_stream.py:send:33] 13024 - sent [0, 80944, 'nvim_get_var', ('nvim_typescript#kind_symbols',)]
2017-11-13 20:45:10,976 [DEBUG @ base.py:send:113] 13024 - Sending 'b'\x94\x00\xce\x00\x01<0\xacnvim_get_var\x91\xbcnvim_typescript#kind_symbols''
2017-11-13 20:45:10,976 [DEBUG @ session.py:_yielding_request:152] 13024 - yielding from greenlet <greenlet.greenlet object at 0x7ffa5a8c5f20> to wait for response
2017-11-13 20:45:10,976 [DEBUG @ msgpack_stream.py:_on_data:54] 13024 - waiting for message...
2017-11-13 20:45:10,976 [DEBUG @ msgpack_stream.py:_on_data:56] 13024 - received message: [1, 80943, None, {b'property': b'prop', b'type': b'type', b'let': b'let', b'method': b'method', b'interface': b'interface', b'index': b'index', b'module': b'module', b'type parameter': b'type param', b'setter': b'setter', b'label': b'label', b'var': b'var', b'alias': b'alias', b'keyword': b'keyword', b'call': b'call', b'parameter': b'param', b'primitive type': b'primitive type', b'function': b'function', b'getter': b'getter', b'local class': b'local class', b'local var': b'local var', b'local function': b'local function', b'constructor': b'constructor', b'script': b'script', b'class': b'class', b'enum': b'enum', b'const': b'const'}]
2017-11-13 20:45:10,976 [DEBUG @ async_session.py:_on_response:95] 13024 - received response: None, {b'property': b'prop', b'type': b'type', b'let': b'let', b'method': b'method', b'interface': b'interface', b'index': b'index', b'module': b'module', b'type parameter': b'type param', b'setter': b'setter', b'label': b'label', b'var': b'var', b'alias': b'alias', b'keyword': b'keyword', b'call': b'call', b'parameter': b'param', b'primitive type': b'primitive type', b'function': b'function', b'getter': b'getter', b'local class': b'local class', b'local var': b'local var', b'local function': b'local function', b'constructor': b'constructor', b'script': b'script', b'class': b'class', b'enum': b'enum', b'const': b'const'}
2017-11-13 20:45:10,976 [DEBUG @ session.py:response_cb:148] 13024 - response is available for greenlet <greenlet.greenlet object at 0x7ffa5b412b90>, switching back
2017-11-13 20:45:10,977 [DEBUG @ msgpack_stream.py:send:33] 13024 - sent [0, 80945, 'nvim_get_var', ('nvim_typescript#kind_symbols',)]
2017-11-13 20:45:10,977 [DEBUG @ base.py:send:113] 13024 - Sending 'b'\x94\x00\xce\x00\x01<1\xacnvim_get_var\x91\xbcnvim_typescript#kind_symbols''
2017-11-13 20:45:10,977 [DEBUG @ session.py:_yielding_request:152] 13024 - yielding from greenlet <greenlet.greenlet object at 0x7ffa5b412b90> to wait for response
2017-11-13 20:45:10,977 [DEBUG @ msgpack_stream.py:_on_data:54] 13024 - waiting for message...
2017-11-13 20:45:10,977 [DEBUG @ msgpack_stream.py:_on_data:59] 13024 - unpacker needs more data...
2017-11-13 20:45:10,977 [DEBUG @ msgpack_stream.py:_on_data:54] 13024 - waiting for message...
2017-11-13 20:45:10,977 [DEBUG @ msgpack_stream.py:_on_data:56] 13024 - received message: [1, 80944, None, {b'property': b'prop', b'type': b'type', b'let': b'let', b'method': b'method', b'interface': b'interface', b'index': b'index', b'module': b'module', b'type parameter': b'type param', b'setter': b'setter', b'label': b'label', b'var': b'var', b'alias': b'alias', b'keyword': b'keyword', b'call': b'call', b'parameter': b'param', b'primitive type': b'primitive type', b'function': b'function', b'getter': b'getter', b'local class': b'local class', b'local var': b'local var', b'local function': b'local function', b'constructor': b'constructor', b'script': b'script', b'class': b'class', b'enum': b'enum', b'const': b'const'}]
2017-11-13 20:45:10,977 [DEBUG @ async_session.py:_on_response:95] 13024 - received response: None, {b'property': b'prop', b'type': b'type', b'let': b'let', b'method': b'method', b'interface': b'interface', b'index': b'index', b'module': b'module', b'type parameter': b'type param', b'setter': b'setter', b'label': b'label', b'var': b'var', b'alias': b'alias', b'keyword': b'keyword', b'call': b'call', b'parameter': b'param', b'primitive type': b'primitive type', b'function': b'function', b'getter': b'getter', b'local class': b'local class', b'local var': b'local var', b'local function': b'local function', b'constructor': b'constructor', b'script': b'script', b'class': b'class', b'enum': b'enum', b'const': b'const'}
2017-11-13 20:45:10,977 [DEBUG @ session.py:response_cb:148] 13024 - response is available for greenlet <greenlet.greenlet object at 0x7ffa5a8c5f20>, switching back
2017-11-13 20:45:10,978 [DEBUG @ msgpack_stream.py:send:33] 13024 - sent [0, 80946, 'nvim_get_var', ('nvim_typescript#kind_symbols',)]
2017-11-13 20:45:10,978 [DEBUG @ base.py:send:113] 13024 - Sending 'b'\x94\x00\xce\x00\x01<2\xacnvim_get_var\x91\xbcnvim_typescript#kind_symbols''
2017-11-13 20:45:10,978 [DEBUG @ session.py:_yielding_request:152] 13024 - yielding from greenlet <greenlet.greenlet object at 0x7ffa5a8c5f20> to wait for response
2017-11-13 20:45:10,978 [DEBUG @ msgpack_stream.py:_on_data:54] 13024 - waiting for message...
2017-11-13 20:45:10,978 [DEBUG @ msgpack_stream.py:_on_data:56] 13024 - received message: [1, 80945, None, {b'property': b'prop', b'type': b'type', b'let': b'let', b'method': b'method', b'interface': b'interface', b'index': b'index', b'module': b'module', b'type parameter': b'type param', b'setter': b'setter', b'label': b'label', b'var': b'var', b'alias': b'alias', b'keyword': b'keyword', b'call': b'call', b'parameter': b'param', b'primitive type': b'primitive type', b'function': b'function', b'getter': b'getter', b'local class': b'local class', b'local var': b'local var', b'local function': b'local function', b'constructor': b'constructor', b'script': b'script', b'class': b'class', b'enum': b'enum', b'const': b'const'}]
2017-11-13 20:45:10,978 [DEBUG @ async_session.py:_on_response:95] 13024 - received response: None, {b'property': b'prop', b'type': b'type', b'let': b'let', b'method': b'method', b'interface': b'interface', b'index': b'index', b'module': b'module', b'type parameter': b'type param', b'setter': b'setter', b'label': b'label', b'var': b'var', b'alias': b'alias', b'keyword': b'keyword', b'call': b'call', b'parameter': b'param', b'primitive type': b'primitive type', b'function': b'function', b'getter': b'getter', b'local class': b'local class', b'local var': b'local var', b'local function': b'local function', b'constructor': b'constructor', b'script': b'script', b'class': b'class', b'enum': b'enum', b'const': b'const'}
2017-11-13 20:45:10,979 [DEBUG @ session.py:response_cb:148] 13024 - response is available for greenlet <greenlet.greenlet object at 0x7ffa5b412b90>, switching back
2017-11-13 20:45:10,979 [DEBUG @ msgpack_stream.py:send:33] 13024 - sent [0, 80947, 'nvim_get_var', ('nvim_typescript#kind_symbols',)]
2017-11-13 20:45:10,979 [DEBUG @ base.py:send:113] 13024 - Sending 'b'\x94\x00\xce\x00\x01<3\xacnvim_get_var\x91\xbcnvim_typescript#kind_symbols''
2017-11-13 20:45:10,979 [DEBUG @ session.py:_yielding_request:152] 13024 - yielding from greenlet <greenlet.greenlet object at 0x7ffa5b412b90> to wait for response
2017-11-13 20:45:10,979 [DEBUG @ msgpack_stream.py:_on_data:54] 13024 - waiting for message...

Thanks for your help.

TSGetErr: No output

Hi,

How do I use TSGetErr? If I provoke an error, e.g., by removing an import statement, calling TSGetErr does not show anything.

Testing

I think testing would be greatly beneficial.

After some looking around I found the following:

  • Ribosome - neovim python plugin framework
    Looks very complete but also is very intrusive. I feel like using this would require a major rewrite.
    This would allow functional and unit tests

  • Vroom
    Very elegant test case writing (see here. This would be a good candidate for functional testing.

  • Python unittest
    This could be used to unit test python methods individually, in combination with Vroom it could be a good solution.

I'm not very familiar with testing with python and vim so it is very likely that I missed a better option.

Thanks !

BrokenPipeError: [Errno 32] Broken pipe when modifying a typescript file

Using the following neovim (python3 support included):

โ†’ nvim --version
NVIM 0.2.0-dev
Build type: RelWithDebInfo
Compilation: /usr/bin/x86_64-linux-gnu-gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -g -DDISABLE_LOG -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wvla -fstack-protector --param ssp-buffer-size=4 -DINCLUDE_GENERATED_DECLARATIONS -DHAVE_CONFIG_H -D_GNU_SOURCE -I/build/neovim-HzUNdy/neovim-0.1.5ubuntu1+git201611271903+2919+22~ubuntu14.04.1/build/config -I/build/neovim-HzUNdy/neovim-0.1.5ubuntu1+git201611271903+2919+22~ubuntu14.04.1/src -I/build/neovim-HzUNdy/neovim-0.1.5ubuntu1+git201611271903+2919+22~ubuntu14.04.1/.deps/usr/include -I/build/neovim-HzUNdy/neovim-0.1.5ubuntu1+git201611271903+2919+22~ubuntu14.04.1/.deps/usr/include -I/build/neovim-HzUNdy/neovim-0.1.5ubuntu1+git201611271903+2919+22~ubuntu14.04.1/.deps/usr/include -I/build/neovim-HzUNdy/neovim-0.1.5ubuntu1+git201611271903+2919+22~ubuntu14.04.1/.deps/usr/include -I/build/neovim-HzUNdy/neovim-0.1.5ubuntu1+git201611271903+2919+22~ubuntu14.04.1/.deps/usr/include -I/build/neovim-HzUNdy/neovim-0.1.5ubuntu1+git201611271903+2919+22~ubuntu14.04.1/.deps/usr/include -I/usr/include -I/build/neovim-HzUNdy/neovim-0.1.5ubuntu1+git201611271903+2919+22~ubuntu14.04.1/build/src/nvim/auto -I/build/neovim-HzUNdy/neovim-0.1.5ubuntu1+git201611271903+2919+22~ubuntu14.04.1/build/include
Compiled by root@lgw01-12

Optional features included (+) or not (-): +acl   +iconv    +jemalloc +tui      
For differences from Vim, see :help vim-differences

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

and the latest deoplete-typescript, I'm getting the following python exception traceback every time I edit a .ts file. The error occurs immediately when the file is opened and subsequently for every modification attempt, making usage completely impossible.

error caught in async handler '/home/emikkva/.config/nvim/plugged/deoplete-typescript/rplugin/python3/nvim-typescript:autocmd:BufWritePost:*.ts,*.tsx []'                                     
Traceback (most recent call last):                                                                                                                                                            
  File "/home/emikkva/.config/nvim/plugged/deoplete-typescript/rplugin/python3/nvim-typescript/__init__.py", line 220, in on_bufwritepost                                                     
    self.reload()                                                                                                                                                                             
  File "/home/emikkva/.config/nvim/plugged/deoplete-typescript/rplugin/python3/nvim-typescript/__init__.py", line 74, in reload                                                               
    self._client.reload(filename, tmpfile.name)                                                                                                                                               
  File "/home/emikkva/.config/nvim/plugged/deoplete-typescript/rplugin/python3/nvim-typescript/client.py", line 165, in reload                                                                
    response = self.send_request("reload", args, True)                                                                                                                                        
  File "/home/emikkva/.config/nvim/plugged/deoplete-typescript/rplugin/python3/nvim-typescript/client.py", line 95, in send_request                                                           
    self.__send_data_to_server(request)                                                                                                                                                       
  File "/home/emikkva/.config/nvim/plugged/deoplete-typescript/rplugin/python3/nvim-typescript/client.py", line 59, in __send_data_to_server                                                  
    Client.__server_handle.stdin.write("\n")                                                                                                                                                  
BrokenPipeError: [Errno 32] Broken pipe 

Is this a bug / issue in deoplete-typescript, or related to the neovim version?

Sluggishness after update on first insert command

I use dein for controlling my plugins. I deactivated one by one and found this plugin is making Neovim really slow when switching from Normal to Insert mode for the first time. I mean, really slow. But only for the first time I go to Insert mode. After the first time, it is normal again.

I never had any similar issues with this plugin before until I updated it today...

Long term goals

Just some random plans/ideas I have for this project.

  • Extract the TSServer client out into it's own class. This will give a good base for what I want to do.
  • Use neovims remote pluing API and build out more features. GOTO/Rename Symbol/Definitions.
    All of this is provided by the language service API/TSS. It can be as simple as
  def _GetDoc( self, request_data ):
    self._Reload( request_data )
    info = self._SendRequest( 'quickinfo', {
      'file':   request_data[ 'filepath' ],
      'line':   request_data[ 'line_num' ],
      'offset': request_data[ 'column_codepoint' ]
    } )

Taken from ycmd

  • Make faster! Currently, if there is a large list returned from the subprocess, trying to return the completion detail is not great. It can really slow down the whole thing. Not sure how this can be done, but it's a long term goal ๐Ÿ˜

TS 2.1 RC update

Another new version of TS, another change to tsserver....

Looks like there is a new request being returned, which is messing up completion.

^[^[^[2016-11-09 08:21:25,482 INFO     (deoplete.logging) --- Deoplete Log Start ---
2016-11-09 08:21:25,482 INFO     (deoplete.logging) NVIM v0.2.0-36-gbd33f11, Python 3.5.2, neovim client 0.1.9
2016-11-09 08:21:26,959 DEBUG    (deoplete.typescript) Request: {"seq": 1, "command": "open", "type": "request", "arguments": {"file": "/Users/mhartington/GitHub/ionic/tmp/src/pages/home/home.ts"}}
2016-11-09 08:21:26,961 DEBUG    (deoplete.typescript) Request: {"seq": 2, "command": "open", "type": "request", "arguments": {"file": "/Users/mhartington/GitHub/ionic/tmp/src/pages/home/home.ts"}}
2016-11-09 08:21:27,900 DEBUG    (deoplete.typescript) Request: {"seq": 3, "command": "reload", "type": "request", "arguments": {"tmpfile": "/var/folders/r7/jttq31p92l96ksjpw92c589r0000gn/T/tmp0cgkuaxo", "file": "/Users/mhartington/GitHub/ionic/tmp/src/pages/home/home.ts"}}
2016-11-09 08:21:28,848 DEBUG    (deoplete.typescript) Response:
{"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/Users/mhartington/GitHub/ionic/tmp/src/pages/home/home.ts","configFile":"/Users/mhartington/GitHub/ionic/tmp/tsconfig.json","diagnostics":[]}}
2016-11-09 08:21:28,864 DEBUG    (deoplete.typescript) Request: {"seq": 4, "command": "completions", "type": "request", "arguments": {"prefix": "", "line": 16, "offset": 10, "file": "/Users/mhartington/GitHub/ionic/tmp/src/pages/home/home.ts"}}
2016-11-09 08:21:28,964 DEBUG    (deoplete.typescript) Response:
{"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/Users/mhartington/GitHub/ionic/tmp/src/pages/home/home.ts","configFile":"/Users/mhartington/GitHub/ionic/tmp/tsconfig.json","diagnostics":[]}}

Looks like open is getting sent twice, and there's this new configFileDiag event that gets returned.

Unknown function: TSOnBufEnter

Problems summary

When opening a .ts file, I get the following error:

Error detected while processing BufEnter Auto commands for "*.ts":
E117: Unknown function: TSOnBufEnter

Autocompletion with Deoplete doesn't work (but works for other file types). If I disable nvim-typescript, I don't get the error.

Expected

No errors and working autocompletion.

Environment Information

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

set nocompatible

call plug#begin('~/.local/share/nvim/plugged')

Plug 'leafgarland/typescript-vim', { 'for': 'typescript' }

Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'mhartington/deoplete-typescript', { 'do': 'npm install -g typescript', 'for': 'typescript' }
let g:deoplete#enable_at_startup = 1

call plug#end()

The reproduce ways from neovim starting

  1. Open a .ts file

Error entering in Typescript files

When I enter a typescript file, it pops up this error:
screen shot 2016-09-24 at 00 32 39

I push enter key twice and then I can work, but then I open another typescript file and the same error.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.