├── .gitignore ├── .travis.yml ├── README-jp.md ├── README.md ├── autoload ├── tscompletejob.vim └── tscompletejob │ ├── bufmanager.vim │ ├── jobcompat.vim │ ├── tagmanager.vim │ ├── tsclient.vim │ ├── tsswrapper │ ├── .gitignore │ ├── index.js │ ├── legacy │ │ ├── tsswrapper.js │ │ ├── tsswrapper200.js │ │ └── tsswrapper210.js │ ├── lib │ │ ├── custom_protocol.js │ │ ├── tsswrapper.js │ │ ├── tsswrapper.test.js │ │ └── utils.js │ ├── node_modules │ │ ├── .bin │ │ │ ├── tsc │ │ │ └── tsserver │ │ └── typescript │ │ │ ├── .mailmap │ │ │ ├── AUTHORS.md │ │ │ ├── CONTRIBUTING.md │ │ │ ├── CopyrightNotice.txt │ │ │ ├── LICENSE.txt │ │ │ ├── README.md │ │ │ ├── ThirdPartyNoticeText.txt │ │ │ ├── bin │ │ │ ├── tsc │ │ │ └── tsserver │ │ │ ├── lib │ │ │ ├── README.md │ │ │ ├── cancellationToken.js │ │ │ ├── lib.d.ts │ │ │ ├── lib.dom.d.ts │ │ │ ├── lib.dom.iterable.d.ts │ │ │ ├── lib.es2015.collection.d.ts │ │ │ ├── lib.es2015.core.d.ts │ │ │ ├── lib.es2015.d.ts │ │ │ ├── lib.es2015.generator.d.ts │ │ │ ├── lib.es2015.iterable.d.ts │ │ │ ├── lib.es2015.promise.d.ts │ │ │ ├── lib.es2015.proxy.d.ts │ │ │ ├── lib.es2015.reflect.d.ts │ │ │ ├── lib.es2015.symbol.d.ts │ │ │ ├── lib.es2015.symbol.wellknown.d.ts │ │ │ ├── lib.es2016.array.include.d.ts │ │ │ ├── lib.es2016.d.ts │ │ │ ├── lib.es2017.d.ts │ │ │ ├── lib.es2017.object.d.ts │ │ │ ├── lib.es2017.sharedmemory.d.ts │ │ │ ├── lib.es2017.string.d.ts │ │ │ ├── lib.es5.d.ts │ │ │ ├── lib.es6.d.ts │ │ │ ├── lib.scripthost.d.ts │ │ │ ├── lib.webworker.d.ts │ │ │ ├── protocol.d.ts │ │ │ ├── tsc.js │ │ │ ├── tsserver.js │ │ │ ├── tsserverlibrary.d.ts │ │ │ ├── tsserverlibrary.js │ │ │ ├── typescript.d.ts │ │ │ ├── typescript.js │ │ │ ├── typescriptServices.d.ts │ │ │ ├── typescriptServices.js │ │ │ └── typingsInstaller.js │ │ │ └── package.json │ ├── package.json │ ├── scripts │ │ └── extract-tsservers.sh │ ├── src │ │ ├── custom_protocol.ts │ │ ├── tsswrapper.test.ts │ │ ├── tsswrapper.ts │ │ └── utils.ts │ ├── testdata │ │ ├── codefix.ts │ │ ├── errors.ts │ │ ├── mod.ts │ │ ├── sample1.ts │ │ ├── tsconfig.json │ │ ├── tsserver2010.js.xz │ │ ├── tsserver216.js.xz │ │ ├── tsserver220.js.xz │ │ ├── tsserver234.js.xz │ │ ├── tsserver242.js.xz │ │ ├── tsserver253.js.xz │ │ ├── tsserver262.js.xz │ │ └── tsserver271.js.xz │ ├── tsconfig.json │ └── yarn.lock │ └── utils.vim ├── doc ├── tscompletejob.jax └── tscompletejob.txt ├── ftplugin └── typescript.vim ├── plugin └── tscompletejob.vim ├── syntax_checkers └── typescript │ └── tscompletejob.vim └── test ├── codefix.ts ├── errors.ts ├── format.ts ├── mod.ts ├── rename.ts ├── sample1.ts └── tscompletejob.vader /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | /runtest.sh 3 | !/autoload/tscompletejob/tsswrapper/node_modules/typescript 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: vim 2 | 3 | before_script: | 4 | git clone https://github.com/junegunn/vader.vim.git 5 | 6 | install: | 7 | sudo apt-get install -y gettext libncurses5-dev libacl1-dev libgpm-dev 8 | git clone https://github.com/vim/vim /tmp/vim 9 | saved_pwd=`pwd` 10 | cd /tmp/vim 11 | version=v8.0.0237 12 | git checkout ${version} 13 | mkdir ~/bin 14 | ./configure --with-features=huge --enable-fail-if-missing --prefix=$HOME/bin/vim${version} 15 | make && make install 16 | export MY_VIM=$HOME/bin/vim${version}/bin/vim 17 | cd ${saved_pwd} 18 | 19 | script: | 20 | ${MY_VIM} -Nu <(cat < /dev/null 29 | -------------------------------------------------------------------------------- /README-jp.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://travis-ci.org/runoshun/tscompletejob.svg?branch=master)](https://travis-ci.org/runoshun/tscompletejob) 2 | 3 | tscompletejob-vim 4 | ============================ 5 | typescript補完 Vimプラグイン : [デモ](#demo) 6 | 7 | 特徴 8 | ----------------------------------------------------------------------- 9 | - tsserver Vim用ラッパーを利用した高速な補完/動作 10 | - tsserverを利用した定義へのジャンプ、変数情報表示、シグネチャ情報、 11 | コンパイルエラー表示、リネーム、コードフォーマット、参照一覧表示に対応 12 | - Vimのjob/channel機能を利用 13 | 14 | 制限 15 | ----------------------------------------------------------------------- 16 | - cygwin版vimでは動作しません。(ファイルパスの扱いがtsserverと異なってしまうため)。windows nativeのvimを使ってください。 17 | 18 | 必要なもの 19 | ----------------------------------------------------------------------- 20 | - +job/+channel付きのVim or jobcontrol NeoVim 21 | - nodejs(4.x, 6.x) 22 | 23 | インストール 24 | ----------------------------------------------------------------------- 25 | dein/NeoBundle/VimPlugなど任意のパッケージマネージャでインストールしてください。 26 | 27 | ### nodeコマンドの設定 28 | 同梱のtsserverのラッパーを動作させるためにnodejsが必要です。デフォルトでは`node`を利用します。変更するには`g:tscompletejob_node_cmd`を設定して下さい。 29 | ``` vim 30 | let g:tscompletejob_node_cmd = "/path/to/node" 31 | ``` 32 | 33 | 34 | 35 | 基本的な機能・使い方 36 | ----------------------------------------------------------------------- 37 | ### 補完 38 | Filetype`typescript`に対してデフォルトで`omnifunc=tscompletejob#complete`が設定されます。tscompletejobにはftdetectは含まれていませんので、[typescript-vim](https://github.com/leafgarland/typescript-vim)などを使うか、自分で定義してください。 39 | 40 | ### 定義へのジャンプ 41 | 変数、型などの定義位置にジャンプします。 42 | ジャンプしたいシンボル上にカーソルを移動させ、`:TsCompleteJobGotoDefinition`を実行してください。デフォルトでは`C-]`にマップされます。 43 | 44 | ### 変数情報表示 45 | 変数の定義情報/型などをコマンドラインに表示します。 46 | 表示したいシンボル上にカーソルを移動させ、`:TsCompleteJobQuickInfo`を実行してください。デフォルトでは`i`にマップされます。 47 | 48 | ### シグネチャ情報表示 49 | 関数シグネチャ情報を`complete()`を利用したポップアップメニューに表示します。補完候補の実体(word)は空文字列のため、候補を選択しても入力はされません。`completeopt`に`preview`が含まれていれば、候補を選択することでシグネチャ/引数のドキュメントが表示されます。 50 | デフォルトでは`CursorHoldI`イベント発行時、カーソル位置にシグネチャ情報の候補があれば表示されます。 51 | 52 | ### コンパイルエラー表示 53 | [syntastic](https://github.com/scrooloose/syntastic)のチェッカー`tscompletejob`という名前でを提供しています。 54 | 利用する場合はチェッカーを`g:syntastic_typescript_checkers`に追加してください。 55 | ```vim 56 | let g:syntastic_typescript_checkers = ["tscompletejob"] 57 | ``` 58 | 59 | ### その他機能 60 | - シンボルのリネーム `:TsCompleteJobRename` 61 | - コードフォーマット `:TsCompleteJobFormat` 62 | - 参照一覧表示 `:TsCompleteJobReferences` 63 | - コードフィックス `:TsCompleteJobCodeFix` 64 | デフォルトキーマップは[ヘルプ](doc/tscompletejob.jax)を参照してください 65 | 66 | 67 | #### その他 68 | `:TsCompleteJobStatus`でtsserverラッパーを実行しているjobのステータスを表示できます。jobを再起動する場合は`:TsCompleteJobRestart`を実行してください。 69 | 70 | 71 | tsserverラッパーについて 72 | ----------------------------------------------------------------------- 73 | プラグイン同梱のラッパーはtsserverlibrary.jsに依存しています。tsserverlibrary.jsはtypescript2.0以上に同梱されています。特定のバージョンのtsserverlibrary.jsを利用する場合は`g:tscompletejob_custom_tsserverlibrary`を設定してください。設定されない場合はプラグイン同梱のtsserverlibrary.jsが使用されます。 74 | ```vim 75 | let g:tscompletejob_custom_tsserverlibrary = "/path/to/tsserverlibrary.js" 76 | ``` 77 | 78 | 設定・カスタマイズ 79 | ----------------------------------------------------------------------- 80 | [ヘルプ](doc/tscompletejob.jax)を参照してください 81 | 82 | Demo 83 | ----------------------------------------------------------------------- 84 | - 補完 85 | 86 | ![complete demo](https://github.com/runoshun/readme-images/blob/master/tscompletejob/complete.gif?raw=true) 87 | 88 | - 定義へのジャンプ 89 | 90 | ![goto_definition demo](https://github.com/runoshun/readme-images/blob/master/tscompletejob/goto_definition.gif?raw=true) 91 | 92 | - 関数シグネチャ表示 93 | 94 | ![signature_help demo](https://github.com/runoshun/readme-images/blob/master/tscompletejob/signature_help.gif?raw=true) 95 | 96 | テストの実行 97 | ----------------------------------------------------------------------- 98 | 1. [Vader](https://github.com/junegunn/vader.vim)をインストール 99 | 2. `:Vader test/tscompletejob.vader`を実行 100 | 101 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This repository is no longer maintained. 2 | ============================ 3 | 4 | [![Build Status](https://travis-ci.org/runoshun/tscompletejob.svg?branch=master)](https://travis-ci.org/runoshun/tscompletejob) 5 | 6 | tscompletejob-vim 7 | ============================ 8 | Typescript code complete plugin for Vim : [demo](#demo) 9 | 10 | 日本語版READMEは[こちら](README-jp.md) 11 | 12 | Features 13 | ----------------------------------------------------------------------- 14 | - Fast complete/behavior using wrapper of tsserver for Vim 15 | - Supported features are Go to Definition, Quick Info, Signature Help, 16 | Show Compile Errors, Symbol Rename and Show References. 17 | - Using job, channel features of vim 18 | - Use jobcontrol features of Neovim 19 | 20 | Limitations 21 | ----------------------------------------------------------------------- 22 | - tscompletejob can't work in cygwin vim (due to file path differ between vim and tsserver). Please use windows native vim. 23 | 24 | Requirements 25 | ----------------------------------------------------------------------- 26 | - +job/+channel Vim or jobcontrol Neovim 27 | - nodejs (4.x, 6.x) 28 | 29 | Install 30 | ----------------------------------------------------------------------- 31 | This plugin has no special install requirements, so you can install with 32 | your favorite package manager. 33 | 34 | ### Setting of node command 35 | Nodejs is required to execute tsserver wrapper. `node` is used by default. 36 | If you need to change it, please set `g:tscompletejob_node_cmd`. 37 | ```vim 38 | let g:tscompletejob_node_cmd = "/path/to/node" 39 | ``` 40 | 41 | Basic Functions and Usage 42 | ----------------------------------------------------------------------- 43 | ### Code Complete 44 | `omnifunc=tscompletejob#complete` is set by default in filetype:`typescript`. 45 | tscompletejob has no ftdetect, please use [typescript-vim](https://github.com/leafgarland/typescript-vim) 46 | etc. or define ftdetect by yourself. 47 | 48 | 49 | ### Goto Definition 50 | It jump to difinition of variable or type. 51 | Move cursor to symbol which you want to find difinition, and execute `:TsCompleteJobGotoDefinition`. By default, the command is mapped to `C-]`. 52 | And you can use simple tagstack like feature by setting `g:tscompletejob_enable_tagstack` to 1. If tagstack is enabled, tscompletejob record history of cursor position when executing `:TsCompleteJobGotoDefinition`, and you can follow history using `:TsCompleteJobGotoPrev` (mapped to `C-t`), `:TsCompleteJobGotoNext`. 53 | 54 | ### Quick info 55 | It show symbol's quick infomation to command line. 56 | Move cursor to symbol which you want to show info, and execute `:TsCompleteJobQuickInfo`. By default, it is mapped to `i` 57 | 58 | ### Call signature help 59 | It show call signature infomations in popup menu using `complete()`. A bodies('word') of item in popup menu are empty, so no input on selection. If `completeopt` has `preview`, signature/parameter documentations are shown in preview window. 60 | By default, signature help is shown at `CursorHold` event, If help exists at current cursor position. 61 | 62 | ### Show compile error 63 | "tscompletejob" provides [syntastic](https://github.com/scrooloose/syntastic) checker named `tscompletejob`. If you use it, please add this checker to `g:syntastic_typescript_checkers`. For example, 64 | ```vim 65 | let g:syntastic_typescript_checkers = ["tscompletejob"] 66 | ``` 67 | 68 | ### Other features 69 | - Symbol rename `:TsCompleteJobRename` 70 | - Code formatting `:TsCompleteJobFormat` 71 | - Show Occurrences `:TsCompleteJobReferences` 72 | - Quick code fix `:TsCompleteJobCodeFix` 73 | About default key mappings, see [help](doc/tscompletejob.txt). 74 | 75 | ### Debugging 76 | `:TsCompleteJobStatus` show status of job. If you need restart job, you can use `TsCompleteJobRestart`. 77 | 78 | 79 | Use another typescript version 80 | ----------------------------------------------------------------------- 81 | The typescript version bundled this plugin is currently 2.7.1. If you want use another typescript version, please set `g:tscompletejob_custom_tsserver`. 82 | ```vim 83 | let g:tscompletejob_custom_tsserver = "/path/to/tsserver.js" 84 | ``` 85 | 86 | Settings and Customization 87 | ----------------------------------------------------------------------- 88 | See [help](doc/tscompletejob.txt). 89 | 90 | Demo 91 | ----------------------------------------------------------------------- 92 | - Code complete 93 | 94 | ![complete demo](https://github.com/runoshun/readme-images/blob/master/tscompletejob/complete.gif?raw=true) 95 | 96 | - Goto Definition 97 | 98 | ![goto_definition demo](https://github.com/runoshun/readme-images/blob/master/tscompletejob/goto_definition.gif?raw=true) 99 | 100 | - Call signature help 101 | 102 | ![signature_help demo](https://github.com/runoshun/readme-images/blob/master/tscompletejob/signature_help.gif?raw=true) 103 | 104 | Running tests 105 | ----------------------------------------------------------------------- 106 | 1. Install [Vader](https://github.com/junegunn/vader.vim) 107 | 2. Execute `:Vader test/tscompletejob.vader` 108 | 109 | -------------------------------------------------------------------------------- /autoload/tscompletejob/bufmanager.vim: -------------------------------------------------------------------------------- 1 | let s:save_cpo = &cpo 2 | set cpo&vim 3 | 4 | let s:instanceCount = 0 5 | 6 | func! tscompletejob#bufmanager#create() 7 | let obj = { 8 | \ "buffers" : { }, 9 | \ "getFileNames" : function("s:getFileNames"), 10 | \ "getFileName" : function("s:getFileName"), 11 | \ "addBuffer" : function("s:addBuffer"), 12 | \ "getTmpFile" : function("s:getTmpFile"), 13 | \ "flushTmpFile" : function("s:flushTmpFile"), 14 | \ "dumpFileContent" : function("s:dumpFileContent"), 15 | \ "isOpened": function("s:isOpened"), 16 | \ } 17 | let s:instanceCount += 1 18 | return obj 19 | endfunc 20 | 21 | func! s:getkey(filename) 22 | return bufnr(a:filename) 23 | endfunc 24 | 25 | func! s:getFileNames() dict 26 | return map(values(self.buffers), "v:val['filename']") 27 | endfunc 28 | 29 | func! s:getFileName(name) dict 30 | return self.buffers[s:getkey(a:name)].filename 31 | endfunc 32 | 33 | func! s:_isIgnoredFile(filename) 34 | for ignore_pat in g:tscompletejob_ignore_file_patterns 35 | if a:filename =~# ignore_pat 36 | return 1 37 | endif 38 | endfor 39 | return 0 40 | endfunc 41 | 42 | func! s:addBuffer(filename) dict 43 | let bn = s:getkey(a:filename) 44 | if (l:bn == -1) 45 | call tscompletejob#utils#log("invalid buffer: " . a:filename) 46 | return -1 47 | elseif (s:_isIgnoredFile(a:filename)) 48 | return -1 49 | elseif (!has_key(self.buffers, string(bn))) 50 | let filename = tscompletejob#utils#abspath(a:filename) 51 | let self.buffers[string(l:bn)] = { 52 | \ "filename" : filename, 53 | \ "tmpfile" : tempname(), 54 | \ "is_opened" : 0, 55 | \ } 56 | endif 57 | return bn 58 | endfunc 59 | 60 | func! s:getTmpFile(filename) dict 61 | let l:key = self.addBuffer(a:filename) 62 | return self.buffers[l:key].tmpfile 63 | endfunc 64 | 65 | func! s:isOpened(filename, ...) dict 66 | let l:key = self.addBuffer(a:filename) 67 | if a:0 == 0 68 | return self.buffers[l:key].is_opened 69 | elseif a:0 == 1 70 | let self.buffers[l:key].is_opened = a:1 71 | return a:1 72 | endif 73 | endfunc 74 | 75 | func! s:flushTmpFile(filename) dict 76 | let l:tmp = self.getTmpFile(a:filename) 77 | let content = self.dumpFileContent(a:filename) 78 | call writefile(content, l:tmp) 79 | return l:tmp 80 | endfunc 81 | 82 | func! s:dumpFileContent(filename) dict 83 | if (tscompletejob#utils#is_buf_exists(a:filename)) 84 | let content = getbufline(bufname(a:filename), 1, "$") 85 | else 86 | let content = readfile(a:filename) 87 | endif 88 | return content 89 | endfunc 90 | 91 | let &cpo = s:save_cpo 92 | unlet s:save_cpo 93 | -------------------------------------------------------------------------------- /autoload/tscompletejob/jobcompat.vim: -------------------------------------------------------------------------------- 1 | 2 | func! s:nvimOnStdout(job, data, event) dict 3 | if type(a:data) == type([]) 4 | for line in a:data 5 | if !empty(line) && line != "\r" 6 | call self.out_cb(self.this, a:job, line) 7 | endif 8 | endfor 9 | else 10 | call self.out_cb(self.this, a:job, a:data) 11 | endif 12 | endfunc 13 | 14 | func! s:nvimOnExit(job, data, event) dict 15 | call self.close_cb(self.this, a:job) 16 | endfunc 17 | 18 | func! s:nvimOnErr(job, data, event) dict 19 | call self.err_cb(self.this, a:job, a:data) 20 | endfunc 21 | 22 | func! tscompletejob#jobcompat#start(command, this, opts) abort 23 | if has('nvim') 24 | let nvim_opts = { 25 | \ "this": a:this, 26 | \ "on_stdout" : function("s:nvimOnStdout"), 27 | \ "on_exit" : function("s:nvimOnExit"), 28 | \ "out_cb" : a:opts.out_cb, 29 | \ "err_cb" : a:opts.err_cb, 30 | \ "close_cb" : a:opts.close_cb, 31 | \ } 32 | return jobstart(a:command, nvim_opts) 33 | else 34 | let vim_opts = { 35 | \ "out_cb": function(a:opts.out_cb, [a:this]), 36 | \ "err_cb": function(a:opts.err_cb, [a:this]), 37 | \ "close_cb" : function(a:opts.close_cb, [a:this]), 38 | \ } 39 | return job_start(a:command, vim_opts) 40 | endif 41 | endfunc 42 | 43 | func! tscompletejob#jobcompat#stop(job) abort 44 | if has('nvim') 45 | call jobstop(a:job) 46 | else 47 | call job_stop(a:job) 48 | endif 49 | endfunc 50 | 51 | func! tscompletejob#jobcompat#send_raw(ch, data) abort 52 | if has('nvim') 53 | return jobsend(a:ch, a:data) 54 | else 55 | return ch_sendraw(a:ch, a:data) 56 | endif 57 | endfunc 58 | 59 | func! tscompletejob#jobcompat#status(job) abort 60 | if has('nvim') 61 | let r = jobwait([a:job], 1)[0] 62 | if r == -1 63 | return "run" 64 | elseif r == -3 65 | return "dead" 66 | endif 67 | else 68 | return job_status(a:job) 69 | endif 70 | endfunc 71 | 72 | func! tscompletejob#jobcompat#get_channel(job) abort 73 | if has('nvim') 74 | return a:job 75 | else 76 | return job_getchannel(a:job) 77 | endif 78 | endfunc 79 | 80 | -------------------------------------------------------------------------------- /autoload/tscompletejob/tagmanager.vim: -------------------------------------------------------------------------------- 1 | let s:save_cpo = &cpo 2 | set cpo&vim 3 | 4 | func! tscompletejob#tagmanager#create() 5 | let obj = { 6 | \ "pushTag": function("s:pushTag"), 7 | \ "pushTagWithCurrentPos": function("s:pushTagWithCurrentPos"), 8 | \ "getCurrentIndex": function("s:getCurrentIndex"), 9 | \ "setCurrentIndex": function("s:setCurrentIndex"), 10 | \ "followTags": function("s:followTags"), 11 | \ "getMaxIndex": function("s:getMaxIndex"), 12 | \ "getTags": function("s:getTags"), 13 | \ "tags": [], 14 | \ "tagsHistory": [], 15 | \ "currentTagIndex": -1, 16 | \ } 17 | return obj 18 | endfunc 19 | 20 | func! s:push(arr, el) 21 | call insert(a:arr, a:el, len(a:arr)) 22 | endfunc 23 | 24 | func! s:createTag(filename, line, col) 25 | let tag = { 26 | \ "filename": a:filename, 27 | \ "line": a:line, 28 | \ "col": a:col 29 | \} 30 | return tag 31 | endfunc 32 | 33 | func! s:pushTag(filename, line, col) dict 34 | let tag = s:createTag(a:filename, a:line, a:col) 35 | let cur_idx = self.getCurrentIndex() 36 | if cur_idx == self.getMaxIndex() 37 | call s:push(self.tags, tag) 38 | let self.currentTagIndex = cur_idx + 1 39 | elseif cur_idx == 0 40 | let self.tags = [tag] 41 | let self.currentTagIndex = 0 42 | else 43 | let new = copy(self.tags[:cur_idx - 1]) 44 | call s:push(new, tag) 45 | let self.currentTagIndex = cur_idx + 1 46 | let self.tags = new 47 | endif 48 | endfunc 49 | 50 | func! s:pushTagWithCurrentPos() dict 51 | call self.pushTag(expand('%:p'), line("."), col(".")) 52 | endfunc 53 | 54 | func! s:getCurrentIndex() dict 55 | return self.currentTagIndex 56 | endfunc 57 | 58 | func! s:setCurrentIndex(idx) dict 59 | if a:idx < 0 || self.getMaxIndex() < a:idx 60 | throw "invalid tag index" 61 | endif 62 | 63 | let tag = self.tags[a:idx] 64 | 65 | let cur_file = expand("%:p") 66 | call tscompletejob#utils#log("cur_file: " . cur_file . ", tag.filename: " . tag.filename) 67 | if (!tscompletejob#utils#is_same_file(tag.filename, cur_file)) 68 | exec "e " . tag.filename 69 | endif 70 | call cursor(tag.line, tag.col) 71 | 72 | let self.currentTagIndex = a:idx 73 | endfunc 74 | 75 | func! s:followTags(rel_idx) dict 76 | let cur_idx = self.getCurrentIndex() 77 | let max_idx = self.getMaxIndex() 78 | 79 | if a:rel_idx == 0 80 | return 81 | elseif cur_idx == 0 && a:rel_idx < 0 82 | echo "Begining of the tag stack" 83 | elseif cur_idx == max_idx && a:rel_idx > 0 84 | echo "End of the tag stack" 85 | else 86 | let to_idx = cur_idx + a:rel_idx 87 | call self.setCurrentIndex(to_idx) 88 | endif 89 | endfunc 90 | 91 | func! s:getMaxIndex() dict 92 | return len(self.tags) - 1 93 | endfunc 94 | 95 | func! s:getTags() dict 96 | return self.tags 97 | endfunc 98 | 99 | let &cpo = s:save_cpo 100 | unlet s:save_cpo 101 | 102 | -------------------------------------------------------------------------------- /autoload/tscompletejob/tsclient.vim: -------------------------------------------------------------------------------- 1 | let s:save_cpo = &cpo 2 | set cpo&vim 3 | 4 | func! tscompletejob#tsclient#create(command) 5 | let obj = { 6 | \ "tssCommand": a:command, 7 | \ "curr_request_id": 0, 8 | \ "requests" : { }, 9 | \ "status" : function("s:status"), 10 | \ "ensureStart": function("s:ensureStart"), 11 | \ "ensureStop": function("s:ensureStop"), 12 | \ "sendCommand": function("s:sendCommand"), 13 | \ "waitResponse": function("s:waitResponse"), 14 | \ "getRequest": function("s:getRequest"), 15 | \ "requestHasCallback": function("s:requestHasCallback"), 16 | \ "destroyRequest": function("s:destroyRequest"), 17 | \ } 18 | return obj 19 | endfunc 20 | 21 | func! s:status() dict 22 | if (has_key(self, "job")) 23 | return tscompletejob#jobcompat#status(self.job) 24 | endif 25 | return "not started" 26 | endfunc 27 | 28 | func! s:ensureStart() dict 29 | if (self.status() == "run") 30 | return 31 | endif 32 | 33 | let self.job = tscompletejob#jobcompat#start(self.tssCommand, self, { 34 | \ 'out_cb' : function("s:onOut"), 35 | \ 'close_cb' : function("s:onClose"), 36 | \ 'err_cb' : function("s:onErr"), 37 | \ }) 38 | let self.ch = tscompletejob#jobcompat#get_channel(self.job) 39 | endfunc 40 | 41 | func! s:clearResponseCache() 42 | let s:current_content_length = 0 43 | let s:current_content = "" 44 | endfunc 45 | call s:clearResponseCache() 46 | 47 | func! s:onOut(self, job, msg) dict 48 | let this = a:self 49 | if a:msg =~ "^No content" 50 | call s:clearResponseCache() 51 | return 52 | elseif a:msg =~ "^Content-Length:" 53 | call s:clearResponseCache() 54 | let s:current_content_length = str2nr(a:msg[15:]) - 1 " 1 is termination cr 55 | return 56 | endif 57 | 58 | " in nvim, response data may be cut in the middle of json. 59 | " so we check content length and accumulate content if needed. 60 | let s:current_content = s:current_content . a:msg 61 | 62 | " in nvim windows(0.2), len() returns different result vim/nvim linux (may 63 | " be not included cr?) 64 | let len = len(s:current_content) 65 | "call tscompletejob#utils#log("content_length = " . s:current_content_length) 66 | "call tscompletejob#utils#log("len = " . len) 67 | if s:current_content_length > len 68 | return 69 | endif 70 | 71 | try 72 | let res = json_decode(s:current_content) 73 | if type(res) == type({}) 74 | \ && has_key(res, "request_seq") 75 | \ && has_key(this.requests, string(res.request_seq)) 76 | let id = string(res.request_seq) 77 | let req = this.getRequest(id) 78 | let success = has_key(res, "success") ? res.success : 1 79 | if (success) 80 | let response = has_key(res, "body") ? res.body : "" 81 | else 82 | let response = has_key(res, "message") ? res.message : "" 83 | endif 84 | 85 | if this.requestHasCallback(id) 86 | let Callback = req.callback 87 | let request_id = req.request_id 88 | call Callback(request_id, success, response) 89 | call this.destroyRequest(id) 90 | else 91 | let req.received = 1 92 | let req.success = success 93 | let req.response = response 94 | endif 95 | endif 96 | catch 97 | echoerr v:exception 98 | finally 99 | call s:clearResponseCache() 100 | endtry 101 | endfunc 102 | 103 | func! s:onClose(this, ch) 104 | call a:this.ensureStop() 105 | endfunc 106 | 107 | func! s:onErr(this, ch, data) 108 | echoerr string(a:data) 109 | endfunc 110 | 111 | func! s:ensureStop() dict 112 | if (has_key(self, "job")) 113 | call tscompletejob#jobcompat#stop(self.job) 114 | unlet self.job 115 | unlet self.ch 116 | endif 117 | endfunc 118 | 119 | func! s:sendCommand(command, responseHandler, arguments) dict 120 | call self.ensureStart() 121 | let id = self.curr_request_id 122 | let self.curr_request_id += 1 123 | let com = { "type" : "request", 124 | \ "command": a:command, 125 | \ "seq": id, 126 | \ "arguments": a:arguments, 127 | \ } 128 | 129 | if type(a:responseHandler) == type({}) " handled by user defined callback with req id 130 | let self.requests[string(id)] = { 131 | \ "callback": a:responseHandler.callback, 132 | \ "request_id": a:responseHandler.request_id 133 | \ } 134 | elseif type(a:responseHandler) == type(function("tr")) " handled by user callback 135 | let self.requests[string(id)] = { 136 | \ "callback" : a:responseHandler, 137 | \ "request_id" : -1 138 | \ } 139 | elseif a:responseHandler " handled by waitResponse() 140 | let self.requests[string(id)] = { "received" : 0 } 141 | endif 142 | 143 | call tscompletejob#jobcompat#send_raw(self.ch, json_encode(com)) 144 | call tscompletejob#jobcompat#send_raw(self.ch, "\r\n") 145 | return id 146 | endfunc 147 | 148 | func! s:waitResponse(req_id, ...) dict 149 | let request = self.getRequest(a:req_id) 150 | let do_complete_check = a:0 > 0 ? a:1 : 0 151 | while !request.received 152 | sleep 50m 153 | if complete_check() && do_complete_check 154 | call self.destroyRequest(a:req_id) 155 | throw "cancel:" 156 | endif 157 | endwhile 158 | if !request.success 159 | throw "error: " . request.response 160 | endif 161 | call self.destroyRequest(a:req_id) 162 | return request.response 163 | endfunc 164 | 165 | func! s:getRequest(req_id) dict 166 | if type(a:req_id) == type(1) 167 | let key = string(a:req_id) 168 | else 169 | let key = a:req_id 170 | endif 171 | 172 | if has_key(self.requests, key) 173 | return self.requests[key] 174 | else 175 | return v:false 176 | endif 177 | endfunc 178 | 179 | func! s:requestHasCallback(req_id) dict 180 | return has_key(self.getRequest(a:req_id), "callback") 181 | endfunc 182 | 183 | func! s:destroyRequest(req_id) dict 184 | if type(a:req_id) == type(1) 185 | unlet self.requests[string(a:req_id)] 186 | else 187 | unlet self.requests[a:req_id] 188 | endif 189 | endfunc 190 | 191 | let &cpo = s:save_cpo 192 | unlet s:save_cpo 193 | 194 | -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/.gitignore: -------------------------------------------------------------------------------- 1 | testdata/tsserver*.js 2 | -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/index.js: -------------------------------------------------------------------------------- 1 | let argv = process.argv.slice(2); 2 | let useLegacy = false; 3 | argv.forEach((arg, idx) => { 4 | if (arg === "--useLegacy") { 5 | useLegacy = true 6 | argv.splice(idx, 1); 7 | } 8 | }); 9 | 10 | if (useLegacy) { 11 | require("./legacy/tsswrapper").start(argv[0]); 12 | } else { 13 | require("./lib/tsswrapper").start() 14 | } 15 | -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/legacy/tsswrapper.js: -------------------------------------------------------------------------------- 1 | exports.start = function (argv) { 2 | 3 | if (argv.length > 0) { 4 | var tsslib = argv[0]; 5 | } 6 | else { 7 | var tsslib = __dirname + "/node_modules/typescript/lib/tsserverlibrary.js" 8 | } 9 | 10 | var ts = require(tsslib); 11 | 12 | if (ts.version.substring(0,3) === "2.0") { 13 | require("./tsswrapper200.js").start(tsslib) 14 | } 15 | else { 16 | require("./tsswrapper210.js").start(tsslib) 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/lib/custom_protocol.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY3VzdG9tX3Byb3RvY29sLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL2N1c3RvbV9wcm90b2NvbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIn0= -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/lib/utils.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | class PromisePool { 4 | constructor() { 5 | this.promises = {}; 6 | this.prepareDefault(); 7 | setInterval(() => { 8 | this.cleanup(); 9 | }, 60 * 1000); 10 | } 11 | prepare(seq) { 12 | this.promises[seq] = { createAt: Date.now() }; 13 | let promise = new Promise((res, rej) => { 14 | let obj = this.promises[seq]; 15 | obj.resolve = res; 16 | obj.reject = rej; 17 | }); 18 | this.promises[seq].promise = promise; 19 | return promise; 20 | } 21 | prepareDefault() { 22 | return this.prepare(Number.MAX_SAFE_INTEGER); 23 | } 24 | get defaultPromise() { 25 | return this.promises[Number.MAX_SAFE_INTEGER]; 26 | } 27 | resolve(seq, value) { 28 | let p = this.promises[seq]; 29 | if (p && p.resolve) { 30 | p.resolve(value); 31 | } 32 | else { 33 | console.warn(`no such seq '${seq}'. using default, value: `, value); 34 | this.defaultPromise.resolve && this.defaultPromise.resolve(value); 35 | } 36 | } 37 | reject(seq, err) { 38 | let p = this.promises[seq]; 39 | if (p && p.reject) { 40 | p.reject(err); 41 | } 42 | else { 43 | console.warn(`no such seq '${seq}'.`); 44 | this.defaultPromise.reject && this.defaultPromise.reject(err); 45 | } 46 | } 47 | cleanup() { 48 | let now = Date.now(); 49 | Object.keys(this.promises).forEach((key) => { 50 | let seq = parseInt(key); 51 | if (this.promises[seq].createdAt - 5 * 60 * 1000 > now) { 52 | delete this.promises[seq]; 53 | } 54 | }); 55 | } 56 | } 57 | exports.PromisePool = PromisePool; 58 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvdXRpbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFTQTtJQUlJO1FBRlEsYUFBUSxHQUFnQixFQUFFLENBQUM7UUFHL0IsSUFBSSxDQUFDLGNBQWMsRUFBRSxDQUFDO1FBQ3RCLFdBQVcsQ0FBQyxHQUFHLEVBQUU7WUFDYixJQUFJLENBQUMsT0FBTyxFQUFFLENBQUE7UUFDbEIsQ0FBQyxFQUFFLEVBQUUsR0FBRyxJQUFJLENBQUMsQ0FBQztJQUNsQixDQUFDO0lBRU0sT0FBTyxDQUFDLEdBQVc7UUFDdEIsSUFBSSxDQUFDLFFBQVEsQ0FBQyxHQUFHLENBQUMsR0FBRyxFQUFFLFFBQVEsRUFBRSxJQUFJLENBQUMsR0FBRyxFQUFFLEVBQVMsQ0FBQztRQUNyRCxJQUFJLE9BQU8sR0FBRyxJQUFJLE9BQU8sQ0FBSSxDQUFDLEdBQUcsRUFBRSxHQUFHLEVBQUUsRUFBRTtZQUN0QyxJQUFJLEdBQUcsR0FBRyxJQUFJLENBQUMsUUFBUSxDQUFDLEdBQUcsQ0FBQyxDQUFDO1lBQzdCLEdBQUcsQ0FBQyxPQUFPLEdBQUcsR0FBRyxDQUFDO1lBQ2xCLEdBQUcsQ0FBQyxNQUFNLEdBQUcsR0FBRyxDQUFBO1FBQ3BCLENBQUMsQ0FBQyxDQUFDO1FBQ0gsSUFBSSxDQUFDLFFBQVEsQ0FBQyxHQUFHLENBQUMsQ0FBQyxPQUFPLEdBQUcsT0FBTyxDQUFDO1FBQ3JDLE1BQU0sQ0FBQyxPQUFPLENBQUM7SUFDbkIsQ0FBQztJQUVNLGNBQWM7UUFDakIsTUFBTSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUMsTUFBTSxDQUFDLGdCQUFnQixDQUFDLENBQUM7SUFDakQsQ0FBQztJQUVELElBQVksY0FBYztRQUN0QixNQUFNLENBQUMsSUFBSSxDQUFDLFFBQVEsQ0FBQyxNQUFNLENBQUMsZ0JBQWdCLENBQUMsQ0FBQztJQUNsRCxDQUFDO0lBRU0sT0FBTyxDQUFDLEdBQVcsRUFBRSxLQUFRO1FBQ2hDLElBQUksQ0FBQyxHQUFHLElBQUksQ0FBQyxRQUFRLENBQUMsR0FBRyxDQUFDLENBQUM7UUFDM0IsRUFBRSxDQUFDLENBQUMsQ0FBQyxJQUFJLENBQUMsQ0FBQyxPQUFPLENBQUMsQ0FBQyxDQUFDO1lBQ2pCLENBQUMsQ0FBQyxPQUFPLENBQUMsS0FBSyxDQUFDLENBQUM7UUFDckIsQ0FBQztRQUFDLElBQUksQ0FBQyxDQUFDO1lBQ0osT0FBTyxDQUFDLElBQUksQ0FBQyxnQkFBZ0IsR0FBRywyQkFBMkIsRUFBRSxLQUFLLENBQUMsQ0FBQztZQUNwRSxJQUFJLENBQUMsY0FBYyxDQUFDLE9BQU8sSUFBSSxJQUFJLENBQUMsY0FBYyxDQUFDLE9BQU8sQ0FBQyxLQUFLLENBQUMsQ0FBQztRQUN0RSxDQUFDO0lBQ0wsQ0FBQztJQUVNLE1BQU0sQ0FBQyxHQUFXLEVBQUUsR0FBUTtRQUMvQixJQUFJLENBQUMsR0FBRyxJQUFJLENBQUMsUUFBUSxDQUFDLEdBQUcsQ0FBQyxDQUFDO1FBQzNCLEVBQUUsQ0FBQyxDQUFDLENBQUMsSUFBSSxDQUFDLENBQUMsTUFBTSxDQUFDLENBQUMsQ0FBQztZQUNoQixDQUFDLENBQUMsTUFBTSxDQUFDLEdBQUcsQ0FBQyxDQUFDO1FBQ2xCLENBQUM7UUFBQyxJQUFJLENBQUMsQ0FBQztZQUNKLE9BQU8sQ0FBQyxJQUFJLENBQUMsZ0JBQWdCLEdBQUcsSUFBSSxDQUFDLENBQUE7WUFDckMsSUFBSSxDQUFDLGNBQWMsQ0FBQyxNQUFNLElBQUksSUFBSSxDQUFDLGNBQWMsQ0FBQyxNQUFNLENBQUMsR0FBRyxDQUFDLENBQUM7UUFDbEUsQ0FBQztJQUNMLENBQUM7SUFFTyxPQUFPO1FBQ1gsSUFBSSxHQUFHLEdBQUcsSUFBSSxDQUFDLEdBQUcsRUFBRSxDQUFDO1FBQ3JCLE1BQU0sQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLFFBQVEsQ0FBQyxDQUFDLE9BQU8sQ0FBQyxDQUFDLEdBQVcsRUFBRSxFQUFFO1lBQy9DLElBQUksR0FBRyxHQUFHLFFBQVEsQ0FBQyxHQUFHLENBQUMsQ0FBQztZQUN4QixFQUFFLENBQUMsQ0FBQyxJQUFJLENBQUMsUUFBUSxDQUFDLEdBQUcsQ0FBQyxDQUFDLFNBQVMsR0FBRyxDQUFDLEdBQUcsRUFBRSxHQUFHLElBQUksR0FBRyxHQUFHLENBQUMsQ0FBQyxDQUFDO2dCQUNyRCxPQUFPLElBQUksQ0FBQyxRQUFRLENBQUMsR0FBRyxDQUFDLENBQUM7WUFDOUIsQ0FBQztRQUNMLENBQUMsQ0FBQyxDQUFBO0lBQ04sQ0FBQztDQUVKO0FBNURELGtDQTREQyJ9 -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/node_modules/.bin/tsc: -------------------------------------------------------------------------------- 1 | ../typescript/bin/tsc -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/node_modules/.bin/tsserver: -------------------------------------------------------------------------------- 1 | ../typescript/bin/tsserver -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/node_modules/typescript/AUTHORS.md: -------------------------------------------------------------------------------- 1 | TypeScript is authored by: 2 | * Aaron Holmes 3 | * Abubaker Bashir 4 | * Adam Freidin 5 | * Adi Dahiya 6 | * Adrian Leonhard 7 | * Ahmad Farid 8 | * Akshar Patel 9 | * Alan Agius 10 | * Alex Chugaev 11 | * Alex Eagle 12 | * Alex Khomchenko 13 | * Alexander Kuvaev 14 | * Alexander Rusakov 15 | * Ali Sabzevari 16 | * Aliaksandr Radzivanovich 17 | * Aluan Haddad 18 | * Anatoly Ressin 19 | * Anders Hejlsberg 20 | * Andreas Martin 21 | * Andrej Baran 22 | * Andrew Casey 23 | * Andrew Ochsner 24 | * Andrew Stegmaier 25 | * Andrew Z Allen 26 | * András Parditka 27 | * Andy Hanson 28 | * Anil Anar 29 | * Anton Khlynovskiy 30 | * Anton Tolmachev 31 | * Anubha Mathur 32 | * Armando Aguirre 33 | * Arnaud Tournier 34 | * Arnav Singh 35 | * Arthur Ozga 36 | * Asad Saeeduddin 37 | * Avery Morin 38 | * Basarat Ali Syed 39 | * Ben Duffield 40 | * Ben Mosher 41 | * Benjamin Bock 42 | * Benjamin Lichtman 43 | * Benny Neugebauer 44 | * Bill Ticehurst 45 | * Blaine Bublitz 46 | * Blake Embrey 47 | * @bootstraponline 48 | * Bowden Kelly 49 | * Brett Mayen 50 | * Bryan Forbes 51 | * Caitlin Potter 52 | * Cameron Taggart 53 | * @cedvdb 54 | * Charles Pierce 55 | * Charly POLY 56 | * Chris Bubernak 57 | * Christophe Vidal 58 | * Chuck Jazdzewski 59 | * Colby Russell 60 | * Colin Snover 61 | * Cotton Hou 62 | * csigs 63 | * Cyrus Najmabadi 64 | * Dafrok Zhang 65 | * Dahan Gong 66 | * Dan Corder 67 | * Dan Quirk 68 | * Daniel Hollocher 69 | * Daniel Król 70 | * Daniel Lehenbauer 71 | * Daniel Rosenwasser 72 | * David Kmenta 73 | * David Li 74 | * David Sheldrick 75 | * David Souther 76 | * Denis Nedelyaev 77 | * Dick van den Brink 78 | * Diogo Franco (Kovensky) 79 | * Dirk Bäumer 80 | * Dirk Holtwick 81 | * Dom Chen 82 | * Donald Pipowitch 83 | * Doug Ilijev 84 | * @e-cloud 85 | * Elisée Maurer 86 | * Emilio García-Pumarino 87 | * Eric Tsang 88 | * Erik Edrosa 89 | * Erik McClenney 90 | * Ethan Resnick 91 | * Ethan Rubio 92 | * Eugene Timokhov 93 | * Evan Martin 94 | * Evan Sebastian 95 | * Eyas Sharaiha 96 | * Fabian Cook 97 | * @falsandtru 98 | * Filipe Silva 99 | * @flowmemo 100 | * Francois Wouts 101 | * Frank Wallis 102 | * Franklin Tse 103 | * František Žiacik 104 | * Gabe Moothart 105 | * Gabriel Isenberg 106 | * Gilad Peleg 107 | * Godfrey Chan 108 | * Graeme Wicksted 109 | * Guilherme Oenning 110 | * Guillaume Salles 111 | * Guy Bedford 112 | * Halasi Tamás 113 | * Harald Niesche 114 | * Hendrik Liebau 115 | * Henry Mercer 116 | * Herrington Darkholme 117 | * Homa Wong 118 | * Iain Monro 119 | * @IdeaHunter 120 | * Igor Novozhilov 121 | * Ika 122 | * Ingvar Stepanyan 123 | * Isiah Meadows 124 | * Ivan Enderlin 125 | * Ivo Gabe de Wolff 126 | * Iwata Hidetaka 127 | * Jakub Korzeniowski 128 | * Jakub Młokosiewicz 129 | * James Henry 130 | * James Whitney 131 | * Jan Melcher 132 | * Jason Freeman 133 | * Jason Jarrett 134 | * Jason Killian 135 | * Jason Ramsay 136 | * JBerger 137 | * Jed Mao 138 | * Jeffrey Morlan 139 | * Jesse Schalken 140 | * Jing Ma 141 | * Jiri Tobisek 142 | * Joe Calzaretta 143 | * Joe Chung 144 | * Joel Day 145 | * Joey Wilson 146 | * Johannes Rieken 147 | * John Vilk 148 | * Jonathan Bond-Caron 149 | * Jonathan Park 150 | * Jonathan Toland 151 | * Jonathan Turner 152 | * Jonathon Smith 153 | * Josh Abernathy 154 | * Josh Goldberg 155 | * Josh Kalderimis 156 | * Josh Soref 157 | * Juan Luis Boya García 158 | * Julian Williams 159 | * Justin Bay 160 | * Justin Johansson 161 | * K. Preißer 162 | * Kagami Sascha Rosylight 163 | * Kanchalai Tanglertsampan 164 | * Kate Miháliková 165 | * Keith Mashinter 166 | * Ken Howard 167 | * Kenji Imamula 168 | * Kevin Lang 169 | * Kitson Kelly 170 | * Klaus Meinhardt 171 | * Kris Zyp 172 | * Kyle Kelley 173 | * Kārlis Gaņģis 174 | * Lorant Pinter 175 | * Lucien Greathouse 176 | * Lukas Elmer 177 | * Magnus Hiie 178 | * Magnus Kulke 179 | * Manish Giri 180 | * Marin Marinov 181 | * Marius Schulz 182 | * Martin Hiller 183 | * Martin Vseticka 184 | * Masahiro Wakame 185 | * Matt 186 | * Matt Bierner 187 | * Matt McCutchen 188 | * Matt Mitchell 189 | * Mattias Buelens 190 | * Mattias Buelens 191 | * Max Deepfield 192 | * Maxwell Paul Brickner 193 | * @meyer 194 | * Micah Zoltu 195 | * @micbou 196 | * Michael 197 | * Michael Bromley 198 | * Mike Busyrev 199 | * Mike Morearty 200 | * Mine Starks 201 | * Mohamed Hegazy 202 | * Mohsen Azimi 203 | * Myles Megyesi 204 | * Natalie Coley 205 | * Nathan Shively-Sanders 206 | * Nathan Yee 207 | * Nicolas Henry 208 | * @nieltg 209 | * Nima Zahedi 210 | * Noah Chen 211 | * Noel Varanda 212 | * Noj Vek 213 | * Oleg Mihailik 214 | * Oleksandr Chekhovskyi 215 | * Omer Sheikh 216 | * Orta Therox 217 | * Oskar Segersva¨rd 218 | * Oussama Ben Brahim 219 | * Patrick Zhong 220 | * Paul Jolly 221 | * Paul van Brenk 222 | * @pcbro 223 | * Pedro Maltez 224 | * Perry Jiang 225 | * Peter Burns 226 | * Philip Bulley 227 | * Piero Cangianiello 228 | * @piloopin 229 | * Prayag Verma 230 | * Priyantha Lankapura 231 | * @progre 232 | * Punya Biswal 233 | * Rado Kirov 234 | * Raj Dosanjh 235 | * Reiner Dolp 236 | * Remo H. Jansen 237 | * Richard Karmazín 238 | * Richard Knoll 239 | * Richard Sentino 240 | * Robert Coie 241 | * Rohit Verma 242 | * Ron Buckton 243 | * Rostislav Galimsky 244 | * Rowan Wyborn 245 | * Ryan Cavanaugh 246 | * Ryohei Ikegami 247 | * Sam El-Husseini 248 | * Sarangan Rajamanickam 249 | * Sean Barag 250 | * Sergey Rubanov 251 | * Sergey Shandar 252 | * Sharon Rolel 253 | * Sheetal Nandi 254 | * Shengping Zhong 255 | * Shyyko Serhiy 256 | * Simon Hürlimann 257 | * Slawomir Sadziak 258 | * Solal Pirelli 259 | * Soo Jae Hwang 260 | * Stan Thomas 261 | * Stanislav Iliev 262 | * Stanislav Sysoev 263 | * Stas Vilchik 264 | * Steve Lucco 265 | * Sudheesh Singanamalla 266 | * Sébastien Arod 267 | * @T18970237136 268 | * @t_ 269 | * Taras Mankovski 270 | * Tarik Ozket 271 | * Tetsuharu Ohzeki 272 | * Thomas den Hollander 273 | * Thomas Loubiou 274 | * Tien Hoanhtien 275 | * Tim Lancina 276 | * Tim Perry 277 | * Tim Viiding-Spader 278 | * Tingan Ho 279 | * Todd Thomson 280 | * togru 281 | * Tomas Grubliauskas 282 | * Torben Fitschen 283 | * @TravCav 284 | * TruongSinh Tran-Nguyen 285 | * Tycho Grouwstra 286 | * Vadi Taslim 287 | * Vakhurin Sergey 288 | * Vidar Tonaas Fauske 289 | * Viktor Zozulyak 290 | * Vilic Vane 291 | * Vladimir Kurchatkin 292 | * Vladimir Matveev 293 | * Wenlu Wang 294 | * Wesley Wigham 295 | * William Orr 296 | * Wilson Hobbs 297 | * York Yao 298 | * @yortus 299 | * Yuichi Nukiyama 300 | * Yuval Greenfield 301 | * Zeeshan Ahmed 302 | * Zev Spitz 303 | * Zhengbo Li -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/node_modules/typescript/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Instructions for Logging Issues 2 | 3 | ## 1. Read the FAQ 4 | 5 | Please [read the FAQ](https://github.com/Microsoft/TypeScript/wiki/FAQ) before logging new issues, even if you think you have found a bug. 6 | 7 | Issues that ask questions answered in the FAQ will be closed without elaboration. 8 | 9 | ## 2. Search for Duplicates 10 | 11 | [Search the existing issues](https://github.com/Microsoft/TypeScript/search?type=Issues) before logging a new one. 12 | 13 | Some search tips: 14 | * *Don't* restrict your search to only open issues. An issue with a title similar to yours may have been closed as a duplicate of one with a less-findable title. 15 | * Check for synonyms. For example, if your bug involves an interface, it likely also occurs with type aliases or classes. 16 | * Search for the title of the issue you're about to log. This sounds obvious but 80% of the time this is sufficient to find a duplicate when one exists. 17 | * Read more than the first page of results. Many bugs here use the same words so relevancy sorting is not particularly strong. 18 | * If you have a crash, search for the first few topmost function names shown in the call stack. 19 | 20 | ## 3. Do you have a question? 21 | 22 | The issue tracker is for **issues**, in other words, bugs and suggestions. 23 | If you have a *question*, please use [Stack Overflow](http://stackoverflow.com/questions/tagged/typescript), [Gitter](https://gitter.im/Microsoft/TypeScript), your favorite search engine, or other resources. 24 | Due to increased traffic, we can no longer answer questions in the issue tracker. 25 | 26 | ## 4. Did you find a bug? 27 | 28 | When logging a bug, please be sure to include the following: 29 | * What version of TypeScript you're using (run `tsc --v`) 30 | * If at all possible, an *isolated* way to reproduce the behavior 31 | * The behavior you expect to see, and the actual behavior 32 | 33 | You can try out the nightly build of TypeScript (`npm install typescript@next`) to see if the bug has already been fixed. 34 | 35 | ## 5. Do you have a suggestion? 36 | 37 | We also accept suggestions in the issue tracker. 38 | Be sure to [check the FAQ](https://github.com/Microsoft/TypeScript/wiki/FAQ) and [search](https://github.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93&q=is%3Aissue) first. 39 | 40 | In general, things we find useful when reviewing suggestions are: 41 | * A description of the problem you're trying to solve 42 | * An overview of the suggested solution 43 | * Examples of how the suggestion would work in various places 44 | * Code examples showing e.g. "this would be an error, this wouldn't" 45 | * Code examples showing the generated JavaScript (if applicable) 46 | * If relevant, precedent in other languages can be useful for establishing context and expected behavior 47 | 48 | # Instructions for Contributing Code 49 | 50 | ## Contributing bug fixes 51 | 52 | TypeScript is currently accepting contributions in the form of bug fixes. A bug must have an issue tracking it in the issue tracker that has been approved ("Milestone == Community") by the TypeScript team. Your pull request should include a link to the bug that you are fixing. If you've submitted a PR for a bug, please post a comment in the bug to avoid duplication of effort. 53 | 54 | ## Contributing features 55 | 56 | Features (things that add new or improved functionality to TypeScript) may be accepted, but will need to first be approved (marked as "Milestone == Community" by a TypeScript coordinator with the message "Approved") in the suggestion issue. Features with language design impact, or that are adequately satisfied with external tools, will not be accepted. 57 | 58 | Design changes will not be accepted at this time. If you have a design change proposal, please log a suggestion issue. 59 | 60 | ## Legal 61 | 62 | You will need to complete a Contributor License Agreement (CLA). Briefly, this agreement testifies that you are granting us permission to use the submitted change according to the terms of the project's license, and that the work being submitted is under appropriate copyright. 63 | 64 | Please submit a Contributor License Agreement (CLA) before submitting a pull request. You may visit https://cla.microsoft.com to sign digitally. Alternatively, download the agreement ([Microsoft Contribution License Agreement.docx](https://www.codeplex.com/Download?ProjectName=typescript&DownloadId=822190) or [Microsoft Contribution License Agreement.pdf](https://www.codeplex.com/Download?ProjectName=typescript&DownloadId=921298)), sign, scan, and email it back to . Be sure to include your github user name along with the agreement. Once we have received the signed CLA, we'll review the request. 65 | 66 | ## Housekeeping 67 | 68 | Your pull request should: 69 | 70 | * Include a description of what your change intends to do 71 | * Be a child commit of a reasonably recent commit in the **master** branch 72 | * Requests need not be a single commit, but should be a linear sequence of commits (i.e. no merge commits in your PR) 73 | * It is desirable, but not necessary, for the tests to pass at each commit 74 | * Have clear commit messages 75 | * e.g. "Refactor feature", "Fix issue", "Add tests for issue" 76 | * Include adequate tests 77 | * At least one test should fail in the absence of your non-test code changes. If your PR does not match this criteria, please specify why 78 | * Tests should include reasonable permutations of the target fix/change 79 | * Include baseline changes with your change 80 | * All changed code must have 100% code coverage 81 | * Follow the code conventions described in [Coding guidelines](https://github.com/Microsoft/TypeScript/wiki/Coding-guidelines) 82 | * To avoid line ending issues, set `autocrlf = input` and `whitespace = cr-at-eol` in your git configuration 83 | 84 | ## Contributing `lib.d.ts` fixes 85 | 86 | The library sources are in: [src/lib](https://github.com/Microsoft/TypeScript/tree/master/src/lib) 87 | 88 | Library files in `built/local/` are updated by running 89 | ```Shell 90 | jake 91 | ``` 92 | 93 | The files in `lib/` are used to bootstrap compilation and usually do not need to be updated. 94 | 95 | #### `src/lib/dom.generated.d.ts` and `src/lib/webworker.generated.d.ts` 96 | 97 | These two files represent the DOM typings and are auto-generated. To make any modifications to them, please submit a PR to https://github.com/Microsoft/TSJS-lib-generator 98 | 99 | ## Running the Tests 100 | 101 | To run all tests, invoke the `runtests-parallel` target using jake: 102 | 103 | ```Shell 104 | jake runtests-parallel 105 | ``` 106 | 107 | This run will all tests; to run only a specific subset of tests, use: 108 | 109 | ```Shell 110 | jake runtests tests= 111 | ``` 112 | 113 | e.g. to run all compiler baseline tests: 114 | 115 | ```Shell 116 | jake runtests tests=compiler 117 | ``` 118 | 119 | or to run a specific test: `tests\cases\compiler\2dArrays.ts` 120 | 121 | ```Shell 122 | jake runtests tests=2dArrays 123 | ``` 124 | 125 | ## Debugging the tests 126 | 127 | To debug the tests, invoke the `runtests-browser` task from jake. 128 | You will probably only want to debug one test at a time: 129 | 130 | ```Shell 131 | jake runtests-browser tests=2dArrays 132 | ``` 133 | 134 | You can specify which browser to use for debugging. Currently Chrome and IE are supported: 135 | 136 | ```Shell 137 | jake runtests-browser tests=2dArrays browser=chrome 138 | ``` 139 | 140 | You can debug with VS Code or Node instead with `jake runtests debug=true`: 141 | 142 | ```Shell 143 | jake runtests tests=2dArrays debug=true 144 | ``` 145 | 146 | ## Adding a Test 147 | 148 | To add a new test case, simply place a `.ts` file in `tests\cases\compiler` containing code that exemplifies the bugfix or change you are making. 149 | 150 | These files support metadata tags in the format `// @metaDataName: value`. 151 | The supported names and values are the same as those supported in the compiler itself, with the addition of the `fileName` flag. 152 | `fileName` tags delimit sections of a file to be used as separate compilation units. 153 | They are useful for tests relating to modules. 154 | See below for examples. 155 | 156 | **Note** that if you have a test corresponding to a specific spec compliance item, you can place it in `tests\cases\conformance` in an appropriately-named subfolder. 157 | **Note** that filenames here must be distinct from all other compiler testcase names, so you may have to work a bit to find a unique name if it's something common. 158 | 159 | ### Tests for multiple files 160 | 161 | When one needs to test for scenarios which require multiple files, it is useful to use the `fileName` metadata tag as such: 162 | 163 | ```TypeScript 164 | // @fileName: file1.ts 165 | export function f() { 166 | } 167 | 168 | // @fileName: file2.ts 169 | import { f as g } from "file1"; 170 | 171 | var x = g(); 172 | ``` 173 | 174 | One can also write a project test, but it is slightly more involved. 175 | 176 | ## Managing the Baselines 177 | 178 | Compiler testcases generate baselines that track the emitted `.js`, the errors produced by the compiler, and the type of each expression in the file. Additionally, some testcases opt in to baselining the source map output. 179 | 180 | When a change in the baselines is detected, the test will fail. To inspect changes vs the expected baselines, use 181 | 182 | ```Shell 183 | jake diff 184 | ``` 185 | 186 | After verifying that the changes in the baselines are correct, run 187 | 188 | ```Shell 189 | jake baseline-accept 190 | ``` 191 | 192 | to establish the new baselines as the desired behavior. This will change the files in `tests\baselines\reference`, which should be included as part of your commit. It's important to carefully validate changes in the baselines. 193 | 194 | ## Localization 195 | 196 | All strings the user may see are stored in [`diagnosticMessages.json`](./src/compiler/diagnosticMessages.json). 197 | If you make changes to it, run `jake generate-diagnostics` to push them to the `Diagnostic` interface in [`diagnosticInformationMap.generated.ts`](./src/compiler/diagnosticInformationMap.generated.ts). 198 | 199 | See [coding guidelines on diagnostic messages](https://github.com/Microsoft/TypeScript/wiki/Coding-guidelines#diagnostic-messages). 200 | -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/node_modules/typescript/CopyrightNotice.txt: -------------------------------------------------------------------------------- 1 | /*! ***************************************************************************** 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | this file except in compliance with the License. You may obtain a copy of the 5 | License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | See the Apache Version 2.0 License for specific language governing permissions 13 | and limitations under the License. 14 | ***************************************************************************** */ 15 | 16 | -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/node_modules/typescript/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Apache License 2 | 3 | Version 2.0, January 2004 4 | 5 | http://www.apache.org/licenses/ 6 | 7 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 8 | 9 | 1. Definitions. 10 | 11 | "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. 16 | 17 | "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. 18 | 19 | "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. 20 | 21 | "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. 22 | 23 | "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). 24 | 25 | "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. 26 | 27 | "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." 28 | 29 | "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 30 | 31 | 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 32 | 33 | 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 34 | 35 | 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: 36 | 37 | You must give any other recipients of the Work or Derivative Works a copy of this License; and 38 | 39 | You must cause any modified files to carry prominent notices stating that You changed the files; and 40 | 41 | You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and 42 | 43 | If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 44 | 45 | 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 46 | 47 | 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 48 | 49 | 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 50 | 51 | 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 52 | 53 | 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. 54 | 55 | END OF TERMS AND CONDITIONS 56 | -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/node_modules/typescript/README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://travis-ci.org/Microsoft/TypeScript.svg?branch=master)](https://travis-ci.org/Microsoft/TypeScript) 2 | [![npm version](https://badge.fury.io/js/typescript.svg)](https://www.npmjs.com/package/typescript) 3 | [![Downloads](https://img.shields.io/npm/dm/typescript.svg)](https://www.npmjs.com/package/typescript) 4 | 5 | # TypeScript 6 | 7 | [![Join the chat at https://gitter.im/Microsoft/TypeScript](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Microsoft/TypeScript?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 8 | 9 | [TypeScript](https://www.typescriptlang.org/) is a language for application-scale JavaScript. TypeScript adds optional types, classes, and modules to JavaScript. TypeScript supports tools for large-scale JavaScript applications for any browser, for any host, on any OS. TypeScript compiles to readable, standards-based JavaScript. Try it out at the [playground](https://www.typescriptlang.org/play/), and stay up to date via [our blog](https://blogs.msdn.microsoft.com/typescript) and [Twitter account](https://twitter.com/typescriptlang). 10 | 11 | ## Installing 12 | 13 | For the latest stable version: 14 | 15 | ```bash 16 | npm install -g typescript 17 | ``` 18 | 19 | For our nightly builds: 20 | 21 | ```bash 22 | npm install -g typescript@next 23 | ``` 24 | 25 | ## Contribute 26 | 27 | There are many ways to [contribute](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md) to TypeScript. 28 | * [Submit bugs](https://github.com/Microsoft/TypeScript/issues) and help us verify fixes as they are checked in. 29 | * Review the [source code changes](https://github.com/Microsoft/TypeScript/pulls). 30 | * Engage with other TypeScript users and developers on [StackOverflow](https://stackoverflow.com/questions/tagged/typescript). 31 | * Join the [#typescript](https://twitter.com/#!/search/realtime/%23typescript) discussion on Twitter. 32 | * [Contribute bug fixes](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md). 33 | * Read the language specification ([docx](https://github.com/Microsoft/TypeScript/blob/master/doc/TypeScript%20Language%20Specification.docx?raw=true), 34 | [pdf](https://github.com/Microsoft/TypeScript/blob/master/doc/TypeScript%20Language%20Specification.pdf?raw=true), [md](https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md)). 35 | 36 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see 37 | the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) 38 | with any additional questions or comments. 39 | 40 | ## Documentation 41 | 42 | * [Quick tutorial](https://www.typescriptlang.org/docs/tutorial.html) 43 | * [Programming handbook](https://www.typescriptlang.org/docs/handbook/basic-types.html) 44 | * [Language specification](https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md) 45 | * [Homepage](https://www.typescriptlang.org/) 46 | 47 | ## Building 48 | 49 | In order to build the TypeScript compiler, ensure that you have [Git](https://git-scm.com/downloads) and [Node.js](https://nodejs.org/) installed. 50 | 51 | Clone a copy of the repo: 52 | 53 | ```bash 54 | git clone https://github.com/Microsoft/TypeScript.git 55 | ``` 56 | 57 | Change to the TypeScript directory: 58 | 59 | ```bash 60 | cd TypeScript 61 | ``` 62 | 63 | Install Gulp tools and dev dependencies: 64 | 65 | ```bash 66 | npm install -g gulp 67 | npm install 68 | ``` 69 | 70 | Use one of the following to build and test: 71 | 72 | ``` 73 | gulp local # Build the compiler into built/local 74 | gulp clean # Delete the built compiler 75 | gulp LKG # Replace the last known good with the built one. 76 | # Bootstrapping step to be executed when the built compiler reaches a stable state. 77 | gulp tests # Build the test infrastructure using the built compiler. 78 | gulp runtests # Run tests using the built compiler and test infrastructure. 79 | # You can override the host or specify a test for this command. 80 | # Use host= or tests=. 81 | gulp runtests-browser # Runs the tests using the built run.js file. Syntax is gulp runtests. Optional 82 | parameters 'host=', 'tests=[regex], reporter=[list|spec|json|]'. 83 | gulp baseline-accept # This replaces the baseline test results with the results obtained from gulp runtests. 84 | gulp lint # Runs tslint on the TypeScript source. 85 | gulp help # List the above commands. 86 | ``` 87 | 88 | 89 | ## Usage 90 | 91 | ```bash 92 | node built/local/tsc.js hello.ts 93 | ``` 94 | 95 | 96 | ## Roadmap 97 | 98 | For details on our planned features and future direction please refer to our [roadmap](https://github.com/Microsoft/TypeScript/wiki/Roadmap). 99 | -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/node_modules/typescript/ThirdPartyNoticeText.txt: -------------------------------------------------------------------------------- 1 | /*!----------------- TypeScript ThirdPartyNotices ------------------------------------------------------- 2 | 3 | The TypeScript software is based on or incorporates material and code from the projects listed below 4 | (collectively "Third Party Code"). Microsoft is not the original author of the 5 | Third Party Code. The original copyright notice and the license, under which 6 | Microsoft received such Third Party Code, are set forth below. Such license and 7 | notices are provided for informational purposes only. Microsoft licenses the Third 8 | Party Code to you under the terms of the Apache 2.0 License. 9 | All Third Party Code licensed by Microsoft under the Apache License, Version 2.0 (the "License"); you 10 | may not use this file except in compliance with the License. You may obtain a copy 11 | of the License at http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 14 | EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR 15 | CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. 16 | 17 | See the Apache Version 2.0 License for specific language governing permissions and 18 | limitations under the License. 19 | --------------------------------------------- 20 | Third Party Code Components 21 | -------------------------------------------- 22 | 23 | ------------------- DefinitelyTyped -------------------- 24 | This file is based on or incorporates material from the projects listed below (collectively "Third Party Code"). Microsoft is not the original author of the Third Party Code. The original copyright notice and the license, under which Microsoft received such Third Party Code, are set forth below. Such licenses and notices are provided for informational purposes only. Microsoft, not the third party, licenses the Third Party Code to you under the terms set forth in the EULA for the Microsoft Product. Microsoft reserves all other rights not expressly granted under this agreement, whether by implication, estoppel or otherwise. 25 | DefinitelyTyped 26 | This project is licensed under the MIT license. 27 | Copyrights are respective of each contributor listed at the beginning of each definition file. 28 | Provided for Informational Purposes Only 29 | 30 | MIT License 31 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 32 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 33 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 34 | -------------------------------------------------------------------------------------- 35 | ------------- End of ThirdPartyNotices --------------------------------------------------- */ 36 | -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/node_modules/typescript/bin/tsc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | require('../lib/tsc.js') 3 | -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/node_modules/typescript/bin/tsserver: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | require('../lib/tsserver.js') 3 | -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/node_modules/typescript/lib/README.md: -------------------------------------------------------------------------------- 1 | # Read This! 2 | 3 | **These files are not meant to be edited by hand.** 4 | If you need to make modifications, the respective files should be changed within the repository's top-level `src` directory. 5 | Running `jake LKG` will then appropriately update the files in this directory. 6 | -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/node_modules/typescript/lib/cancellationToken.js: -------------------------------------------------------------------------------- 1 | /*! ***************************************************************************** 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | this file except in compliance with the License. You may obtain a copy of the 5 | License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | See the Apache Version 2.0 License for specific language governing permissions 13 | and limitations under the License. 14 | ***************************************************************************** */ 15 | 16 | "use strict"; 17 | var fs = require("fs"); 18 | function pipeExists(name) { 19 | try { 20 | fs.statSync(name); 21 | return true; 22 | } 23 | catch (e) { 24 | return false; 25 | } 26 | } 27 | function createCancellationToken(args) { 28 | var cancellationPipeName; 29 | for (var i = 0; i < args.length - 1; i++) { 30 | if (args[i] === "--cancellationPipeName") { 31 | cancellationPipeName = args[i + 1]; 32 | break; 33 | } 34 | } 35 | if (!cancellationPipeName) { 36 | return { 37 | isCancellationRequested: function () { return false; }, 38 | setRequest: function (_requestId) { return void 0; }, 39 | resetRequest: function (_requestId) { return void 0; } 40 | }; 41 | } 42 | if (cancellationPipeName.charAt(cancellationPipeName.length - 1) === "*") { 43 | var namePrefix_1 = cancellationPipeName.slice(0, -1); 44 | if (namePrefix_1.length === 0 || namePrefix_1.indexOf("*") >= 0) { 45 | throw new Error("Invalid name for template cancellation pipe: it should have length greater than 2 characters and contain only one '*'."); 46 | } 47 | var perRequestPipeName_1; 48 | var currentRequestId_1; 49 | return { 50 | isCancellationRequested: function () { return perRequestPipeName_1 !== undefined && pipeExists(perRequestPipeName_1); }, 51 | setRequest: function (requestId) { 52 | currentRequestId_1 = requestId; 53 | perRequestPipeName_1 = namePrefix_1 + requestId; 54 | }, 55 | resetRequest: function (requestId) { 56 | if (currentRequestId_1 !== requestId) { 57 | throw new Error("Mismatched request id, expected " + currentRequestId_1 + ", actual " + requestId); 58 | } 59 | perRequestPipeName_1 = undefined; 60 | } 61 | }; 62 | } 63 | else { 64 | return { 65 | isCancellationRequested: function () { return pipeExists(cancellationPipeName); }, 66 | setRequest: function (_requestId) { return void 0; }, 67 | resetRequest: function (_requestId) { return void 0; } 68 | }; 69 | } 70 | } 71 | module.exports = createCancellationToken; 72 | -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/node_modules/typescript/lib/lib.dom.iterable.d.ts: -------------------------------------------------------------------------------- 1 | /*! ***************************************************************************** 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | this file except in compliance with the License. You may obtain a copy of the 5 | License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | See the Apache Version 2.0 License for specific language governing permissions 13 | and limitations under the License. 14 | ***************************************************************************** */ 15 | 16 | 17 | 18 | /// 19 | 20 | 21 | /// 22 | 23 | interface DOMTokenList { 24 | [Symbol.iterator](): IterableIterator; 25 | } 26 | 27 | interface Headers { 28 | [Symbol.iterator](): IterableIterator<[string, string]>; 29 | /** 30 | * Returns an iterator allowing to go through all key/value pairs contained in this object. 31 | */ 32 | entries(): IterableIterator<[string, string]>; 33 | /** 34 | * Returns an iterator allowing to go through all keys f the key/value pairs contained in this object. 35 | */ 36 | keys(): IterableIterator; 37 | /** 38 | * Returns an iterator allowing to go through all values of the key/value pairs contained in this object. 39 | */ 40 | values(): IterableIterator; 41 | } 42 | 43 | interface NodeList { 44 | /** 45 | * Returns an array of key, value pairs for every entry in the list 46 | */ 47 | entries(): IterableIterator<[number, Node]>; 48 | /** 49 | * Performs the specified action for each node in an list. 50 | * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the list. 51 | * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. 52 | */ 53 | forEach(callbackfn: (value: Node, index: number, listObj: NodeList) => void, thisArg?: any): void; 54 | /** 55 | * Returns an list of keys in the list 56 | */ 57 | keys(): IterableIterator; 58 | 59 | /** 60 | * Returns an list of values in the list 61 | */ 62 | values(): IterableIterator; 63 | 64 | 65 | [Symbol.iterator](): IterableIterator; 66 | } 67 | 68 | interface NodeListOf { 69 | 70 | /** 71 | * Returns an array of key, value pairs for every entry in the list 72 | */ 73 | entries(): IterableIterator<[number, TNode]>; 74 | 75 | /** 76 | * Performs the specified action for each node in an list. 77 | * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the list. 78 | * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. 79 | */ 80 | forEach(callbackfn: (value: TNode, index: number, listObj: NodeListOf) => void, thisArg?: any): void; 81 | /** 82 | * Returns an list of keys in the list 83 | */ 84 | keys(): IterableIterator; 85 | /** 86 | * Returns an list of values in the list 87 | */ 88 | values(): IterableIterator; 89 | 90 | [Symbol.iterator](): IterableIterator; 91 | } 92 | 93 | interface HTMLCollectionBase { 94 | [Symbol.iterator](): IterableIterator; 95 | } 96 | 97 | interface HTMLCollectionOf { 98 | [Symbol.iterator](): IterableIterator; 99 | } 100 | 101 | interface FormData { 102 | /** 103 | * Returns an array of key, value pairs for every entry in the list 104 | */ 105 | entries(): IterableIterator<[string, string | File]>; 106 | /** 107 | * Returns a list of keys in the list 108 | */ 109 | keys(): IterableIterator; 110 | /** 111 | * Returns a list of values in the list 112 | */ 113 | values(): IterableIterator; 114 | 115 | [Symbol.iterator](): IterableIterator; 116 | } 117 | 118 | interface URLSearchParams { 119 | /** 120 | * Returns an array of key, value pairs for every entry in the search params 121 | */ 122 | entries(): IterableIterator<[string, string]>; 123 | /** 124 | * Returns a list of keys in the search params 125 | */ 126 | keys(): IterableIterator; 127 | /** 128 | * Returns a list of values in the search params 129 | */ 130 | values(): IterableIterator; 131 | /** 132 | * iterate over key/value pairs 133 | */ 134 | [Symbol.iterator](): IterableIterator<[string, string]>; 135 | } 136 | -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/node_modules/typescript/lib/lib.es2015.collection.d.ts: -------------------------------------------------------------------------------- 1 | /*! ***************************************************************************** 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | this file except in compliance with the License. You may obtain a copy of the 5 | License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | See the Apache Version 2.0 License for specific language governing permissions 13 | and limitations under the License. 14 | ***************************************************************************** */ 15 | 16 | 17 | 18 | /// 19 | 20 | 21 | interface Map { 22 | clear(): void; 23 | delete(key: K): boolean; 24 | forEach(callbackfn: (value: V, key: K, map: Map) => void, thisArg?: any): void; 25 | get(key: K): V | undefined; 26 | has(key: K): boolean; 27 | set(key: K, value: V): this; 28 | readonly size: number; 29 | } 30 | 31 | interface MapConstructor { 32 | new (): Map; 33 | new (entries?: ReadonlyArray<[K, V]>): Map; 34 | readonly prototype: Map; 35 | } 36 | declare var Map: MapConstructor; 37 | 38 | interface ReadonlyMap { 39 | forEach(callbackfn: (value: V, key: K, map: ReadonlyMap) => void, thisArg?: any): void; 40 | get(key: K): V | undefined; 41 | has(key: K): boolean; 42 | readonly size: number; 43 | } 44 | 45 | interface WeakMap { 46 | delete(key: K): boolean; 47 | get(key: K): V | undefined; 48 | has(key: K): boolean; 49 | set(key: K, value: V): this; 50 | } 51 | 52 | interface WeakMapConstructor { 53 | new (): WeakMap; 54 | new (entries?: ReadonlyArray<[K, V]>): WeakMap; 55 | readonly prototype: WeakMap; 56 | } 57 | declare var WeakMap: WeakMapConstructor; 58 | 59 | interface Set { 60 | add(value: T): this; 61 | clear(): void; 62 | delete(value: T): boolean; 63 | forEach(callbackfn: (value: T, value2: T, set: Set) => void, thisArg?: any): void; 64 | has(value: T): boolean; 65 | readonly size: number; 66 | } 67 | 68 | interface SetConstructor { 69 | new (): Set; 70 | new (values?: ReadonlyArray): Set; 71 | readonly prototype: Set; 72 | } 73 | declare var Set: SetConstructor; 74 | 75 | interface ReadonlySet { 76 | forEach(callbackfn: (value: T, value2: T, set: ReadonlySet) => void, thisArg?: any): void; 77 | has(value: T): boolean; 78 | readonly size: number; 79 | } 80 | 81 | interface WeakSet { 82 | add(value: T): this; 83 | delete(value: T): boolean; 84 | has(value: T): boolean; 85 | } 86 | 87 | interface WeakSetConstructor { 88 | new (): WeakSet; 89 | new (values?: ReadonlyArray): WeakSet; 90 | readonly prototype: WeakSet; 91 | } 92 | declare var WeakSet: WeakSetConstructor; 93 | -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/node_modules/typescript/lib/lib.es2015.d.ts: -------------------------------------------------------------------------------- 1 | /*! ***************************************************************************** 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | this file except in compliance with the License. You may obtain a copy of the 5 | License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | See the Apache Version 2.0 License for specific language governing permissions 13 | and limitations under the License. 14 | ***************************************************************************** */ 15 | 16 | 17 | 18 | /// 19 | 20 | 21 | /// 22 | /// 23 | /// 24 | /// 25 | /// 26 | /// 27 | /// 28 | /// 29 | /// 30 | /// -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/node_modules/typescript/lib/lib.es2015.generator.d.ts: -------------------------------------------------------------------------------- 1 | /*! ***************************************************************************** 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | this file except in compliance with the License. You may obtain a copy of the 5 | License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | See the Apache Version 2.0 License for specific language governing permissions 13 | and limitations under the License. 14 | ***************************************************************************** */ 15 | 16 | 17 | 18 | /// 19 | 20 | 21 | interface Generator extends Iterator { } 22 | 23 | interface GeneratorFunction { 24 | /** 25 | * Creates a new Generator object. 26 | * @param args A list of arguments the function accepts. 27 | */ 28 | new (...args: any[]): Generator; 29 | /** 30 | * Creates a new Generator object. 31 | * @param args A list of arguments the function accepts. 32 | */ 33 | (...args: any[]): Generator; 34 | /** 35 | * The length of the arguments. 36 | */ 37 | readonly length: number; 38 | /** 39 | * Returns the name of the function. 40 | */ 41 | readonly name: string; 42 | /** 43 | * A reference to the prototype. 44 | */ 45 | readonly prototype: Generator; 46 | } 47 | 48 | interface GeneratorFunctionConstructor { 49 | /** 50 | * Creates a new Generator function. 51 | * @param args A list of arguments the function accepts. 52 | */ 53 | new (...args: string[]): GeneratorFunction; 54 | /** 55 | * Creates a new Generator function. 56 | * @param args A list of arguments the function accepts. 57 | */ 58 | (...args: string[]): GeneratorFunction; 59 | /** 60 | * The length of the arguments. 61 | */ 62 | readonly length: number; 63 | /** 64 | * Returns the name of the function. 65 | */ 66 | readonly name: string; 67 | /** 68 | * A reference to the prototype. 69 | */ 70 | readonly prototype: GeneratorFunction; 71 | } 72 | declare var GeneratorFunction: GeneratorFunctionConstructor; 73 | -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/node_modules/typescript/lib/lib.es2015.promise.d.ts: -------------------------------------------------------------------------------- 1 | /*! ***************************************************************************** 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | this file except in compliance with the License. You may obtain a copy of the 5 | License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | See the Apache Version 2.0 License for specific language governing permissions 13 | and limitations under the License. 14 | ***************************************************************************** */ 15 | 16 | 17 | 18 | /// 19 | 20 | 21 | interface PromiseConstructor { 22 | /** 23 | * A reference to the prototype. 24 | */ 25 | readonly prototype: Promise; 26 | 27 | /** 28 | * Creates a new Promise. 29 | * @param executor A callback used to initialize the promise. This callback is passed two arguments: 30 | * a resolve callback used resolve the promise with a value or the result of another promise, 31 | * and a reject callback used to reject the promise with a provided reason or error. 32 | */ 33 | new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void): Promise; 34 | 35 | /** 36 | * Creates a Promise that is resolved with an array of results when all of the provided Promises 37 | * resolve, or rejected when any Promise is rejected. 38 | * @param values An array of Promises. 39 | * @returns A new Promise. 40 | */ 41 | all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; 42 | 43 | /** 44 | * Creates a Promise that is resolved with an array of results when all of the provided Promises 45 | * resolve, or rejected when any Promise is rejected. 46 | * @param values An array of Promises. 47 | * @returns A new Promise. 48 | */ 49 | all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; 50 | 51 | /** 52 | * Creates a Promise that is resolved with an array of results when all of the provided Promises 53 | * resolve, or rejected when any Promise is rejected. 54 | * @param values An array of Promises. 55 | * @returns A new Promise. 56 | */ 57 | all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>; 58 | 59 | /** 60 | * Creates a Promise that is resolved with an array of results when all of the provided Promises 61 | * resolve, or rejected when any Promise is rejected. 62 | * @param values An array of Promises. 63 | * @returns A new Promise. 64 | */ 65 | all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7]>; 66 | 67 | /** 68 | * Creates a Promise that is resolved with an array of results when all of the provided Promises 69 | * resolve, or rejected when any Promise is rejected. 70 | * @param values An array of Promises. 71 | * @returns A new Promise. 72 | */ 73 | all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6]>; 74 | 75 | /** 76 | * Creates a Promise that is resolved with an array of results when all of the provided Promises 77 | * resolve, or rejected when any Promise is rejected. 78 | * @param values An array of Promises. 79 | * @returns A new Promise. 80 | */ 81 | all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike]): Promise<[T1, T2, T3, T4, T5]>; 82 | 83 | /** 84 | * Creates a Promise that is resolved with an array of results when all of the provided Promises 85 | * resolve, or rejected when any Promise is rejected. 86 | * @param values An array of Promises. 87 | * @returns A new Promise. 88 | */ 89 | all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike ]): Promise<[T1, T2, T3, T4]>; 90 | 91 | /** 92 | * Creates a Promise that is resolved with an array of results when all of the provided Promises 93 | * resolve, or rejected when any Promise is rejected. 94 | * @param values An array of Promises. 95 | * @returns A new Promise. 96 | */ 97 | all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[T1, T2, T3]>; 98 | 99 | /** 100 | * Creates a Promise that is resolved with an array of results when all of the provided Promises 101 | * resolve, or rejected when any Promise is rejected. 102 | * @param values An array of Promises. 103 | * @returns A new Promise. 104 | */ 105 | all(values: [T1 | PromiseLike, T2 | PromiseLike]): Promise<[T1, T2]>; 106 | 107 | /** 108 | * Creates a Promise that is resolved with an array of results when all of the provided Promises 109 | * resolve, or rejected when any Promise is rejected. 110 | * @param values An array of Promises. 111 | * @returns A new Promise. 112 | */ 113 | all(values: (T | PromiseLike)[]): Promise; 114 | 115 | /** 116 | * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved 117 | * or rejected. 118 | * @param values An array of Promises. 119 | * @returns A new Promise. 120 | */ 121 | race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise; 122 | 123 | /** 124 | * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved 125 | * or rejected. 126 | * @param values An array of Promises. 127 | * @returns A new Promise. 128 | */ 129 | race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise; 130 | 131 | /** 132 | * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved 133 | * or rejected. 134 | * @param values An array of Promises. 135 | * @returns A new Promise. 136 | */ 137 | race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise; 138 | 139 | /** 140 | * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved 141 | * or rejected. 142 | * @param values An array of Promises. 143 | * @returns A new Promise. 144 | */ 145 | race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise; 146 | 147 | /** 148 | * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved 149 | * or rejected. 150 | * @param values An array of Promises. 151 | * @returns A new Promise. 152 | */ 153 | race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike]): Promise; 154 | 155 | /** 156 | * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved 157 | * or rejected. 158 | * @param values An array of Promises. 159 | * @returns A new Promise. 160 | */ 161 | race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike]): Promise; 162 | 163 | /** 164 | * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved 165 | * or rejected. 166 | * @param values An array of Promises. 167 | * @returns A new Promise. 168 | */ 169 | race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike]): Promise; 170 | 171 | /** 172 | * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved 173 | * or rejected. 174 | * @param values An array of Promises. 175 | * @returns A new Promise. 176 | */ 177 | race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise; 178 | 179 | /** 180 | * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved 181 | * or rejected. 182 | * @param values An array of Promises. 183 | * @returns A new Promise. 184 | */ 185 | race(values: [T1 | PromiseLike, T2 | PromiseLike]): Promise; 186 | 187 | /** 188 | * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved 189 | * or rejected. 190 | * @param values An array of Promises. 191 | * @returns A new Promise. 192 | */ 193 | race(values: (T | PromiseLike)[]): Promise; 194 | 195 | /** 196 | * Creates a new rejected promise for the provided reason. 197 | * @param reason The reason the promise was rejected. 198 | * @returns A new rejected Promise. 199 | */ 200 | reject(reason: any): Promise; 201 | 202 | /** 203 | * Creates a new rejected promise for the provided reason. 204 | * @param reason The reason the promise was rejected. 205 | * @returns A new rejected Promise. 206 | */ 207 | reject(reason: any): Promise; 208 | 209 | /** 210 | * Creates a new resolved promise for the provided value. 211 | * @param value A promise. 212 | * @returns A promise whose internal state matches the provided promise. 213 | */ 214 | resolve(value: T | PromiseLike): Promise; 215 | 216 | /** 217 | * Creates a new resolved promise . 218 | * @returns A resolved promise. 219 | */ 220 | resolve(): Promise; 221 | } 222 | 223 | declare var Promise: PromiseConstructor; -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/node_modules/typescript/lib/lib.es2015.proxy.d.ts: -------------------------------------------------------------------------------- 1 | /*! ***************************************************************************** 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | this file except in compliance with the License. You may obtain a copy of the 5 | License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | See the Apache Version 2.0 License for specific language governing permissions 13 | and limitations under the License. 14 | ***************************************************************************** */ 15 | 16 | 17 | 18 | /// 19 | 20 | 21 | interface ProxyHandler { 22 | getPrototypeOf? (target: T): object | null; 23 | setPrototypeOf? (target: T, v: any): boolean; 24 | isExtensible? (target: T): boolean; 25 | preventExtensions? (target: T): boolean; 26 | getOwnPropertyDescriptor? (target: T, p: PropertyKey): PropertyDescriptor | undefined; 27 | has? (target: T, p: PropertyKey): boolean; 28 | get? (target: T, p: PropertyKey, receiver: any): any; 29 | set? (target: T, p: PropertyKey, value: any, receiver: any): boolean; 30 | deleteProperty? (target: T, p: PropertyKey): boolean; 31 | defineProperty? (target: T, p: PropertyKey, attributes: PropertyDescriptor): boolean; 32 | enumerate? (target: T): PropertyKey[]; 33 | ownKeys? (target: T): PropertyKey[]; 34 | apply? (target: T, thisArg: any, argArray?: any): any; 35 | construct? (target: T, argArray: any, newTarget?: any): object; 36 | } 37 | 38 | interface ProxyConstructor { 39 | revocable(target: T, handler: ProxyHandler): { proxy: T; revoke: () => void; }; 40 | new (target: T, handler: ProxyHandler): T; 41 | } 42 | declare var Proxy: ProxyConstructor; 43 | -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/node_modules/typescript/lib/lib.es2015.reflect.d.ts: -------------------------------------------------------------------------------- 1 | /*! ***************************************************************************** 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | this file except in compliance with the License. You may obtain a copy of the 5 | License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | See the Apache Version 2.0 License for specific language governing permissions 13 | and limitations under the License. 14 | ***************************************************************************** */ 15 | 16 | 17 | 18 | /// 19 | 20 | 21 | declare namespace Reflect { 22 | function apply(target: Function, thisArgument: any, argumentsList: ArrayLike): any; 23 | function construct(target: Function, argumentsList: ArrayLike, newTarget?: any): any; 24 | function defineProperty(target: object, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean; 25 | function deleteProperty(target: object, propertyKey: PropertyKey): boolean; 26 | function get(target: object, propertyKey: PropertyKey, receiver?: any): any; 27 | function getOwnPropertyDescriptor(target: object, propertyKey: PropertyKey): PropertyDescriptor | undefined; 28 | function getPrototypeOf(target: object): object; 29 | function has(target: object, propertyKey: PropertyKey): boolean; 30 | function isExtensible(target: object): boolean; 31 | function ownKeys(target: object): PropertyKey[]; 32 | function preventExtensions(target: object): boolean; 33 | function set(target: object, propertyKey: PropertyKey, value: any, receiver?: any): boolean; 34 | function setPrototypeOf(target: object, proto: any): boolean; 35 | } 36 | -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/node_modules/typescript/lib/lib.es2015.symbol.d.ts: -------------------------------------------------------------------------------- 1 | /*! ***************************************************************************** 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | this file except in compliance with the License. You may obtain a copy of the 5 | License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | See the Apache Version 2.0 License for specific language governing permissions 13 | and limitations under the License. 14 | ***************************************************************************** */ 15 | 16 | 17 | 18 | /// 19 | 20 | 21 | interface Symbol { 22 | /** Returns a string representation of an object. */ 23 | toString(): string; 24 | 25 | /** Returns the primitive value of the specified object. */ 26 | valueOf(): symbol; 27 | } 28 | 29 | interface SymbolConstructor { 30 | /** 31 | * A reference to the prototype. 32 | */ 33 | readonly prototype: Symbol; 34 | 35 | /** 36 | * Returns a new unique Symbol value. 37 | * @param description Description of the new Symbol object. 38 | */ 39 | (description?: string | number): symbol; 40 | 41 | /** 42 | * Returns a Symbol object from the global symbol registry matching the given key if found. 43 | * Otherwise, returns a new symbol with this key. 44 | * @param key key to search for. 45 | */ 46 | for(key: string): symbol; 47 | 48 | /** 49 | * Returns a key from the global symbol registry matching the given Symbol if found. 50 | * Otherwise, returns a undefined. 51 | * @param sym Symbol to find the key for. 52 | */ 53 | keyFor(sym: symbol): string | undefined; 54 | } 55 | 56 | declare var Symbol: SymbolConstructor; -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts: -------------------------------------------------------------------------------- 1 | /*! ***************************************************************************** 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | this file except in compliance with the License. You may obtain a copy of the 5 | License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | See the Apache Version 2.0 License for specific language governing permissions 13 | and limitations under the License. 14 | ***************************************************************************** */ 15 | 16 | 17 | 18 | /// 19 | 20 | 21 | /// 22 | 23 | interface SymbolConstructor { 24 | /** 25 | * A method that determines if a constructor object recognizes an object as one of the 26 | * constructor’s instances. Called by the semantics of the instanceof operator. 27 | */ 28 | readonly hasInstance: symbol; 29 | 30 | /** 31 | * A Boolean value that if true indicates that an object should flatten to its array elements 32 | * by Array.prototype.concat. 33 | */ 34 | readonly isConcatSpreadable: symbol; 35 | 36 | /** 37 | * A regular expression method that matches the regular expression against a string. Called 38 | * by the String.prototype.match method. 39 | */ 40 | readonly match: symbol; 41 | 42 | /** 43 | * A regular expression method that replaces matched substrings of a string. Called by the 44 | * String.prototype.replace method. 45 | */ 46 | readonly replace: symbol; 47 | 48 | /** 49 | * A regular expression method that returns the index within a string that matches the 50 | * regular expression. Called by the String.prototype.search method. 51 | */ 52 | readonly search: symbol; 53 | 54 | /** 55 | * A function valued property that is the constructor function that is used to create 56 | * derived objects. 57 | */ 58 | readonly species: symbol; 59 | 60 | /** 61 | * A regular expression method that splits a string at the indices that match the regular 62 | * expression. Called by the String.prototype.split method. 63 | */ 64 | readonly split: symbol; 65 | 66 | /** 67 | * A method that converts an object to a corresponding primitive value. 68 | * Called by the ToPrimitive abstract operation. 69 | */ 70 | readonly toPrimitive: symbol; 71 | 72 | /** 73 | * A String value that is used in the creation of the default string description of an object. 74 | * Called by the built-in method Object.prototype.toString. 75 | */ 76 | readonly toStringTag: symbol; 77 | 78 | /** 79 | * An Object whose own property names are property names that are excluded from the 'with' 80 | * environment bindings of the associated objects. 81 | */ 82 | readonly unscopables: symbol; 83 | } 84 | 85 | interface Symbol { 86 | readonly [Symbol.toStringTag]: "Symbol"; 87 | } 88 | 89 | interface Array { 90 | /** 91 | * Returns an object whose properties have the value 'true' 92 | * when they will be absent when used in a 'with' statement. 93 | */ 94 | [Symbol.unscopables](): { 95 | copyWithin: boolean; 96 | entries: boolean; 97 | fill: boolean; 98 | find: boolean; 99 | findIndex: boolean; 100 | keys: boolean; 101 | values: boolean; 102 | }; 103 | } 104 | 105 | interface Date { 106 | /** 107 | * Converts a Date object to a string. 108 | */ 109 | [Symbol.toPrimitive](hint: "default"): string; 110 | /** 111 | * Converts a Date object to a string. 112 | */ 113 | [Symbol.toPrimitive](hint: "string"): string; 114 | /** 115 | * Converts a Date object to a number. 116 | */ 117 | [Symbol.toPrimitive](hint: "number"): number; 118 | /** 119 | * Converts a Date object to a string or number. 120 | * 121 | * @param hint The strings "number", "string", or "default" to specify what primitive to return. 122 | * 123 | * @throws {TypeError} If 'hint' was given something other than "number", "string", or "default". 124 | * @returns A number if 'hint' was "number", a string if 'hint' was "string" or "default". 125 | */ 126 | [Symbol.toPrimitive](hint: string): string | number; 127 | } 128 | 129 | interface Map { 130 | readonly [Symbol.toStringTag]: "Map"; 131 | } 132 | 133 | interface WeakMap { 134 | readonly [Symbol.toStringTag]: "WeakMap"; 135 | } 136 | 137 | interface Set { 138 | readonly [Symbol.toStringTag]: "Set"; 139 | } 140 | 141 | interface WeakSet { 142 | readonly [Symbol.toStringTag]: "WeakSet"; 143 | } 144 | 145 | interface JSON { 146 | readonly [Symbol.toStringTag]: "JSON"; 147 | } 148 | 149 | interface Function { 150 | /** 151 | * Determines whether the given value inherits from this function if this function was used 152 | * as a constructor function. 153 | * 154 | * A constructor function can control which objects are recognized as its instances by 155 | * 'instanceof' by overriding this method. 156 | */ 157 | [Symbol.hasInstance](value: any): boolean; 158 | } 159 | 160 | interface GeneratorFunction { 161 | readonly [Symbol.toStringTag]: "GeneratorFunction"; 162 | } 163 | 164 | interface Math { 165 | readonly [Symbol.toStringTag]: "Math"; 166 | } 167 | 168 | interface Promise { 169 | readonly [Symbol.toStringTag]: "Promise"; 170 | } 171 | 172 | interface PromiseConstructor { 173 | readonly [Symbol.species]: PromiseConstructor; 174 | } 175 | 176 | interface RegExp { 177 | /** 178 | * Matches a string with this regular expression, and returns an array containing the results of 179 | * that search. 180 | * @param string A string to search within. 181 | */ 182 | [Symbol.match](string: string): RegExpMatchArray | null; 183 | 184 | /** 185 | * Replaces text in a string, using this regular expression. 186 | * @param string A String object or string literal whose contents matching against 187 | * this regular expression will be replaced 188 | * @param replaceValue A String object or string literal containing the text to replace for every 189 | * successful match of this regular expression. 190 | */ 191 | [Symbol.replace](string: string, replaceValue: string): string; 192 | 193 | /** 194 | * Replaces text in a string, using this regular expression. 195 | * @param string A String object or string literal whose contents matching against 196 | * this regular expression will be replaced 197 | * @param replacer A function that returns the replacement text. 198 | */ 199 | [Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string; 200 | 201 | /** 202 | * Finds the position beginning first substring match in a regular expression search 203 | * using this regular expression. 204 | * 205 | * @param string The string to search within. 206 | */ 207 | [Symbol.search](string: string): number; 208 | 209 | /** 210 | * Returns an array of substrings that were delimited by strings in the original input that 211 | * match against this regular expression. 212 | * 213 | * If the regular expression contains capturing parentheses, then each time this 214 | * regular expression matches, the results (including any undefined results) of the 215 | * capturing parentheses are spliced. 216 | * 217 | * @param string string value to split 218 | * @param limit if not undefined, the output array is truncated so that it contains no more 219 | * than 'limit' elements. 220 | */ 221 | [Symbol.split](string: string, limit?: number): string[]; 222 | } 223 | 224 | interface RegExpConstructor { 225 | readonly [Symbol.species]: RegExpConstructor; 226 | } 227 | 228 | interface String { 229 | /** 230 | * Matches a string an object that supports being matched against, and returns an array containing the results of that search. 231 | * @param matcher An object that supports being matched against. 232 | */ 233 | match(matcher: { [Symbol.match](string: string): RegExpMatchArray | null; }): RegExpMatchArray | null; 234 | 235 | /** 236 | * Replaces text in a string, using an object that supports replacement within a string. 237 | * @param searchValue A object can search for and replace matches within a string. 238 | * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string. 239 | */ 240 | replace(searchValue: { [Symbol.replace](string: string, replaceValue: string): string; }, replaceValue: string): string; 241 | 242 | /** 243 | * Replaces text in a string, using an object that supports replacement within a string. 244 | * @param searchValue A object can search for and replace matches within a string. 245 | * @param replacer A function that returns the replacement text. 246 | */ 247 | replace(searchValue: { [Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string; }, replacer: (substring: string, ...args: any[]) => string): string; 248 | 249 | /** 250 | * Finds the first substring match in a regular expression search. 251 | * @param searcher An object which supports searching within a string. 252 | */ 253 | search(searcher: { [Symbol.search](string: string): number; }): number; 254 | 255 | /** 256 | * Split a string into substrings using the specified separator and return them as an array. 257 | * @param splitter An object that can split a string. 258 | * @param limit A value used to limit the number of elements returned in the array. 259 | */ 260 | split(splitter: { [Symbol.split](string: string, limit?: number): string[]; }, limit?: number): string[]; 261 | } 262 | 263 | interface ArrayBuffer { 264 | readonly [Symbol.toStringTag]: "ArrayBuffer"; 265 | } 266 | 267 | interface DataView { 268 | readonly [Symbol.toStringTag]: "DataView"; 269 | } 270 | 271 | interface Int8Array { 272 | readonly [Symbol.toStringTag]: "Int8Array"; 273 | } 274 | 275 | interface Uint8Array { 276 | readonly [Symbol.toStringTag]: "UInt8Array"; 277 | } 278 | 279 | interface Uint8ClampedArray { 280 | readonly [Symbol.toStringTag]: "Uint8ClampedArray"; 281 | } 282 | 283 | interface Int16Array { 284 | readonly [Symbol.toStringTag]: "Int16Array"; 285 | } 286 | 287 | interface Uint16Array { 288 | readonly [Symbol.toStringTag]: "Uint16Array"; 289 | } 290 | 291 | interface Int32Array { 292 | readonly [Symbol.toStringTag]: "Int32Array"; 293 | } 294 | 295 | interface Uint32Array { 296 | readonly [Symbol.toStringTag]: "Uint32Array"; 297 | } 298 | 299 | interface Float32Array { 300 | readonly [Symbol.toStringTag]: "Float32Array"; 301 | } 302 | 303 | interface Float64Array { 304 | readonly [Symbol.toStringTag]: "Float64Array"; 305 | } 306 | 307 | interface ArrayConstructor { 308 | readonly [Symbol.species]: ArrayConstructor; 309 | } 310 | interface MapConstructor { 311 | readonly [Symbol.species]: MapConstructor; 312 | } 313 | interface SetConstructor { 314 | readonly [Symbol.species]: SetConstructor; 315 | } 316 | interface ArrayBufferConstructor { 317 | readonly [Symbol.species]: ArrayBufferConstructor; 318 | } -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/node_modules/typescript/lib/lib.es2016.array.include.d.ts: -------------------------------------------------------------------------------- 1 | /*! ***************************************************************************** 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | this file except in compliance with the License. You may obtain a copy of the 5 | License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | See the Apache Version 2.0 License for specific language governing permissions 13 | and limitations under the License. 14 | ***************************************************************************** */ 15 | 16 | 17 | 18 | /// 19 | 20 | 21 | interface Array { 22 | /** 23 | * Determines whether an array includes a certain element, returning true or false as appropriate. 24 | * @param searchElement The element to search for. 25 | * @param fromIndex The position in this array at which to begin searching for searchElement. 26 | */ 27 | includes(searchElement: T, fromIndex?: number): boolean; 28 | } 29 | 30 | interface ReadonlyArray { 31 | /** 32 | * Determines whether an array includes a certain element, returning true or false as appropriate. 33 | * @param searchElement The element to search for. 34 | * @param fromIndex The position in this array at which to begin searching for searchElement. 35 | */ 36 | includes(searchElement: T, fromIndex?: number): boolean; 37 | } 38 | 39 | interface Int8Array { 40 | /** 41 | * Determines whether an array includes a certain element, returning true or false as appropriate. 42 | * @param searchElement The element to search for. 43 | * @param fromIndex The position in this array at which to begin searching for searchElement. 44 | */ 45 | includes(searchElement: number, fromIndex?: number): boolean; 46 | } 47 | 48 | interface Uint8Array { 49 | /** 50 | * Determines whether an array includes a certain element, returning true or false as appropriate. 51 | * @param searchElement The element to search for. 52 | * @param fromIndex The position in this array at which to begin searching for searchElement. 53 | */ 54 | includes(searchElement: number, fromIndex?: number): boolean; 55 | } 56 | 57 | interface Uint8ClampedArray { 58 | /** 59 | * Determines whether an array includes a certain element, returning true or false as appropriate. 60 | * @param searchElement The element to search for. 61 | * @param fromIndex The position in this array at which to begin searching for searchElement. 62 | */ 63 | includes(searchElement: number, fromIndex?: number): boolean; 64 | } 65 | 66 | interface Int16Array { 67 | /** 68 | * Determines whether an array includes a certain element, returning true or false as appropriate. 69 | * @param searchElement The element to search for. 70 | * @param fromIndex The position in this array at which to begin searching for searchElement. 71 | */ 72 | includes(searchElement: number, fromIndex?: number): boolean; 73 | } 74 | 75 | interface Uint16Array { 76 | /** 77 | * Determines whether an array includes a certain element, returning true or false as appropriate. 78 | * @param searchElement The element to search for. 79 | * @param fromIndex The position in this array at which to begin searching for searchElement. 80 | */ 81 | includes(searchElement: number, fromIndex?: number): boolean; 82 | } 83 | 84 | interface Int32Array { 85 | /** 86 | * Determines whether an array includes a certain element, returning true or false as appropriate. 87 | * @param searchElement The element to search for. 88 | * @param fromIndex The position in this array at which to begin searching for searchElement. 89 | */ 90 | includes(searchElement: number, fromIndex?: number): boolean; 91 | } 92 | 93 | interface Uint32Array { 94 | /** 95 | * Determines whether an array includes a certain element, returning true or false as appropriate. 96 | * @param searchElement The element to search for. 97 | * @param fromIndex The position in this array at which to begin searching for searchElement. 98 | */ 99 | includes(searchElement: number, fromIndex?: number): boolean; 100 | } 101 | 102 | interface Float32Array { 103 | /** 104 | * Determines whether an array includes a certain element, returning true or false as appropriate. 105 | * @param searchElement The element to search for. 106 | * @param fromIndex The position in this array at which to begin searching for searchElement. 107 | */ 108 | includes(searchElement: number, fromIndex?: number): boolean; 109 | } 110 | 111 | interface Float64Array { 112 | /** 113 | * Determines whether an array includes a certain element, returning true or false as appropriate. 114 | * @param searchElement The element to search for. 115 | * @param fromIndex The position in this array at which to begin searching for searchElement. 116 | */ 117 | includes(searchElement: number, fromIndex?: number): boolean; 118 | } -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/node_modules/typescript/lib/lib.es2016.d.ts: -------------------------------------------------------------------------------- 1 | /*! ***************************************************************************** 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | this file except in compliance with the License. You may obtain a copy of the 5 | License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | See the Apache Version 2.0 License for specific language governing permissions 13 | and limitations under the License. 14 | ***************************************************************************** */ 15 | 16 | 17 | 18 | /// 19 | 20 | 21 | /// 22 | /// -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/node_modules/typescript/lib/lib.es2017.d.ts: -------------------------------------------------------------------------------- 1 | /*! ***************************************************************************** 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | this file except in compliance with the License. You may obtain a copy of the 5 | License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | See the Apache Version 2.0 License for specific language governing permissions 13 | and limitations under the License. 14 | ***************************************************************************** */ 15 | 16 | 17 | 18 | /// 19 | 20 | 21 | /// 22 | /// 23 | /// 24 | /// 25 | /// 26 | /// 27 | -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/node_modules/typescript/lib/lib.es2017.object.d.ts: -------------------------------------------------------------------------------- 1 | /*! ***************************************************************************** 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | this file except in compliance with the License. You may obtain a copy of the 5 | License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | See the Apache Version 2.0 License for specific language governing permissions 13 | and limitations under the License. 14 | ***************************************************************************** */ 15 | 16 | 17 | 18 | /// 19 | 20 | 21 | interface ObjectConstructor { 22 | /** 23 | * Returns an array of values of the enumerable properties of an object 24 | * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. 25 | */ 26 | values(o: { [s: string]: T } | ArrayLike): T[]; 27 | 28 | /** 29 | * Returns an array of values of the enumerable properties of an object 30 | * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. 31 | */ 32 | values(o: {}): any[]; 33 | 34 | /** 35 | * Returns an array of key/values of the enumerable properties of an object 36 | * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. 37 | */ 38 | entries(o: { [s: string]: T } | ArrayLike): [string, T][]; 39 | 40 | /** 41 | * Returns an array of key/values of the enumerable properties of an object 42 | * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. 43 | */ 44 | entries(o: {}): [string, any][]; 45 | 46 | /** 47 | * Returns an object containing all own property descriptors of an object 48 | * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. 49 | */ 50 | getOwnPropertyDescriptors(o: T): {[P in keyof T]: TypedPropertyDescriptor} & { [x: string]: PropertyDescriptor }; 51 | } 52 | -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts: -------------------------------------------------------------------------------- 1 | /*! ***************************************************************************** 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | this file except in compliance with the License. You may obtain a copy of the 5 | License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | See the Apache Version 2.0 License for specific language governing permissions 13 | and limitations under the License. 14 | ***************************************************************************** */ 15 | 16 | 17 | 18 | /// 19 | 20 | 21 | /// 22 | /// 23 | 24 | interface SharedArrayBuffer { 25 | /** 26 | * Read-only. The length of the ArrayBuffer (in bytes). 27 | */ 28 | readonly byteLength: number; 29 | 30 | /* 31 | * The SharedArrayBuffer constructor's length property whose value is 1. 32 | */ 33 | length: number; 34 | /** 35 | * Returns a section of an SharedArrayBuffer. 36 | */ 37 | slice(begin: number, end?: number): SharedArrayBuffer; 38 | readonly [Symbol.species]: SharedArrayBuffer; 39 | readonly [Symbol.toStringTag]: "SharedArrayBuffer"; 40 | } 41 | 42 | interface SharedArrayBufferConstructor { 43 | readonly prototype: SharedArrayBuffer; 44 | new (byteLength: number): SharedArrayBuffer; 45 | } 46 | declare var SharedArrayBuffer: SharedArrayBufferConstructor; 47 | 48 | interface ArrayBufferTypes { 49 | SharedArrayBuffer: SharedArrayBuffer; 50 | } 51 | 52 | interface Atomics { 53 | /** 54 | * Adds a value to the value at the given position in the array, returning the original value. 55 | * Until this atomic operation completes, any other read or write operation against the array 56 | * will block. 57 | */ 58 | add(typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, index: number, value: number): number; 59 | 60 | /** 61 | * Stores the bitwise AND of a value with the value at the given position in the array, 62 | * returning the original value. Until this atomic operation completes, any other read or 63 | * write operation against the array will block. 64 | */ 65 | and(typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, index: number, value: number): number; 66 | 67 | /** 68 | * Replaces the value at the given position in the array if the original value equals the given 69 | * expected value, returning the original value. Until this atomic operation completes, any 70 | * other read or write operation against the array will block. 71 | */ 72 | compareExchange(typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, index: number, expectedValue: number, replacementValue: number): number; 73 | 74 | /** 75 | * Replaces the value at the given position in the array, returning the original value. Until 76 | * this atomic operation completes, any other read or write operation against the array will 77 | * block. 78 | */ 79 | exchange(typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, index: number, value: number): number; 80 | 81 | /** 82 | * Returns a value indicating whether high-performance algorithms can use atomic operations 83 | * (`true`) or must use locks (`false`) for the given number of bytes-per-element of a typed 84 | * array. 85 | */ 86 | isLockFree(size: number): boolean; 87 | 88 | /** 89 | * Returns the value at the given position in the array. Until this atomic operation completes, 90 | * any other read or write operation against the array will block. 91 | */ 92 | load(typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, index: number): number; 93 | 94 | /** 95 | * Stores the bitwise OR of a value with the value at the given position in the array, 96 | * returning the original value. Until this atomic operation completes, any other read or write 97 | * operation against the array will block. 98 | */ 99 | or(typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, index: number, value: number): number; 100 | 101 | /** 102 | * Stores a value at the given position in the array, returning the new value. Until this 103 | * atomic operation completes, any other read or write operation against the array will block. 104 | */ 105 | store(typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, index: number, value: number): number; 106 | 107 | /** 108 | * Subtracts a value from the value at the given position in the array, returning the original 109 | * value. Until this atomic operation completes, any other read or write operation against the 110 | * array will block. 111 | */ 112 | sub(typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, index: number, value: number): number; 113 | 114 | /** 115 | * If the value at the given position in the array is equal to the provided value, the current 116 | * agent is put to sleep causing execution to suspend until the timeout expires (returning 117 | * `"timed-out"`) or until the agent is awoken (returning `"ok"`); otherwise, returns 118 | * `"not-equal"`. 119 | */ 120 | wait(typedArray: Int32Array, index: number, value: number, timeout?: number): "ok" | "not-equal" | "timed-out"; 121 | 122 | /** 123 | * Wakes up sleeping agents that are waiting on the given index of the array, returning the 124 | * number of agents that were awoken. 125 | */ 126 | wake(typedArray: Int32Array, index: number, count: number): number; 127 | 128 | /** 129 | * Stores the bitwise XOR of a value with the value at the given position in the array, 130 | * returning the original value. Until this atomic operation completes, any other read or write 131 | * operation against the array will block. 132 | */ 133 | xor(typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, index: number, value: number): number; 134 | 135 | readonly [Symbol.toStringTag]: "Atomics"; 136 | } 137 | 138 | declare var Atomics: Atomics; -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/node_modules/typescript/lib/lib.es2017.string.d.ts: -------------------------------------------------------------------------------- 1 | /*! ***************************************************************************** 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | this file except in compliance with the License. You may obtain a copy of the 5 | License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | See the Apache Version 2.0 License for specific language governing permissions 13 | and limitations under the License. 14 | ***************************************************************************** */ 15 | 16 | 17 | 18 | /// 19 | 20 | 21 | interface String { 22 | /** 23 | * Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length. 24 | * The padding is applied from the start (left) of the current string. 25 | * 26 | * @param maxLength The length of the resulting string once the current string has been padded. 27 | * If this parameter is smaller than the current string's length, the current string will be returned as it is. 28 | * 29 | * @param fillString The string to pad the current string with. 30 | * If this string is too long, it will be truncated and the left-most part will be applied. 31 | * The default value for this parameter is " " (U+0020). 32 | */ 33 | padStart(maxLength: number, fillString?: string): string; 34 | 35 | /** 36 | * Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length. 37 | * The padding is applied from the end (right) of the current string. 38 | * 39 | * @param maxLength The length of the resulting string once the current string has been padded. 40 | * If this parameter is smaller than the current string's length, the current string will be returned as it is. 41 | * 42 | * @param fillString The string to pad the current string with. 43 | * If this string is too long, it will be truncated and the left-most part will be applied. 44 | * The default value for this parameter is " " (U+0020). 45 | */ 46 | padEnd(maxLength: number, fillString?: string): string; 47 | } 48 | -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/node_modules/typescript/lib/lib.scripthost.d.ts: -------------------------------------------------------------------------------- 1 | /*! ***************************************************************************** 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | this file except in compliance with the License. You may obtain a copy of the 5 | License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | See the Apache Version 2.0 License for specific language governing permissions 13 | and limitations under the License. 14 | ***************************************************************************** */ 15 | 16 | 17 | 18 | /// 19 | 20 | 21 | 22 | 23 | ///////////////////////////// 24 | /// Windows Script Host APIS 25 | ///////////////////////////// 26 | 27 | 28 | interface ActiveXObject { 29 | new (s: string): any; 30 | } 31 | declare var ActiveXObject: ActiveXObject; 32 | 33 | interface ITextWriter { 34 | Write(s: string): void; 35 | WriteLine(s: string): void; 36 | Close(): void; 37 | } 38 | 39 | interface TextStreamBase { 40 | /** 41 | * The column number of the current character position in an input stream. 42 | */ 43 | Column: number; 44 | 45 | /** 46 | * The current line number in an input stream. 47 | */ 48 | Line: number; 49 | 50 | /** 51 | * Closes a text stream. 52 | * It is not necessary to close standard streams; they close automatically when the process ends. If 53 | * you close a standard stream, be aware that any other pointers to that standard stream become invalid. 54 | */ 55 | Close(): void; 56 | } 57 | 58 | interface TextStreamWriter extends TextStreamBase { 59 | /** 60 | * Sends a string to an output stream. 61 | */ 62 | Write(s: string): void; 63 | 64 | /** 65 | * Sends a specified number of blank lines (newline characters) to an output stream. 66 | */ 67 | WriteBlankLines(intLines: number): void; 68 | 69 | /** 70 | * Sends a string followed by a newline character to an output stream. 71 | */ 72 | WriteLine(s: string): void; 73 | } 74 | 75 | interface TextStreamReader extends TextStreamBase { 76 | /** 77 | * Returns a specified number of characters from an input stream, starting at the current pointer position. 78 | * Does not return until the ENTER key is pressed. 79 | * Can only be used on a stream in reading mode; causes an error in writing or appending mode. 80 | */ 81 | Read(characters: number): string; 82 | 83 | /** 84 | * Returns all characters from an input stream. 85 | * Can only be used on a stream in reading mode; causes an error in writing or appending mode. 86 | */ 87 | ReadAll(): string; 88 | 89 | /** 90 | * Returns an entire line from an input stream. 91 | * Although this method extracts the newline character, it does not add it to the returned string. 92 | * Can only be used on a stream in reading mode; causes an error in writing or appending mode. 93 | */ 94 | ReadLine(): string; 95 | 96 | /** 97 | * Skips a specified number of characters when reading from an input text stream. 98 | * Can only be used on a stream in reading mode; causes an error in writing or appending mode. 99 | * @param characters Positive number of characters to skip forward. (Backward skipping is not supported.) 100 | */ 101 | Skip(characters: number): void; 102 | 103 | /** 104 | * Skips the next line when reading from an input text stream. 105 | * Can only be used on a stream in reading mode, not writing or appending mode. 106 | */ 107 | SkipLine(): void; 108 | 109 | /** 110 | * Indicates whether the stream pointer position is at the end of a line. 111 | */ 112 | AtEndOfLine: boolean; 113 | 114 | /** 115 | * Indicates whether the stream pointer position is at the end of a stream. 116 | */ 117 | AtEndOfStream: boolean; 118 | } 119 | 120 | declare var WScript: { 121 | /** 122 | * Outputs text to either a message box (under WScript.exe) or the command console window followed by 123 | * a newline (under CScript.exe). 124 | */ 125 | Echo(s: any): void; 126 | 127 | /** 128 | * Exposes the write-only error output stream for the current script. 129 | * Can be accessed only while using CScript.exe. 130 | */ 131 | StdErr: TextStreamWriter; 132 | 133 | /** 134 | * Exposes the write-only output stream for the current script. 135 | * Can be accessed only while using CScript.exe. 136 | */ 137 | StdOut: TextStreamWriter; 138 | Arguments: { length: number; Item(n: number): string; }; 139 | 140 | /** 141 | * The full path of the currently running script. 142 | */ 143 | ScriptFullName: string; 144 | 145 | /** 146 | * Forces the script to stop immediately, with an optional exit code. 147 | */ 148 | Quit(exitCode?: number): number; 149 | 150 | /** 151 | * The Windows Script Host build version number. 152 | */ 153 | BuildVersion: number; 154 | 155 | /** 156 | * Fully qualified path of the host executable. 157 | */ 158 | FullName: string; 159 | 160 | /** 161 | * Gets/sets the script mode - interactive(true) or batch(false). 162 | */ 163 | Interactive: boolean; 164 | 165 | /** 166 | * The name of the host executable (WScript.exe or CScript.exe). 167 | */ 168 | Name: string; 169 | 170 | /** 171 | * Path of the directory containing the host executable. 172 | */ 173 | Path: string; 174 | 175 | /** 176 | * The filename of the currently running script. 177 | */ 178 | ScriptName: string; 179 | 180 | /** 181 | * Exposes the read-only input stream for the current script. 182 | * Can be accessed only while using CScript.exe. 183 | */ 184 | StdIn: TextStreamReader; 185 | 186 | /** 187 | * Windows Script Host version 188 | */ 189 | Version: string; 190 | 191 | /** 192 | * Connects a COM object's event sources to functions named with a given prefix, in the form prefix_event. 193 | */ 194 | ConnectObject(objEventSource: any, strPrefix: string): void; 195 | 196 | /** 197 | * Creates a COM object. 198 | * @param strProgiID 199 | * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events. 200 | */ 201 | CreateObject(strProgID: string, strPrefix?: string): any; 202 | 203 | /** 204 | * Disconnects a COM object from its event sources. 205 | */ 206 | DisconnectObject(obj: any): void; 207 | 208 | /** 209 | * Retrieves an existing object with the specified ProgID from memory, or creates a new one from a file. 210 | * @param strPathname Fully qualified path to the file containing the object persisted to disk. 211 | * For objects in memory, pass a zero-length string. 212 | * @param strProgID 213 | * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events. 214 | */ 215 | GetObject(strPathname: string, strProgID?: string, strPrefix?: string): any; 216 | 217 | /** 218 | * Suspends script execution for a specified length of time, then continues execution. 219 | * @param intTime Interval (in milliseconds) to suspend script execution. 220 | */ 221 | Sleep(intTime: number): void; 222 | }; 223 | 224 | /** 225 | * Represents an Automation SAFEARRAY 226 | */ 227 | declare class SafeArray { 228 | private constructor(); 229 | private SafeArray_typekey: SafeArray; 230 | } 231 | 232 | /** 233 | * Allows enumerating over a COM collection, which may not have indexed item access. 234 | */ 235 | interface Enumerator { 236 | /** 237 | * Returns true if the current item is the last one in the collection, or the collection is empty, 238 | * or the current item is undefined. 239 | */ 240 | atEnd(): boolean; 241 | 242 | /** 243 | * Returns the current item in the collection 244 | */ 245 | item(): T; 246 | 247 | /** 248 | * Resets the current item in the collection to the first item. If there are no items in the collection, 249 | * the current item is set to undefined. 250 | */ 251 | moveFirst(): void; 252 | 253 | /** 254 | * Moves the current item to the next item in the collection. If the enumerator is at the end of 255 | * the collection or the collection is empty, the current item is set to undefined. 256 | */ 257 | moveNext(): void; 258 | } 259 | 260 | interface EnumeratorConstructor { 261 | new (safearray: SafeArray): Enumerator; 262 | new (collection: { Item(index: any): T }): Enumerator; 263 | new (collection: any): Enumerator; 264 | } 265 | 266 | declare var Enumerator: EnumeratorConstructor; 267 | 268 | /** 269 | * Enables reading from a COM safe array, which might have an alternate lower bound, or multiple dimensions. 270 | */ 271 | interface VBArray { 272 | /** 273 | * Returns the number of dimensions (1-based). 274 | */ 275 | dimensions(): number; 276 | 277 | /** 278 | * Takes an index for each dimension in the array, and returns the item at the corresponding location. 279 | */ 280 | getItem(dimension1Index: number, ...dimensionNIndexes: number[]): T; 281 | 282 | /** 283 | * Returns the smallest available index for a given dimension. 284 | * @param dimension 1-based dimension (defaults to 1) 285 | */ 286 | lbound(dimension?: number): number; 287 | 288 | /** 289 | * Returns the largest available index for a given dimension. 290 | * @param dimension 1-based dimension (defaults to 1) 291 | */ 292 | ubound(dimension?: number): number; 293 | 294 | /** 295 | * Returns a Javascript array with all the elements in the VBArray. If there are multiple dimensions, 296 | * each successive dimension is appended to the end of the array. 297 | * Example: [[1,2,3],[4,5,6]] becomes [1,2,3,4,5,6] 298 | */ 299 | toArray(): T[]; 300 | } 301 | 302 | interface VBArrayConstructor { 303 | new (safeArray: SafeArray): VBArray; 304 | } 305 | 306 | declare var VBArray: VBArrayConstructor; 307 | 308 | /** 309 | * Automation date (VT_DATE) 310 | */ 311 | declare class VarDate { 312 | private constructor(); 313 | private VarDate_typekey: VarDate; 314 | } 315 | 316 | interface DateConstructor { 317 | new (vd: VarDate): Date; 318 | } 319 | 320 | interface Date { 321 | getVarDate: () => VarDate; 322 | } 323 | -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/node_modules/typescript/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "typescript", 3 | "author": "Microsoft Corp.", 4 | "homepage": "http://typescriptlang.org/", 5 | "version": "2.7.1", 6 | "license": "Apache-2.0", 7 | "description": "TypeScript is a language for application scale JavaScript development", 8 | "keywords": [ 9 | "TypeScript", 10 | "Microsoft", 11 | "compiler", 12 | "language", 13 | "javascript" 14 | ], 15 | "bugs": { 16 | "url": "https://github.com/Microsoft/TypeScript/issues" 17 | }, 18 | "repository": { 19 | "type": "git", 20 | "url": "https://github.com/Microsoft/TypeScript.git" 21 | }, 22 | "main": "./lib/typescript.js", 23 | "typings": "./lib/typescript.d.ts", 24 | "bin": { 25 | "tsc": "./bin/tsc", 26 | "tsserver": "./bin/tsserver" 27 | }, 28 | "engines": { 29 | "node": ">=4.2.0" 30 | }, 31 | "devDependencies": { 32 | "@types/browserify": "latest", 33 | "@types/chai": "latest", 34 | "@types/convert-source-map": "latest", 35 | "@types/del": "latest", 36 | "@types/glob": "latest", 37 | "@types/gulp": "3.X", 38 | "@types/gulp-concat": "latest", 39 | "@types/gulp-help": "latest", 40 | "@types/gulp-newer": "latest", 41 | "@types/gulp-sourcemaps": "latest", 42 | "@types/merge2": "latest", 43 | "@types/minimatch": "latest", 44 | "@types/minimist": "latest", 45 | "@types/mkdirp": "latest", 46 | "@types/mocha": "latest", 47 | "@types/node": "8.5.5", 48 | "@types/q": "latest", 49 | "@types/run-sequence": "latest", 50 | "@types/through2": "latest", 51 | "@types/xml2js": "^0.4.0", 52 | "xml2js": "^0.4.19", 53 | "browser-resolve": "^1.11.2", 54 | "browserify": "latest", 55 | "chai": "latest", 56 | "convert-source-map": "latest", 57 | "del": "latest", 58 | "gulp": "3.X", 59 | "gulp-clone": "latest", 60 | "gulp-concat": "latest", 61 | "gulp-help": "latest", 62 | "gulp-insert": "latest", 63 | "gulp-newer": "latest", 64 | "gulp-sourcemaps": "latest", 65 | "gulp-typescript": "latest", 66 | "istanbul": "latest", 67 | "jake": "latest", 68 | "merge2": "latest", 69 | "minimist": "latest", 70 | "mkdirp": "latest", 71 | "mocha": "latest", 72 | "mocha-fivemat-progress-reporter": "latest", 73 | "q": "latest", 74 | "run-sequence": "latest", 75 | "sorcery": "latest", 76 | "source-map-support": "latest", 77 | "through2": "latest", 78 | "travis-fold": "latest", 79 | "ts-node": "latest", 80 | "tslint": "latest", 81 | "vinyl": "latest", 82 | "chalk": "latest", 83 | "typescript": "next" 84 | }, 85 | "scripts": { 86 | "pretest": "jake tests", 87 | "test": "jake runtests-parallel light=false", 88 | "build": "npm run build:compiler && npm run build:tests", 89 | "build:compiler": "jake local", 90 | "build:tests": "jake tests", 91 | "start": "node lib/tsc", 92 | "clean": "jake clean", 93 | "gulp": "gulp", 94 | "jake": "jake", 95 | "lint": "jake lint", 96 | "setup-hooks": "node scripts/link-hooks.js" 97 | }, 98 | "browser": { 99 | "fs": false, 100 | "os": false, 101 | "path": false 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tsswrapper", 3 | "version": "1.1.0", 4 | "description": "tsserver wrapper for tscompletejob.vim", 5 | "main": "tsswrapper.js", 6 | "dependencies": { 7 | "typescript": "2.7.1" 8 | }, 9 | "devDependencies": { 10 | "@types/jest": "^22.1.1", 11 | "@types/node": "^9.4.0", 12 | "@types/tmp": "^0.0.33", 13 | "jest": "^22.2.1", 14 | "tmp": "^0.0.33" 15 | }, 16 | "scripts": { 17 | "test": "echo \"Error: no test specified\" && exit 1" 18 | }, 19 | "author": "runoshun", 20 | "license": "MIT" 21 | } 22 | -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/scripts/extract-tsservers.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | basedir=`dirname $0`; 3 | for f in $(ls $basedir/../testdata/*.xz); do 4 | unxz -k ${f} 5 | done 6 | -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/src/custom_protocol.ts: -------------------------------------------------------------------------------- 1 | import * as proto from "typescript/lib/protocol"; 2 | 3 | export interface CompletionsForVimRequestArgs extends proto.CompletionsRequestArgs { 4 | enableDetail?: boolean; 5 | maxDetailCount?: number; 6 | } 7 | 8 | export interface VimMenuInfo { 9 | menu: string; 10 | info: string; 11 | } 12 | 13 | export interface VimCompletionEntry { 14 | word: string; 15 | kind: string; 16 | menu?: string; 17 | info?: string; 18 | } 19 | 20 | export interface SignatureHelpForVimRequestArgs extends proto.SignatureHelpRequestArgs { 21 | disableDocumentation?: boolean; 22 | onlyMatched?: boolean; 23 | } 24 | 25 | export interface VimQfixlistItem { 26 | lnum: number; 27 | col: number; 28 | text: string; 29 | valid: number; 30 | filename : string; 31 | } 32 | -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/src/tsswrapper.test.ts: -------------------------------------------------------------------------------- 1 | import { Request, Response } from "typescript/lib/protocol"; 2 | import * as proto from "typescript/lib/protocol"; 3 | import * as child_process from "child_process"; 4 | import * as readline from "readline"; 5 | import * as path from "path"; 6 | import * as tmp from "tmp"; 7 | import * as fs from "fs"; 8 | 9 | import { PromisePool } from "./utils"; 10 | import { CompletionsForVimRequestArgs, SignatureHelpForVimRequestArgs } from "./custom_protocol"; 11 | 12 | const testData = (file: string) => { 13 | return path.join(__dirname, "..", "testdata", file); 14 | } 15 | 16 | let seq = 0; 17 | const sendCommand = (promises: PromisePool, proc: child_process.ChildProcess, command: string, args: any): Promise => { 18 | let req: Request = { 19 | type: "request", 20 | command: command.toString(), 21 | arguments: args, 22 | seq: seq++ 23 | }; 24 | let promise = promises.prepare(req.seq); 25 | proc.stdin.write(JSON.stringify(req) + "\r\n"); 26 | return promise; 27 | } 28 | 29 | let procs: child_process.ChildProcess[] = []; 30 | let inspectPort = 9229; 31 | 32 | const runTests = (tsserverjs: string) => { 33 | 34 | let proc: child_process.ChildProcess; 35 | 36 | beforeAll(() => { 37 | let tsswrapper = path.join(__dirname, "tsswrapper.js"); 38 | let args: string[] = ["-e", "require('" + tsswrapper + "').start('" + tsserverjs + "')"]; 39 | if (process.env.NODE_ENV === "inspect") { 40 | args.unshift("--inspect=" + inspectPort++, "--inspect-brk") 41 | } 42 | proc = child_process.spawn(process.execPath, args, { 43 | stdio: ["pipe", "pipe", "pipe"] 44 | }); 45 | procs.push(proc); 46 | 47 | proc.stderr.on("readable", () => { 48 | let buf = proc.stderr.read(); 49 | if (buf) { 50 | console.error("[err on tsswrapper]: ", buf.toString()); 51 | } 52 | }); 53 | 54 | let rl = readline.createInterface({ 55 | input: proc.stdout, 56 | output: proc.stdin, 57 | terminal: false 58 | }); 59 | 60 | 61 | rl.on("line", (line) => { 62 | try { 63 | let message = line.trim(); 64 | if (message && !message.match(/^Content-Length:/)) { 65 | let res: Response = JSON.parse(message); 66 | promises.resolve(res.request_seq, res); 67 | } 68 | } catch(e) { 69 | console.error("can't handle response", line, e); 70 | } 71 | }); 72 | 73 | }) 74 | 75 | let promises = new PromisePool(); 76 | let send = (cmd: string, args: any) => sendCommand(promises, proc, cmd, args); 77 | 78 | const reload = (filename: string) => { 79 | let file = testData(filename); 80 | let tmpfile = tmp.tmpNameSync(); 81 | fs.writeFileSync(tmpfile, fs.readFileSync(file)); 82 | let args: proto.ReloadRequestArgs = { 83 | file, 84 | tmpfile, 85 | } 86 | return send("reload", args); 87 | } 88 | 89 | const open = (file: string) => { 90 | let args: proto.OpenRequestArgs = { 91 | file: testData(file), 92 | } 93 | send("open", args); 94 | return reload(file); 95 | } 96 | 97 | it("should return error response", async (done) => { 98 | let res = await send("dummy", {}); 99 | 100 | expect(res).toEqual(expect.anything()); 101 | expect(res.type).toBe("response"); 102 | expect(res).toHaveProperty("success") 103 | done(); 104 | }); 105 | 106 | it("should return success for reload request", async (done) => { 107 | open("sample1.ts"); 108 | let res = await reload("sample1.ts"); 109 | 110 | expect(res).not.toBeUndefined(); 111 | expect(res.success).toBeTruthy(); 112 | done(); 113 | }); 114 | 115 | it("should return completions without details", async (done) => { 116 | open("sample1.ts"); 117 | let args: CompletionsForVimRequestArgs = { 118 | file: testData("sample1.ts"), 119 | line: 27, 120 | offset: 4, 121 | prefix: "m", 122 | enableDetail: false, 123 | includeExternalModuleExports: false, 124 | includeInsertTextCompletions: false, 125 | } 126 | let res = await send("completionsForVim", args); 127 | 128 | expect(res).not.toBeUndefined(); 129 | expect(res.success).toBeTruthy(); 130 | expect(res.body).toHaveLength(3); 131 | let completion = res.body[0]; 132 | expect(completion).toHaveProperty("word") 133 | expect(completion).toHaveProperty("kind") 134 | expect(completion).not.toHaveProperty("info") 135 | expect(completion).not.toHaveProperty("menu") 136 | 137 | done(); 138 | }); 139 | 140 | it("should return completions with details", async (done) => { 141 | open("sample1.ts"); 142 | let args: CompletionsForVimRequestArgs = { 143 | file: testData("sample1.ts"), 144 | line: 27, 145 | offset: 4, 146 | enableDetail: true, 147 | includeExternalModuleExports: false, 148 | includeInsertTextCompletions: false, 149 | } 150 | let res = await send("completionsForVim", args); 151 | 152 | expect(res).not.toBeUndefined(); 153 | expect(res.success).toBeTruthy(); 154 | expect(res.body).toHaveLength(3); 155 | let completion = res.body[0]; 156 | expect(completion).toHaveProperty("menu") 157 | expect(completion).toHaveProperty("word") 158 | expect(completion).toHaveProperty("kind") 159 | expect(completion).toHaveProperty("info") 160 | 161 | done(); 162 | }); 163 | 164 | it("should return signatureHelp with documentation", async (done) => { 165 | open("sample1.ts"); 166 | let args: SignatureHelpForVimRequestArgs = { 167 | file: testData("sample1.ts"), 168 | line: 29, 169 | offset: 11, 170 | disableDocumentation: false, 171 | onlyMatched: true, 172 | } 173 | let res = await send("signatureHelpForVim", args); 174 | 175 | expect(res).not.toBeUndefined(); 176 | expect(res.success).toBeTruthy(); 177 | expect(res.body).toHaveLength(2); 178 | 179 | let help = res.body[0]; 180 | expect(help).toHaveProperty("abbr"); 181 | expect(help).toHaveProperty("dup"); 182 | expect(help).toHaveProperty("empty"); 183 | expect(help).toHaveProperty("word"); 184 | expect(help).toHaveProperty("info"); 185 | 186 | done(); 187 | }) 188 | 189 | it("should return signatureHelp without documentation", async (done) => { 190 | open("sample1.ts"); 191 | let args: SignatureHelpForVimRequestArgs = { 192 | file: testData("sample1.ts"), 193 | line: 29, 194 | offset: 11, 195 | disableDocumentation: true, 196 | onlyMatched: true, 197 | } 198 | let res = await send("signatureHelpForVim", args); 199 | 200 | expect(res).not.toBeUndefined(); 201 | expect(res.success).toBeTruthy(); 202 | expect(res.body).toHaveLength(2); 203 | 204 | let help = res.body[0]; 205 | expect(help).toHaveProperty("abbr"); 206 | expect(help).toHaveProperty("dup"); 207 | expect(help).toHaveProperty("empty"); 208 | expect(help).toHaveProperty("word"); 209 | expect(help).not.toHaveProperty("info"); 210 | 211 | done(); 212 | }); 213 | 214 | it("should return qfixlist", async (done) => { 215 | open("errors.ts"); 216 | let args: proto.SyntacticDiagnosticsSyncRequestArgs = { 217 | file: testData("errors.ts"), 218 | includeLinePosition: true 219 | }; 220 | 221 | let res = await send("qfixlistForVim", args); 222 | expect(res).not.toBeUndefined(); 223 | expect(res.success).toBeTruthy(); 224 | expect(res.body).toHaveLength(3); 225 | 226 | let args2: proto.SyntacticDiagnosticsSyncRequestArgs = { 227 | file: testData("errors.ts"), 228 | includeLinePosition: false, 229 | }; 230 | 231 | let res2 = await send("qfixlistForVim", args2); 232 | expect(res2).not.toBeUndefined(); 233 | expect(res2.success).toBeTruthy(); 234 | expect(res2.body).toHaveLength(3); 235 | 236 | done(); 237 | }); 238 | 239 | it("should return references", async (done) => { 240 | open("sample1.ts"); 241 | let args: proto.ReferencesRequest["arguments"] = { 242 | file: testData("sample1.ts"), 243 | line: 6, 244 | offset: 7, 245 | }; 246 | 247 | let res = await send("referencesForVim", args); 248 | 249 | expect(res).not.toBeUndefined(); 250 | expect(res.success).toBeTruthy(); 251 | expect(res.body).toHaveLength(3); 252 | done() 253 | }); 254 | 255 | it("should return codefix", async (done) => { 256 | jest.setTimeout(10000000) 257 | open("codefix.ts"); 258 | let args: proto.ReferencesRequest["arguments"] = { 259 | file: testData("codefix.ts"), 260 | line: 6, 261 | offset: 7, 262 | }; 263 | 264 | let res = await send("codeFixAtPositionForVim", args); 265 | 266 | expect(res).not.toBeUndefined(); 267 | expect(res.success).toBeTruthy(); 268 | expect(res.body).toHaveLength(1); 269 | done(); 270 | }); 271 | } 272 | 273 | //describe("tests for typescript 2.0.10", () => { 274 | // runTests(testData("tsserver2010.js")); 275 | //}); 276 | // 277 | //describe("tests for typescript 2.1.6", () => { 278 | // runTests(testData("tsserver216.js")); 279 | //}); 280 | 281 | describe("tests for typescript 2.2.0", () => { 282 | runTests(testData("tsserver220.js")); 283 | }); 284 | 285 | describe("tests for typescript 2.3.4", () => { 286 | runTests(testData("tsserver234.js")); 287 | }); 288 | 289 | describe("tests for typescript 2.4.2", () => { 290 | runTests(testData("tsserver242.js")); 291 | }); 292 | 293 | describe("tests for typescript 2.5.3", () => { 294 | runTests(testData("tsserver253.js")); 295 | }); 296 | 297 | describe("tests for typescript 2.6.2", () => { 298 | runTests(testData("tsserver262.js")); 299 | }); 300 | 301 | describe("tests for typescript 2.7.1", () => { 302 | runTests(testData("tsserver271.js")); 303 | }); 304 | 305 | afterAll(() => { 306 | procs.forEach(proc => proc.kill()); 307 | }) 308 | -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/src/tsswrapper.ts: -------------------------------------------------------------------------------- 1 | import * as childProcess from "child_process"; 2 | import * as os from "os" 3 | import * as readline from "readline"; 4 | import * as proto from "typescript/lib/protocol"; 5 | import { Request, Response } from "typescript/lib/protocol"; 6 | 7 | import { 8 | CompletionsForVimRequestArgs, VimCompletionEntry, 9 | VimMenuInfo, SignatureHelpForVimRequestArgs, 10 | VimQfixlistItem 11 | } from "./custom_protocol"; 12 | 13 | import { PromisePool } from "./utils"; 14 | 15 | export const start = (tsserverjs?: string) => { 16 | let tsserver = tsserverjs; 17 | if (!tsserver) { 18 | tsserver = __dirname + "/../node_modules/typescript/lib/tsserver.js"; 19 | } 20 | new WrapperServer(tsserver); 21 | 22 | } 23 | 24 | const debug = (...args: any[]) => { 25 | if (process.env.NODE_ENV === "debug") { 26 | console.warn.apply(console, args); 27 | } 28 | } 29 | 30 | const noResponseCommands = [ 31 | "open", 32 | ]; 33 | 34 | class WrapperServer { 35 | private handlers: { [command: string]: (req: Request) => Promise } = {}; 36 | private resPromises: PromisePool = new PromisePool(); 37 | private tsserver: childProcess.ChildProcess; 38 | private seq = 1000000; 39 | private rl: readline.ReadLine; 40 | 41 | constructor(tsserverjs: string) { 42 | this.rl = readline.createInterface({ 43 | input: process.stdin, 44 | output: process.stdout, 45 | terminal: false, 46 | }); 47 | this.tsserver = this.startTsServer(tsserverjs); 48 | this.listenClient(); 49 | this.initProtocolHandlers(); 50 | } 51 | 52 | private listenClient = () => { 53 | this.rl.on("line", (input) => { 54 | this.onMessageFromClient(input.trim()); 55 | }); 56 | this.rl.on("close", () => { 57 | setTimeout(() => process.exit(0), 1000); 58 | }); 59 | } 60 | 61 | private onMessageFromClient = async (message: string) => { 62 | debug("[client] > ", message); 63 | try { 64 | let req: Request = JSON.parse(message); 65 | try { 66 | let res: any = await this.handleRequestFromClient(req); 67 | if (res) { 68 | this.outputToClient(res, req.command, req.seq, undefined) 69 | } 70 | } catch (e) { 71 | debug(e); 72 | this.outputToClient(undefined, req.command, req.seq, e.message); 73 | } 74 | } catch (e) { 75 | debug(e); 76 | this.outputToClient(undefined, "error", 0, "invalid request"); 77 | } 78 | } 79 | 80 | private handleRequestFromClient = (req: Request) => { 81 | let cmd = req.command; 82 | let customHandler = this.handlers[cmd]; 83 | if (customHandler) { 84 | return customHandler(req); 85 | } else { 86 | return this.pipeClientReqToTsServer(req); 87 | } 88 | } 89 | 90 | private outputToClient = (info: any, cmdName: string, reqSeq: number, errorMsg?: string) => { 91 | if (reqSeq === void 0) { reqSeq = 0; } 92 | var res: Response = { 93 | seq: 0, 94 | type: "response", 95 | command: cmdName, 96 | request_seq: reqSeq, 97 | success: !errorMsg, 98 | }; 99 | if (!errorMsg) { 100 | res.body = info; 101 | } 102 | else { 103 | res.message = errorMsg; 104 | } 105 | debug("[client] < ", JSON.stringify(res)); 106 | process.stdout.write(this.formatResponse(res)) 107 | }; 108 | 109 | private formatResponse = function(msg: Response) { 110 | var json = JSON.stringify(msg); 111 | var len = Buffer.byteLength(json, "utf8"); 112 | return ("Content-Length: " + (1 + len) + "\r\n\r\n" + json + os.EOL); 113 | } 114 | 115 | private startTsServer = (tsserverjs: string) => { 116 | let tsserver = childProcess.spawn(process.execPath, [tsserverjs], { stdio: ["pipe", "pipe", "pipe"] }); 117 | let rl = readline.createInterface({ 118 | input: tsserver.stdout, 119 | output: tsserver.stdin, 120 | terminal: false, 121 | }); 122 | rl.on("line", (input) => { 123 | debug("[tss] > ", input); 124 | let message = input.trim(); 125 | if (message && !message.match(/^Content-Length:/)) { 126 | let res: Response = JSON.parse(input); 127 | if (res.type === "response") { 128 | this.resPromises.resolve(res.request_seq, res); 129 | } else { 130 | debug("input is not response, ", res); 131 | } 132 | } 133 | }); 134 | rl.on("close", () => { 135 | debug("tsserver stdout is closed"); 136 | process.exit(0); 137 | }) 138 | return tsserver; 139 | } 140 | 141 | private pipeClientReqToTsServer = async (req: Request) => { 142 | debug("[tss] < ", JSON.stringify(req)); 143 | if (noResponseCommands.some(c => c === req.command)) { 144 | this.tsserver.stdin.write(JSON.stringify(req) + "\r\n"); 145 | } else { 146 | let promise = this.resPromises.prepare(req.seq); 147 | this.tsserver.stdin.write(JSON.stringify(req) + "\r\n"); 148 | 149 | let res = await promise 150 | let fres = this.formatResponse(res); 151 | debug("[client] < ", fres); 152 | process.stdout.write(fres); 153 | } 154 | } 155 | 156 | private requestToTsServer = (command: proto.CommandTypes, args: any): Promise => { 157 | let req: Request = { 158 | type: "request", 159 | command: command.toString(), 160 | arguments: args, 161 | seq: this.seq++ 162 | }; 163 | let promise = this.resPromises.prepare(req.seq); 164 | debug("[tss] < ", JSON.stringify(req)); 165 | this.tsserver.stdin.write(JSON.stringify(req) + "\r\n"); 166 | return promise; 167 | } 168 | 169 | /// =============================== custom protocol handlers =================================== 170 | 171 | private initProtocolHandlers = () => { 172 | 173 | const buildDocumentation = (dispParts: proto.SymbolDisplayPart[], docs: proto.SymbolDisplayPart[]): VimMenuInfo | undefined => { 174 | if(!dispParts && !docs) { 175 | return undefined; 176 | } 177 | 178 | let menu: string = ""; 179 | if (dispParts) { 180 | menu = dispParts.reduce((s: string, part: proto.SymbolDisplayPart) => { 181 | if (part.kind != "lineBreak") { 182 | s += part.text; 183 | } 184 | return s; 185 | }, ""); 186 | menu = menu.replace(/\(\w+\)\s*/, ""); 187 | } 188 | 189 | let info: string = ""; 190 | if (docs) { 191 | info = docs.reduce((s: string, doc: proto.SymbolDisplayPart) => { 192 | s += "\n" + doc.text; 193 | return s; 194 | }, menu); 195 | } 196 | 197 | return { menu, info }; 198 | }; 199 | 200 | this.handlers["completionsForVim"] = async (req: Request) => { 201 | let args: CompletionsForVimRequestArgs = req.arguments; 202 | if (!args) { 203 | throw new Error("invalid args"); 204 | } 205 | let res: proto.CompletionsResponse = await this.requestToTsServer( 206 | proto.CommandTypes.Completions, 207 | args 208 | ); 209 | let completions = res.body || []; 210 | let enableDetail = args.enableDetail && completions.length < (args.maxDetailCount || Number.MAX_SAFE_INTEGER); 211 | 212 | let detailsMap: { [name: string]: VimMenuInfo | undefined } = {}; 213 | if (enableDetail) { 214 | let entryNames = completions.map(item => item.name); 215 | let detail_args: proto.CompletionDetailsRequestArgs = { 216 | line: args.line, 217 | offset: args.offset, 218 | file: args.file, 219 | entryNames: entryNames, 220 | }; 221 | let res: proto.CompletionDetailsResponse = await this.requestToTsServer( 222 | proto.CommandTypes.CompletionDetails, 223 | detail_args 224 | ) 225 | let details = res.body || []; 226 | details.forEach(item => { 227 | detailsMap[item.name] = buildDocumentation(item.displayParts, item.documentation) 228 | }) 229 | } 230 | 231 | let entries: VimCompletionEntry[] = completions.map((item) => { 232 | let entry: VimCompletionEntry = { 233 | word: item.name, 234 | kind: enableDetail ? item.kind.toString().substr(0,1) : item.kind.toString() 235 | }; 236 | let details = detailsMap[item.name]; 237 | if (details) { 238 | entry.menu = details.menu; 239 | entry.info = details.info; 240 | } 241 | return entry; 242 | }); 243 | 244 | return entries; 245 | } 246 | 247 | const appendDisplayText = (s: string, displayPart: proto.SymbolDisplayPart) => { 248 | return s + displayPart.text; 249 | } 250 | 251 | const buildSignatureHelp = (disableDocumentation: boolean) => { 252 | return (item: proto.SignatureHelpItem) => { 253 | let prefix = item.prefixDisplayParts.reduce(appendDisplayText, ""); 254 | let suffix = item.suffixDisplayParts.reduce(appendDisplayText, ""); 255 | let separator = item.separatorDisplayParts.reduce(appendDisplayText, ""); 256 | 257 | let abbrs: string[] = []; 258 | let docs: string[] = [] 259 | item.parameters.forEach(param => { 260 | let dispText = param.displayParts.reduce(appendDisplayText, ""); 261 | let docText = param.documentation.reduce(appendDisplayText, ""); 262 | abbrs.push(dispText); 263 | docs.push(docText ? param.name + ": " + docText : ""); 264 | }); 265 | 266 | var sigDoc = item.documentation.reduce(appendDisplayText, ""); 267 | 268 | var abbr = prefix + abbrs.join(separator) + suffix; 269 | var info = (sigDoc + "\n" + docs.join("\n")).trim(); 270 | 271 | return { 272 | word: "", 273 | abbr: abbr, 274 | empty: true, 275 | info: disableDocumentation === true ? undefined : info, 276 | dup: true, 277 | }; 278 | } 279 | }; 280 | 281 | this.handlers["signatureHelpForVim"] = async (req) => { 282 | let args: SignatureHelpForVimRequestArgs = req.arguments; 283 | let res: proto.SignatureHelpResponse = await this.requestToTsServer( 284 | proto.CommandTypes.SignatureHelp, 285 | args 286 | ); 287 | let help = res.body; 288 | if (!help || !help.items || help.items.length == 0) { 289 | return { response: "", responseRequired: true }; 290 | } 291 | 292 | let onlyMatched = args.onlyMatched !== false; 293 | let items = help.items; 294 | if (onlyMatched) { 295 | var argCount = help.argumentCount; 296 | items = items.filter(function(item) { return item.parameters.length >= argCount; }); 297 | } 298 | var helps = items.map(buildSignatureHelp(!!args.disableDocumentation)); 299 | return helps; 300 | }; 301 | 302 | 303 | this.handlers["qfixlistForVim"] = async (req) => { 304 | let args = req.arguments; 305 | 306 | let resSyntacticDiagnostics: proto.SyntacticDiagnosticsSyncResponse = await this.requestToTsServer( 307 | proto.CommandTypes.SyntacticDiagnosticsSync, 308 | args 309 | ); 310 | let resSemanticDiagnostics: proto.SemanticDiagnosticsSyncResponse = await this.requestToTsServer( 311 | proto.CommandTypes.SemanticDiagnosticsSync, 312 | args, 313 | ); 314 | 315 | let diags: (proto.Diagnostic | proto.DiagnosticWithLinePosition)[] = resSyntacticDiagnostics.body || []; 316 | diags.unshift.apply(diags, resSemanticDiagnostics.body || []); 317 | 318 | let qfixlist = diags.map((diag) => { 319 | let dstart = (diag as proto.DiagnosticWithLinePosition).startLocation || diag.start; 320 | let text = (diag as proto.DiagnosticWithLinePosition).message || (diag as proto.Diagnostic).text; 321 | 322 | let result: VimQfixlistItem = { 323 | lnum: dstart.line, 324 | col: dstart.offset, 325 | text: text, 326 | valid: 1, 327 | filename: (args.file as string), 328 | }; 329 | return result; 330 | }); 331 | 332 | return qfixlist; 333 | }; 334 | 335 | this.handlers["referencesForVim"] = async (req) => { 336 | let args = req.arguments; 337 | let res: proto.ReferencesResponse = await this.requestToTsServer( 338 | proto.CommandTypes.References, 339 | args 340 | ); 341 | let refs = res.body; 342 | if (refs) { 343 | let items = refs.refs.sort((i1, i2) => (i2.isDefinition ? 1 : 0) - (i1.isDefinition ? 1: 0)); 344 | var loclist = items.map((item) => { 345 | return item.file + ":" + item.start.line + ":" + item.start.offset + ":" + item.lineText; 346 | }); 347 | return loclist; 348 | } 349 | else { 350 | return []; 351 | } 352 | }; 353 | 354 | this.handlers["codeFixAtPositionForVim"] = async (req) => { 355 | debugger; 356 | let args: proto.SemanticDiagnosticsSyncRequestArgs = req.arguments; 357 | 358 | let resCodefixes: proto.GetSupportedCodeFixesResponse = await this.requestToTsServer( 359 | proto.CommandTypes.GetSupportedCodeFixes, 360 | {}, 361 | ); 362 | let resDiags: proto.SemanticDiagnosticsSyncResponse = await this.requestToTsServer( 363 | proto.CommandTypes.SemanticDiagnosticsSync, 364 | args 365 | ); 366 | let codefixes = resCodefixes.body || []; 367 | let diags = resDiags.body || []; 368 | 369 | if (diags.length > 0) { 370 | let diag = diags[0]; 371 | if (diag.code && codefixes.indexOf(diag.code.toString()) != -1) { 372 | let dstart = (diag as proto.DiagnosticWithLinePosition).startLocation || diag.start; 373 | let dend = (diag as proto.DiagnosticWithLinePosition).endLocation || (diag as proto.Diagnostic).end; 374 | let cfArgs: proto.CodeFixRequestArgs = { 375 | file: args.file, 376 | errorCodes: [diag.code], 377 | startLine: dstart.line, 378 | startOffset: dstart.offset, 379 | endLine: dend.line, 380 | endOffset: dend.offset, 381 | }; 382 | let res = await this.requestToTsServer( 383 | proto.CommandTypes.GetCodeFixes, 384 | cfArgs 385 | ); 386 | return res.body; 387 | } 388 | } 389 | 390 | return []; 391 | }; 392 | 393 | } 394 | } 395 | 396 | -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/src/utils.ts: -------------------------------------------------------------------------------- 1 | interface Promises { 2 | [seq: number]: { 3 | promise: Promise; 4 | resolve?: (value: T) => void; 5 | reject?: (err: any) => void, 6 | createdAt: number, 7 | } 8 | } 9 | 10 | export class PromisePool { 11 | 12 | private promises: Promises = {}; 13 | 14 | constructor() { 15 | this.prepareDefault(); 16 | setInterval(() => { 17 | this.cleanup() 18 | }, 60 * 1000); 19 | } 20 | 21 | public prepare(seq: number): Promise { 22 | this.promises[seq] = { createAt: Date.now() } as any; 23 | let promise = new Promise((res, rej) => { 24 | let obj = this.promises[seq]; 25 | obj.resolve = res; 26 | obj.reject = rej 27 | }); 28 | this.promises[seq].promise = promise; 29 | return promise; 30 | } 31 | 32 | public prepareDefault(): Promise { 33 | return this.prepare(Number.MAX_SAFE_INTEGER); 34 | } 35 | 36 | private get defaultPromise() { 37 | return this.promises[Number.MAX_SAFE_INTEGER]; 38 | } 39 | 40 | public resolve(seq: number, value: T): void { 41 | let p = this.promises[seq]; 42 | if (p && p.resolve) { 43 | p.resolve(value); 44 | } else { 45 | console.warn(`no such seq '${seq}'. using default, value: `, value); 46 | this.defaultPromise.resolve && this.defaultPromise.resolve(value); 47 | } 48 | } 49 | 50 | public reject(seq: number, err: any): void { 51 | let p = this.promises[seq]; 52 | if (p && p.reject) { 53 | p.reject(err); 54 | } else { 55 | console.warn(`no such seq '${seq}'.`) 56 | this.defaultPromise.reject && this.defaultPromise.reject(err); 57 | } 58 | } 59 | 60 | private cleanup(): void { 61 | let now = Date.now(); 62 | Object.keys(this.promises).forEach((key: string) => { 63 | let seq = parseInt(key); 64 | if (this.promises[seq].createdAt - 5 * 60 * 1000 > now) { 65 | delete this.promises[seq]; 66 | } 67 | }) 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/testdata/codefix.ts: -------------------------------------------------------------------------------- 1 | 2 | abstract class Greeter { 3 | abstract greet(): String; 4 | } 5 | 6 | class Person extends Greeter { 7 | } 8 | -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/testdata/errors.ts: -------------------------------------------------------------------------------- 1 | let a: number = "string"; 2 | let s: string = 1; 3 | 4 | function foo() { 5 | -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/testdata/mod.ts: -------------------------------------------------------------------------------- 1 | 2 | export function foo() { 3 | bar() 4 | } 5 | 6 | export function bar() { 7 | } 8 | -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/testdata/sample1.ts: -------------------------------------------------------------------------------- 1 | interface A { 2 | foo: string; 3 | bar: number; 4 | } 5 | 6 | class C { 7 | private n: number; 8 | public m: Date; 9 | 10 | public meth(x: number, y: number): number { 11 | return x + y 12 | } 13 | } 14 | 15 | class D extends C { 16 | 17 | public meth2(z: string); 18 | public meth2(z: string, z2:string); 19 | public meth2(z: string, z2?:string) { 20 | console.log(z); 21 | } 22 | } 23 | 24 | let c = new C(); 25 | let d = new D(); 26 | 27 | d.m 28 | 29 | d.meth2("hello") 30 | 31 | import { foo, bar } from "./mod"; 32 | foo() 33 | -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/testdata/tsconfig.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/testdata/tsserver2010.js.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runoshun/tscompletejob/e94fe93bc10c307bdbc7ad9f988fd47bbce76b58/autoload/tscompletejob/tsswrapper/testdata/tsserver2010.js.xz -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/testdata/tsserver216.js.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runoshun/tscompletejob/e94fe93bc10c307bdbc7ad9f988fd47bbce76b58/autoload/tscompletejob/tsswrapper/testdata/tsserver216.js.xz -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/testdata/tsserver220.js.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runoshun/tscompletejob/e94fe93bc10c307bdbc7ad9f988fd47bbce76b58/autoload/tscompletejob/tsswrapper/testdata/tsserver220.js.xz -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/testdata/tsserver234.js.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runoshun/tscompletejob/e94fe93bc10c307bdbc7ad9f988fd47bbce76b58/autoload/tscompletejob/tsswrapper/testdata/tsserver234.js.xz -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/testdata/tsserver242.js.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runoshun/tscompletejob/e94fe93bc10c307bdbc7ad9f988fd47bbce76b58/autoload/tscompletejob/tsswrapper/testdata/tsserver242.js.xz -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/testdata/tsserver253.js.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runoshun/tscompletejob/e94fe93bc10c307bdbc7ad9f988fd47bbce76b58/autoload/tscompletejob/tsswrapper/testdata/tsserver253.js.xz -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/testdata/tsserver262.js.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runoshun/tscompletejob/e94fe93bc10c307bdbc7ad9f988fd47bbce76b58/autoload/tscompletejob/tsswrapper/testdata/tsserver262.js.xz -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/testdata/tsserver271.js.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/runoshun/tscompletejob/e94fe93bc10c307bdbc7ad9f988fd47bbce76b58/autoload/tscompletejob/tsswrapper/testdata/tsserver271.js.xz -------------------------------------------------------------------------------- /autoload/tscompletejob/tsswrapper/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es6", 4 | "module": "commonjs", 5 | "outDir": "./lib", 6 | "inlineSourceMap": true, 7 | "strict": true, 8 | "noImplicitAny": true, 9 | "strictNullChecks": true, 10 | "strictFunctionTypes": true, 11 | "strictPropertyInitialization": true, 12 | "noImplicitThis": true, 13 | "alwaysStrict": true, 14 | "noUnusedLocals": true, 15 | "noUnusedParameters": true, 16 | "noImplicitReturns": true, 17 | "noFallthroughCasesInSwitch": true 18 | }, 19 | "exclude": [ 20 | "testdata/**/*" 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /autoload/tscompletejob/utils.vim: -------------------------------------------------------------------------------- 1 | let s:save_cpo = &cpo 2 | set cpo&vim 3 | 4 | func! tscompletejob#utils#log(msg) abort 5 | if (g:tscompletejob__debug__) 6 | echom "[tsj]: " . a:msg 7 | endif 8 | endfunc 9 | 10 | let s:rel_tags = { } 11 | 12 | func! tscompletejob#utils#perf_start(tag) abort 13 | if (g:tscompletejob__preflog__) 14 | let s:rel_tags[a:tag] = reltime() 15 | echom "[tsj] " . a:tag 16 | endif 17 | endfunc 18 | 19 | func! tscompletejob#utils#perf_log(tag, msg) abort 20 | if (g:tscompletejob__preflog__ && has_key(s:rel_tags, a:tag)) 21 | let id = s:rel_tags[a:tag] 22 | echom "[tsj] " . reltimestr(reltime(id)) . " " . a:tag . " " . a:msg 23 | endif 24 | endfunc 25 | 26 | func! tscompletejob#utils#perf_clear(tag) abort 27 | if (g:tscompletejob__preflog__ && has_key(s:rel_tags, a:tag)) 28 | unlet s:rel_tags[a:tag] 29 | endif 30 | endfunc 31 | 32 | func! tscompletejob#utils#is_same_file(f1, f2) 33 | let f1 = substitute(a:f1, "\\", "/", "g") 34 | let f2 = substitute(a:f2, "\\", "/", "g") 35 | return f1 == f2 36 | endfunc 37 | 38 | func! tscompletejob#utils#getconfig(name, default) 39 | return exists(a:name) ? eval(a:name) : a:default 40 | endfunc 41 | 42 | let s:pathsep = fnamemodify(".", ":p")[-1:] 43 | 44 | func! tscompletejob#utils#join_path(p1,p2) 45 | return a:p1 . s:pathsep . a:p2 46 | endfunc 47 | 48 | 49 | if has("win32") || has("win64") 50 | func! tscompletejob#utils#is_abspath(path) 51 | return a:path =~? '^[a-z]:[/\\]' 52 | endfunc 53 | else 54 | func! tscompletejob#utils#is_abspath(path) 55 | return a:path[0] ==# "/" 56 | endfunc 57 | endif 58 | 59 | func! tscompletejob#utils#is_remote_file(path) 60 | if a:path =~# '^\w\+::' || a:path =~# '^\w\+://' 61 | return 1 62 | else 63 | return 0 64 | endif 65 | endfunc 66 | 67 | func! tscompletejob#utils#abspath(path) 68 | if tscompletejob#utils#is_abspath(a:path) || tscompletejob#utils#is_remote_file(a:path) 69 | return a:path 70 | else 71 | return filereadable(a:path) ? 72 | \ fnamemodify(a:path, ":p") : 73 | \ tscompletejob#utils#join_path(fnamemodify(getcwd(), ":p"), a:path) 74 | endif 75 | endfunc 76 | 77 | func! tscompletejob#utils#is_buf_exists(path) 78 | return bufnr(tscompletejob#utils#abspath(a:path)) != -1 79 | endfunc 80 | 81 | func! tscompletejob#utils#echo_warn(msg) 82 | echohl WarningMsg | echo a:msg | echohl None 83 | endfunc 84 | 85 | 86 | let &cpo = s:save_cpo 87 | unlet s:save_cpo 88 | -------------------------------------------------------------------------------- /doc/tscompletejob.jax: -------------------------------------------------------------------------------- 1 | *tscompletejob.jax* typescript補完用Vimプラグイン. 2 | 3 | ============================================================================ 4 | Author: runoshun *tscompletejob-author* 5 | License: MIT (see |tscompletejob-license|) 6 | ============================================================================ 7 | 8 | CONTENTS *tscompletejob-contents* 9 | 10 | |tscompletejob-introduction|....................................概要 11 | |tscompletejob-commands|........................................コマンド 12 | |tscompletejob-settings|........................................設定 13 | |tscompletejob-mappings|........................................キーマップ 14 | 15 | {Incompatible with Vi} 16 | 17 | ============================================================================ 18 | 19 | INTRODUCTION *tscompletejob* 20 | *tscompletejob-introduction* 21 | 22 | tscompletejob-vimはtsserverのvim用ラッパーを使ったtypescript補完用Vimプラグ 23 | インです。高速に動作することを目標に作成されています。コード補完以外に 24 | tsserverを利用した定義へのジャンプ、変数情報表示、シグネチャ情報表示、コン 25 | パイルエラー表示、リネーム、コードフォーマット、参照一覧表示に対応しています。 26 | 27 | ============================================================================ 28 | 29 | COMMANDS *tscompletejob-commands* 30 | 31 | *TsCompleteJobRestart* 32 | :TsCompleteJobRestart 33 | tsserverラッパーを実行しているjobを再起動させます。jobがすでに 34 | 実行中であれば停止してから起動します。 35 | 36 | *TsCompleteJobStatus* 37 | :TsCompleteJobStatus 38 | tsserverラッパーを実行しているjobのステータスを表示します。jobが 39 | 起動済みであれば、|job_status()|の値が表示され、未起動の場合は 40 | "not started"が表示されます。 41 | 42 | *TsCompleteJobGotoDefinition* 43 | :TsCompleteJobGotoDefinition 44 | カーソル下のシンボルの定義箇所に移動します。定義が異なるファイル 45 | に存在する場合には、該当のファイルを開いた上で移動します。 46 | 47 | *TsCompleteJobGotoPrev* 48 | :TsCompleteJobGotoPrev 49 | |TsCompleteJobGotoDefinition|で移動した履歴に沿って1つ前の位置に 50 | カーソルを移動させます。利用するためには 51 | |tscompletejob_enable_tagstack|を1に設定する必要があります。 52 | 53 | *TsCompleteJobGotoNext* 54 | :TsCompleteJobGotoNext 55 | |TsCompleteJobGotoDefinition|で移動した履歴に沿って1つ次の位置に 56 | カーソルを移動させます。利用するためには 57 | |tscompletejob_enable_tagstack|を1に設定する必要があります。 58 | 59 | *TsCompleteJobQuickInfo* 60 | :TsCompleteJobQuickInfo 61 | カーソル下のシンボルの定義情報をコマンドラインに表示します。 62 | 63 | *TsCompleteJobReferences* 64 | :TsCompleteJobReferences 65 | カーソル下のシンボルを参照している箇所をロケーションリストに表示 66 | します。 67 | 68 | *TsCompleteJobRename* 69 | :TsCompleteJobRename 70 | カーソル下のシンボルを参照箇所も含めてリネームします。複数ファイ 71 | ルで参照されている場合は、バッファにファイルを開いてリネームが行 72 | われます。 73 | 74 | *TsCompleteJobFormat* 75 | :[range]TsCompleteJobFormat 76 | ファイルのフォーマットを行います。範囲指定しない場合はファイル全 77 | 体が対象となります。 78 | 79 | *TsCompleteJobCodeFix* 80 | :[range]TsCompleteJobCodeFix 81 | 現在のカーソル位置でコードフィックスを実行します。 82 | 83 | ============================================================================ 84 | 85 | SETTINGS *tscompletejob-settings* 86 | 87 | 設定値の説明は下記のフォーマットで記載されています。 88 | = 89 | 90 | *g:tscompletejob_node_cmd* 91 | g:tscompletejob_node_cmd = "node" 92 | tsserverラッパーを実行する際に利用するnodejsコマンド 93 | 94 | *g:tscompletejob_custom_tsserverlibrary* 95 | g:tscompletejob_custom_tsserverlibrary = (undefined) 96 | (非推奨) 97 | typescript 2.3以上を利用する場合は|g:tscompletejob_custom_tsserver| 98 | を利用してください。 99 | 100 | カスタムtsserverlibrary.jsのパス。プラグイン同梱とは異なるバージ 101 | ョンのtypescriptを利用する場合に指定します。tsserverlibrary.jsは 102 | typescript2.0以上に同梱されており、" 103 | /lib/tsserverlibrary.js"に格納されています。 104 | 105 | *g:tscompletejob_custom_tsserver* 106 | g:tscompletejob_custom_tsserver = (undefined) 107 | カスタムtsserver.jsのパス。プラグイン同梱とは異なるバージ ョンの 108 | typescriptを利用する場合に指定します。tsserver.jsはtypescriptに 109 | 同梱されており、"/lib/tsserver.js"に格納 110 | されています。 111 | 112 | *g:tscompletejob_autoload_filetypes* 113 | g:tscompletejob_autoload_filetypes = ["ts", "tsx"] 114 | tscompletejobで管理するバッファの拡張子を指定します。含まれていな 115 | いファイルをtypescriptソースとして利用する場合、リネーム、参照一 116 | 覧表示などが正しく動かない可能性があります。 117 | 118 | *g:tscompletejob_mappings_disable_default* 119 | g:tscompletejob_mappings_disable_default = 0 120 | 非0を設定するとプラグインデフォルトのキーマップが無効になります。 121 | 122 | *g:tscompletejob_complete_disable* 123 | g:tscompletejob_complete_disable = 0 124 | 非0を設定すると'omnifunc'への自動設定が無効になります。 125 | 126 | *g:tscompletejob_complete_disable_detail* 127 | g:tscompletejob_complete_disable_detail = 0 128 | 非0を設定すると補完時に詳細情報(ドキュメント、型情報など)の取得 129 | を行いません。補完動作が遅い場合は試してみてください。 130 | 131 | *g:tscompletejob_complete_max_detail_count* 132 | g:tscompletejob_complete_max_detail_count = 50 133 | 補完時に詳細情報を表示する最大候補数。これを超える候補が存在する 134 | 場合、すべての候補について詳細情報は表示されません。 135 | 136 | *g:tscompletejob_enable_tagstack* 137 | g:tscompletejob_enable_tagstack = 0 138 | 非0を設定すると|:TsCompleteJobGotoDefinition|の際に履歴を記録します。 139 | 140 | *g:tscompletejob_signature_help_disable* 141 | g:tscompletejob_signature_help_disable = 0 142 | 非0を設定すると'CursorHoldI'イベントでのシグネチャ情報表示が無効 143 | になります。 144 | 145 | *g:tscompletejob_signature_help_disable_docs* 146 | g:tscompletejob_signature_help_disable_docs = 0 147 | 非0を設定するとシグネチャ情報表示時にドキュメントを取得しません。 148 | シグネチャ情報表示動作が遅い場合に試してみてください。 149 | 150 | *g:tscompletejob_format_options* 151 | g:tscompletejob_format_options = { ... } 152 | デフォルト値は *autoload/tscompletejob.vim* を参照してください。 153 | 各オプションの詳しい説明は下記を参照してください。 154 | https://github.com/Microsoft/TypeScript/blob/master/src/server/protocol.d.ts 155 | 156 | *g:tscompletejob_codefix_comfirm* 157 | g:tscompletejob_codefix_comfirm = 0 158 | 非0を設定するとコードフィックス実行前に確認がおこなわれます。 159 | 160 | ============================================================================== 161 | 162 | MAPPINGS *tscompletejob-mappings* 163 | 164 | 各モードでバッファローカルに下記のキーマップが設定されています。動作は 165 | |tscompletejob-commands|を参照してください。 166 | 167 | Normal mode 168 | (TsCompleteJobGotoDefinition) :TsCompleteJobGotoDefinition 169 | (TsCompleteJobGotoNext) :TsCompleteJobGotoNext 170 | (TsCompleteJobGotoPrev) :TsCompleteJobGotoPrev 171 | (TsCompleteJobQuickInfo) :TsCompleteJobQuickInfo 172 | (TsCompleteJobReferences) :TsCompleteJobReferences 173 | (TsCompleteJobRename) :TsCompleteJobRename 174 | (TsCompleteJobFormat) :TsCompleteJobFormat 175 | (TsCompleteJobCodeFix) :TsCompleteJobCodeFix 176 | 177 | Visual mode 178 | (TsCompleteJobFormat) :TsCompleteJobFormat 179 | 180 | 181 | *tscompletejob-default-mappings* 182 | |g:tscompletejob_mappings_disable_default|が非0に設定されていなければ下記の 183 | キーマップが設定されます。 184 | 185 | Normal mode 186 | (TsCompleteJobGotoDefinition) 187 | (TsCompleteJobGotoPrev) 188 | i (TsCompleteJobQuickInfo) 189 | u (TsCompleteJobReferences) 190 | r (TsCompleteJobRename) 191 | f (TsCompleteJobFormat) 192 | (TsCompleteJobCodeFix) 193 | 194 | Visual mode 195 | f (TsCompleteJobFormat) 196 | 197 | ============================================================================ 198 | 199 | LICENSE *tscompletejob-license* 200 | 201 | The MIT License (MIT) 202 | 203 | Copyright (c) 2017 204 | 205 | Permission is hereby granted, free of charge, to any person obtaining a copy 206 | of this software and associated documentation files (the "Software"), to deal 207 | in the Software without restriction, including without limitation the rights 208 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 209 | copies of the Software, and to permit persons to whom the Software is 210 | furnished to do so, subject to the following conditions: 211 | 212 | The above copyright notice and this permission notice shall be included in 213 | all copies or substantial portions of the Software. 214 | 215 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 216 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 217 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 218 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 219 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 220 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 221 | SOFTWARE. 222 | 223 | vim:tw=78:ts=8:ft=help:norl: 224 | -------------------------------------------------------------------------------- /doc/tscompletejob.txt: -------------------------------------------------------------------------------- 1 | *tscompletejob.txt* Typescript code complete plugin for Vim 2 | 3 | ============================================================================ 4 | Author: runoshun *tscompletejob-author* 5 | License: MIT (see |tscompletejob-license|) 6 | ============================================================================ 7 | 8 | CONTENTS *tscompletejob-contents* 9 | 10 | |tscompletejob-introduction|....................................Intro 11 | |tscompletejob-commands|........................................Commands 12 | |tscompletejob-settings|........................................Settings 13 | |tscompletejob-mappings|........................................Mappings 14 | 15 | {Incompatible with Vi} 16 | 17 | ============================================================================ 18 | 19 | INTRODUCTION *tscompletejob* 20 | *tscompletejob-introduction* 21 | 22 | 'tscompletejob' is make for the purpose of complete/behavior quickly by using 23 | tsserver for Vim. Supported features are Code completion, Go to Definition, 24 | Quick Info, Signature Help, Show Compile Errors, Symbol Rename and Show 25 | References. 26 | 27 | ============================================================================ 28 | 29 | COMMANDS *tscompletejob-commands* 30 | 31 | *TsCompleteJobRestart* 32 | :TsCompleteJobRestart 33 | Start a job executing tsserver wrapper. If job is already started, 34 | it stop job and start new process. 35 | 36 | *TsCompleteJobStatus* 37 | :TsCompleteJobStatus 38 | Show a job status. If job is already started, this command show 39 | value of |job_status()|. Otherwise it show "not started". 40 | 41 | *TsCompleteJobGotoDefinition* 42 | :TsCompleteJobGotoDefinition 43 | Move the cursor to definition of symbol under the cursor. If 44 | the definition exists in another file, it open that file and 45 | move the cursor to the position. 46 | 47 | *TsCompleteJobGotoPrev* 48 | :TsCompleteJobGotoPrev 49 | Move the cursor to previous possition according to history 50 | recorded by |TsCompleteJobGotoDefinition|. If you use this feature, 51 | |tscompletejob_enable_tagstack| must be set to 1 52 | 53 | *TsCompleteJobGotoNext* 54 | :TsCompleteJobGotoNext 55 | Move the cursor to next possition according to history 56 | recorded by |TsCompleteJobGotoDefinition|. If you use this feature, 57 | |tscompletejob_enable_tagstack| must be set to 1 58 | 59 | *TsCompleteJobQuickInfo* 60 | :TsCompleteJobQuickInfo 61 | Show quick infomation of symbol under the cursor to command line. 62 | 63 | *TsCompleteJobReferences* 64 | :TsCompleteJobReferences 65 | Show references of symbol under the cursor in |location-list|. 66 | 67 | *TsCompleteJobRename* 68 | :TsCompleteJobRename 69 | Rename symbols include other references. 70 | 71 | *TsCompleteJobFormat* 72 | :[range]TsCompleteJobFormat 73 | Format source codes. If no range passed, it format whole file. 74 | 75 | *TsCompleteJobCodeFix* 76 | :TsCompleteJobCodeFix 77 | Perform codefix at current cursor position. 78 | 79 | ============================================================================ 80 | 81 | SETTINGS *tscompletejob-settings* 82 | 83 | Descriptions of variables are writen in following format. 84 | = 85 | 86 | *g:tscompletejob_node_cmd* 87 | g:tscompletejob_node_cmd = "node" 88 | The node command when used launch job. 89 | 90 | *g:tscompletejob_custom_tsserverlibrary* 91 | g:tscompletejob_custom_tsserverlibrary = (undefined) 92 | (deprecated) 93 | If you want use typescript 2.3 or higher, use 94 | |g:tscompletejob_custom_tsserver| instead. 95 | 96 | The path of tsserverlibrary.js. If you need to use different 97 | version of typescript shipped with this plugin, please set 98 | this variable. tsserverlibrary.js is included in typescript 2.0 99 | or higher, and it placed at 100 | "/lib/tsserverlibrary.js". 101 | 102 | *g:tscompletejob_custom_tsserver* 103 | g:tscompletejob_custom_tsserver = (undefined) 104 | The path of tsserver.js. If you need to use different version of 105 | typescript shipped with this plugin, please set this variable. 106 | tsserver.js is included typescript npm package, and it is placed 107 | at "/lib/tsserver.js". 108 | 109 | *g:tscompletejob_autoload_filetypes* 110 | g:tscompletejob_autoload_filetypes = ["ts", "tsx"] 111 | Extentions of to manage in tscompletejob. If a extention of file 112 | is not exists in this list, tscompletejob may not work correctly. 113 | 114 | *g:tscompletejob_mappings_disable_default* 115 | g:tscompletejob_mappings_disable_default = 0 116 | If it set to non 0, default key mappings are disabled. 117 | 118 | *g:tscompletejob_complete_disable* 119 | g:tscompletejob_complete_disable = 0 120 | If it is set to non 0, 'omnifunc' is not set by default. 121 | 122 | *g:tscompletejob_complete_disable_detail* 123 | g:tscompletejob_complete_disable_detail = 0 124 | If it is set to non 0, detail informations(documentation, type 125 | etc.) are ommited. Please try it, if the behavior of completion 126 | is slow. 127 | 128 | *g:tscompletejob_complete_max_detail_count* 129 | g:tscompletejob_complete_max_detail_count = 50 130 | Max number of candidates to show detail infomation. If candidates 131 | exceeds this value, all detail information are ommited. 132 | 133 | *g:tscompletejob_enable_tagstack* 134 | g:tscompletejob_enable_tagstack = 0 135 | If it is set to non 0, |:TsCompleteJobGotoDefinition| records 136 | history of cursor positions. 137 | 138 | *g:tscompletejob_signature_help_disable* 139 | g:tscompletejob_signature_help_disable = 0 140 | If it is set to non 0, call signature help on 'CursorHoldI' event 141 | is disabled. 142 | 143 | *g:tscompletejob_signature_help_disable_docs* 144 | g:tscompletejob_signature_help_disable_docs = 0 145 | If it is set to non 0, documentations are ommited when signature 146 | help is shown. Please try it, if signature help is slow. 147 | 148 | *g:tscompletejob_format_options* 149 | g:tscompletejob_format_options = { ... } 150 | Please see *autoload/tscompletejob.vim* about default values. 151 | Please refer following source about the description of each options. 152 | https://github.com/Microsoft/TypeScript/blob/master/src/server/protocol.d.ts 153 | 154 | *g:tscompletejob_codefix_comfirm* 155 | g:tscompletejob_codefix_comfirm = 0 156 | If it is set to non 0, show confirmation before code fix. 157 | 158 | ============================================================================== 159 | 160 | MAPPINGS *tscompletejob-mappings* 161 | 162 | Following mappings are defined as buffer local mapping. Please see 163 | |tscompletejob-commands| about behavior of thease mappings. 164 | 165 | Normal mode 166 | (TsCompleteJobGotoDefinition) :TsCompleteJobGotoDefinition 167 | (TsCompleteJobGotoNext) :TsCompleteJobGotoNext 168 | (TsCompleteJobGotoPrev) :TsCompleteJobGotoPrev 169 | (TsCompleteJobQuickInfo) :TsCompleteJobQuickInfo 170 | (TsCompleteJobReferences) :TsCompleteJobReferences 171 | (TsCompleteJobRename) :TsCompleteJobRename 172 | (TsCompleteJobFormat) :TsCompleteJobFormat 173 | (TsCompleteJobCodeFix) :TsCompleteJobCodeFix 174 | 175 | Visual mode 176 | (TsCompleteJobFormat) :TsCompleteJobFormat 177 | 178 | 179 | *tscompletejob-default-mappings* 180 | 181 | If |g:tscompletejob_mappings_disable_default| is not set to non 0, following 182 | key mappings are defined as buffer local mapping. 183 | 184 | Normal mode 185 | (TsCompleteJobGotoDefinition) 186 | (TsCompleteJobGotoPrev) 187 | i (TsCompleteJobQuickInfo) 188 | u (TsCompleteJobReferences) 189 | r (TsCompleteJobRename) 190 | f (TsCompleteJobFormat) 191 | (TsCompleteJobCodeFix) 192 | 193 | Visual mode 194 | f (TsCompleteJobFormat) 195 | 196 | ============================================================================ 197 | 198 | LICENSE *tscompletejob-license* 199 | 200 | The MIT License (MIT) 201 | 202 | Copyright (c) 2017 203 | 204 | Permission is hereby granted, free of charge, to any person obtaining a copy 205 | of this software and associated documentation files (the "Software"), to deal 206 | in the Software without restriction, including without limitation the rights 207 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 208 | copies of the Software, and to permit persons to whom the Software is 209 | furnished to do so, subject to the following conditions: 210 | 211 | The above copyright notice and this permission notice shall be included in 212 | all copies or substantial portions of the Software. 213 | 214 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 215 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 216 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 217 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 218 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 219 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 220 | SOFTWARE. 221 | 222 | vim:tw=78:ts=8:ft=help:norl: 223 | -------------------------------------------------------------------------------- /ftplugin/typescript.vim: -------------------------------------------------------------------------------- 1 | if (exists("b:loaded_syntastic_tscompletejob_ftplugin_loaded")) 2 | finish 3 | endif 4 | let g:loaded_syntastic_tscompletejob_ftplugin_loaded = 1 5 | 6 | let s:save_cpo = &cpo 7 | set cpo&vim 8 | 9 | call tscompletejob#init_plugin(0) 10 | 11 | if (!g:tscompletejob_complete_disable) 12 | setlocal omnifunc=tscompletejob#complete 13 | endif 14 | 15 | command! -buffer TsCompleteJobRestart :call tscompletejob#restart() 16 | command! -buffer TsCompleteJobStatus :call tscompletejob#status() 17 | command! -buffer TsCompleteJobGotoDefinition :call tscompletejob#goto_definition() 18 | command! -buffer TsCompleteJobGotoNext :call tscompletejob#goto_next() 19 | command! -buffer TsCompleteJobGotoPrev :call tscompletejob#goto_prev() 20 | command! -buffer TsCompleteJobTags :call tscompletejob#tags() 21 | command! -buffer TsCompleteJobQuickInfo :call tscompletejob#quickinfo() 22 | command! -buffer TsCompleteJobReferences :call tscompletejob#references() 23 | command! -buffer TsCompleteJobRename :call tscompletejob#rename(0,0) 24 | command! -buffer -range=% TsCompleteJobFormat :,call tscompletejob#format() 25 | command! -buffer TsCompleteJobCodeFix :call tscompletejob#codefix() 26 | 27 | nnoremap (TsCompleteJobGotoDefinition) :TsCompleteJobGotoDefinition 28 | nnoremap (TsCompleteJobGotoNext) :TsCompleteJobGotoNext 29 | nnoremap (TsCompleteJobGotoPrev) :TsCompleteJobGotoPrev 30 | nnoremap (TsCompleteJobQuickInfo) :TsCompleteJobQuickInfo 31 | nnoremap (TsCompleteJobReferences) :TsCompleteJobReferences 32 | nnoremap (TsCompleteJobRename) :TsCompleteJobRename 33 | nnoremap (TsCompleteJobFormat) :TsCompleteJobFormat 34 | nnoremap (TsCompleteJobCodeFix) :TsCompleteJobCodeFix 35 | 36 | vnoremap (TsCompleteJobFormat) :TsCompleteJobFormat 37 | 38 | if (!g:tscompletejob_mappings_disable_default) 39 | nmap (TsCompleteJobGotoDefinition) 40 | nmap (TsCompleteJobGotoPrev) 41 | nmap i (TsCompleteJobQuickInfo) 42 | nmap u (TsCompleteJobReferences) 43 | nmap r (TsCompleteJobRename) 44 | nmap f (TsCompleteJobFormat) 45 | nmap (TsCompleteJobCodeFix) 46 | 47 | vmap f (TsCompleteJobFormat) 48 | endif 49 | 50 | if (!g:tscompletejob_signature_help_disable) 51 | autocmd CursorHoldI if (tscompletejob#signature_help()) 52 | autocmd CursorHoldI call tscompletejob#signature_help_start() 53 | autocmd CursorHoldI endif 54 | endif 55 | 56 | let &cpo = s:save_cpo 57 | unlet s:save_cpo 58 | 59 | -------------------------------------------------------------------------------- /plugin/tscompletejob.vim: -------------------------------------------------------------------------------- 1 | if exists('g:loaded_tscompletejob_plugin') 2 | finish 3 | endif 4 | let g:loaded_tscompletejob_plugin = 1 5 | 6 | let s:save_cpo = &cpo 7 | set cpo&vim 8 | 9 | if(!exists("g:tscompletejob_autoload_filetypes")) 10 | let g:tscompletejob_autoload_filetypes = ["ts", "tsx"] 11 | endif 12 | 13 | augroup tscompletejob_autoload_buffer 14 | autocmd! 15 | for filetype in g:tscompletejob_autoload_filetypes 16 | exec "autocmd BufRead *." . filetype . " call tscompletejob#add_buffer(expand(\"\"))" 17 | endfor 18 | augroup END 19 | 20 | let &cpo = s:save_cpo 21 | unlet s:save_cpo 22 | -------------------------------------------------------------------------------- /syntax_checkers/typescript/tscompletejob.vim: -------------------------------------------------------------------------------- 1 | if exists("g:loaded_syntastic_tscompletejob_syntax_checker") 2 | finish 3 | endif 4 | 5 | let g:loaded_syntastic_tscompletejob_syntax_checker = 1 6 | let s:saved_cpo = &cpo 7 | set cpo&vim 8 | 9 | func! SyntaxCheckers_typescript_tscompletejob_IsAvailable() dict abort 10 | return executable(g:tscompletejob_node_cmd) 11 | endfunc 12 | 13 | func! SyntaxCheckers_typescript_tscompletejob_GetLocList() dict abort 14 | return tscompletejob#get_qfixlist() 15 | endfunc 16 | 17 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 18 | \ "filetype" : "typescript", 19 | \ "name" : "tscompletejob", 20 | \ }) 21 | 22 | 23 | let &cpo = s:saved_cpo 24 | unlet s:saved_cpo 25 | -------------------------------------------------------------------------------- /test/codefix.ts: -------------------------------------------------------------------------------- 1 | 2 | abstract class Greeter { 3 | abstract greet(): String; 4 | } 5 | 6 | class Person extends Greeter { 7 | } 8 | -------------------------------------------------------------------------------- /test/errors.ts: -------------------------------------------------------------------------------- 1 | let a: number = "string"; 2 | let s: string = 1; 3 | 4 | function foo() { 5 | -------------------------------------------------------------------------------- /test/format.ts: -------------------------------------------------------------------------------- 1 | let a : number = 1 2 | 3 | let obj = { 4 | a: 1, b:2, c:4, }; 5 | let v = null; 6 | 7 | function a (x : number ) { 8 | console.log(x+1+2+3); 9 | } 10 | 11 | -------------------------------------------------------------------------------- /test/mod.ts: -------------------------------------------------------------------------------- 1 | 2 | export function foo() { 3 | bar() 4 | } 5 | 6 | export function bar() { 7 | } 8 | -------------------------------------------------------------------------------- /test/rename.ts: -------------------------------------------------------------------------------- 1 | let a: number = 1; 2 | 3 | let b = a.toExponential(); 4 | -------------------------------------------------------------------------------- /test/sample1.ts: -------------------------------------------------------------------------------- 1 | interface A { 2 | foo: string; 3 | bar: number; 4 | } 5 | 6 | class C { 7 | private n: number; 8 | public m: Date; 9 | 10 | public meth(x: number, y: number): number { 11 | return x + y 12 | } 13 | } 14 | 15 | class D extends C { 16 | 17 | public meth2(z: string); 18 | public meth2(z: string, z2:string); 19 | public meth2(z: string, z2?:string) { 20 | console.log(z); 21 | } 22 | } 23 | 24 | let c = new C(); 25 | let d = new D(); 26 | 27 | d.m 28 | 29 | d.meth2("hello") 30 | 31 | import { foo, bar } from "./mod"; 32 | foo() 33 | -------------------------------------------------------------------------------- /test/tscompletejob.vader: -------------------------------------------------------------------------------- 1 | Before: 2 | let current_buf = bufnr("%") 3 | call tscompletejob#init_plugin(1) 4 | call tscompletejob#restart() 5 | 6 | let sample1 = tscompletejob#utils#join_path( 7 | \ tscompletejob#get_plugin_dir(), 8 | \ tscompletejob#utils#join_path("test", "sample1.ts")) 9 | let errors_ts = tscompletejob#utils#join_path( 10 | \ tscompletejob#get_plugin_dir(), 11 | \ tscompletejob#utils#join_path("test", "errors.ts")) 12 | let rename_ts = tscompletejob#utils#join_path( 13 | \ tscompletejob#get_plugin_dir(), 14 | \ tscompletejob#utils#join_path("test", "rename.ts")) 15 | let format_ts = tscompletejob#utils#join_path( 16 | \ tscompletejob#get_plugin_dir(), 17 | \ tscompletejob#utils#join_path("test", "format.ts")) 18 | let codefix_ts = tscompletejob#utils#join_path( 19 | \ tscompletejob#get_plugin_dir(), 20 | \ tscompletejob#utils#join_path("test", "codefix.ts")) 21 | 22 | After: 23 | exec "buffer " . current_buf 24 | 25 | Execute (tss_command returns default): 26 | let cmds = tscompletejob#tss_command() 27 | AssertEqual 2, len(cmds) 28 | AssertEqual "node", cmds[0] 29 | Assert stridx(cmds[1], "index.js") != -1 30 | 31 | Execute (tss_command customizable with node_cmd): 32 | let g:tscompletejob_node_cmd = "custom_node" 33 | let cmds = tscompletejob#tss_command() 34 | AssertEqual 2, len(cmds) 35 | AssertEqual "custom_node", cmds[0] 36 | 37 | Execute (tss_command customizable with custom_tsserverlibrary): 38 | let g:tscompletejob_custom_tsserverlibrary = "custom_tssserverlib.js" 39 | let g:tscompletejob_use_legacy = 1 40 | let cmds = tscompletejob#tss_command() 41 | AssertEqual 4, len(cmds) 42 | AssertEqual "--useLegacy", cmds[2] 43 | AssertEqual "custom_tssserverlib.js", cmds[3] 44 | 45 | Execute (tss_command customizable with custom_tsserver): 46 | let g:tscompletejob_custom_tsserver = "custom_tssserver.js" 47 | let cmds = tscompletejob#tss_command() 48 | AssertEqual 3, len(cmds) 49 | AssertEqual "custom_tssserver.js", cmds[2] 50 | 51 | Execute (status returns 'run' after send command): 52 | AssertEqual "not started", tscompletejob#status() 53 | call tscompletejob#complete(0, "") 54 | AssertEqual "run", tscompletejob#status() 55 | 56 | Execute (can restart client after run): 57 | AssertEqual "not started", tscompletejob#status() 58 | call tscompletejob#complete(0, "") 59 | call tscompletejob#restart() 60 | AssertEqual "not started", tscompletejob#status() 61 | 62 | Execute (complete findstart returns correct values): 63 | exec "edit " . sample1 64 | call cursor(27,3) 65 | normal a 66 | let pos = tscompletejob#complete(1,"") 67 | AssertEqual 3, pos 68 | let completions = tscompletejob#complete(0, "m") 69 | AssertEqual type([]), type(completions) 70 | AssertEqual 3, len(completions) 71 | 72 | Execute (goto difinition can move to correct pos): 73 | exec "edit " . sample1 74 | call cursor(24,13) 75 | let id = tscompletejob#goto_definition() 76 | while !tscompletejob#is_request_done(id) 77 | sleep 50m 78 | endwhile 79 | let line = line(".") 80 | let col = col(".") 81 | AssertEqual 6, line 82 | AssertEqual 7, col 83 | 84 | Execute (tagstack works correctly): 85 | let g:tscompletejob_enable_tagstack = 1 86 | exec "edit " . sample1 87 | call cursor(32, 1) 88 | let id = tscompletejob#goto_definition() 89 | while !tscompletejob#is_request_done(id) 90 | sleep 50m 91 | endwhile 92 | call cursor(3, 5) 93 | let id = tscompletejob#goto_definition() 94 | while !tscompletejob#is_request_done(id) 95 | sleep 50m 96 | endwhile 97 | let tags = tscompletejob#get_tagstack() 98 | AssertEqual 4, len(tags) 99 | AssertEqual "mod.ts", expand("%:t") 100 | 101 | call tscompletejob#goto_prev() 102 | AssertEqual "mod.ts", expand("%:t") 103 | AssertEqual 3, line(".") 104 | AssertEqual 5, col(".") 105 | 106 | call tscompletejob#goto_prev() 107 | AssertEqual "mod.ts", expand("%:t") 108 | AssertEqual 2, line(".") 109 | AssertEqual 17, col(".") 110 | 111 | call tscompletejob#goto_prev() 112 | AssertEqual "sample1.ts", expand("%:t") 113 | AssertEqual 32, line(".") 114 | AssertEqual 1, col(".") 115 | 116 | call tscompletejob#goto_next() 117 | AssertEqual "mod.ts", expand("%:t") 118 | AssertEqual 2, line(".") 119 | AssertEqual 17, col(".") 120 | 121 | call tscompletejob#goto_next() 122 | AssertEqual "mod.ts", expand("%:t") 123 | AssertEqual 3, line(".") 124 | AssertEqual 5, col(".") 125 | 126 | Execute (signature_help can returns correct signatures): 127 | exec "edit " . sample1 128 | call cursor(29, 11) 129 | let sigs = tscompletejob#get_signature_help() 130 | AssertEqual 2, len(sigs) 131 | 132 | Execute (qfixlist can returns corrent errors): 133 | exec "edit " . errors_ts 134 | let qflist = tscompletejob#get_qfixlist() 135 | AssertEqual 3, len(qflist) 136 | 137 | Execute (rename can edit correctly): 138 | exec "edit " . rename_ts 139 | call cursor(1, 5) 140 | call tscompletejob#rename(1,1,"c") 141 | AssertEqual "let c: number = 1;", getline(1) 142 | AssertEqual "let b = c.toExponential();", getline(3) 143 | normal u 144 | 145 | Execute (format can edit correctly): 146 | exec "edit " . format_ts 147 | %call tscompletejob#format() 148 | AssertEqual "let a: number = 1", getline(1) 149 | 150 | AssertEqual "let obj = {", getline(3) 151 | AssertEqual " a: 1, b: 2, c: 4,", getline(4) 152 | AssertEqual "};", getline(5) 153 | 154 | AssertEqual "let v = null;", getline(6) 155 | AssertEqual "function a(x: number) {", getline(8) 156 | AssertEqual " console.log(x + 1 + 2 + 3);", getline(9) 157 | AssertEqual "}", getline(10) 158 | normal u 159 | 160 | Execute (reference can returns correct list): 161 | exec "edit " . sample1 162 | call cursor(6,7) 163 | let id = tscompletejob#references() 164 | while !tscompletejob#is_request_done(id) 165 | sleep 50m 166 | endwhile 167 | let refs = getloclist(winnr()) 168 | AssertEqual 3, len(refs) 169 | 170 | Execute (complete with async callback works correctly): 171 | exec "edit " . sample1 172 | call cursor(27,3) 173 | normal a 174 | 175 | function! Assert() 176 | let s:response = [] 177 | let s:success = 0 178 | let s:request_id = 0 179 | let s:done = 0 180 | function! TestCallback(request_id, success, response) 181 | let s:success = a:success 182 | let s:response = a:response 183 | let s:request_id = a:request_id 184 | let s:done = 1 185 | endfunction 186 | call tscompletejob#complete_with_handler(0, "m", { 187 | \ "callback": function('TestCallback'), 188 | \ "request_id" : 100, 189 | \}) 190 | 191 | while !s:done 192 | sleep 50m 193 | endwhile 194 | 195 | " vars like 's:*' can't access in AssertEqual ?? 196 | let success = s:success 197 | let response = s:response 198 | let request_id = s:request_id 199 | AssertEqual v:true, success 200 | AssertEqual 100, request_id 201 | AssertEqual type([]), type(response) 202 | AssertEqual 3, len(response) 203 | endfunction 204 | call Assert() 205 | 206 | Execute (codefix can be applied correctly): 207 | exec "edit " . codefix_ts 208 | call cursor(6, 7) 209 | call tscompletejob#codefix(1) 210 | 211 | AssertEqual "abstract class Greeter {", getline(2) 212 | AssertEqual " abstract greet(): String;", getline(3) 213 | AssertEqual "}", getline(4) 214 | 215 | AssertEqual "class Person extends Greeter {", getline(6) 216 | AssertEqual " greet(): String {", getline(7) 217 | AssertEqual " throw new Error(\"Method not implemented.\");", getline(8) 218 | AssertEqual " }", getline(9) 219 | 220 | 221 | AssertEqual "}", getline(12) 222 | normal u 223 | 224 | 225 | Execute (quickinfo can returns correct infomation): 226 | exec "edit " . sample1 227 | call cursor(27, 1) 228 | execute "redir => s:messages" 229 | let id = tscompletejob#quickinfo() 230 | while !tscompletejob#is_request_done(id) 231 | sleep 10m 232 | endwhile 233 | redir END 234 | let info = get(split(s:messages,"\n"),-1, "") 235 | AssertEqual "let d: D", info 236 | --------------------------------------------------------------------------------