This repository has been archived by the owner on Oct 24, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
demo for vim8 support via roxma/nvim-yarp
- Loading branch information
Showing
3 changed files
with
140 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
|
||
if has('nvim') | ||
finish | ||
endif | ||
|
||
let s:ts = yarp#py3('nvim_typescript_wrap') | ||
|
||
com -nargs=* TSStop call call(s:ts.request, ['TSStop'] + [<f-args>], s:ts) | ||
com -nargs=* TSStart call call(s:ts.request, ['TSStart'] + [<f-args>], s:ts) | ||
com -nargs=* TSRestart call call(s:ts.request, ['TSRestart'] + [<f-args>], s:ts) | ||
com -nargs=* TSReloadProject call call(s:ts.request, ['TSReloadProject'] + [<f-args>], s:ts) | ||
com -nargs=* TSDoc call call(s:ts.request, ['TSDoc'] + [<f-args>], s:ts) | ||
com -nargs=* TSDef call call(s:ts.request, ['TSDef'] + [<f-args>], s:ts) | ||
com -nargs=* TSDefPreview call call(s:ts.request, ['TSDefPreview'] + [<f-args>], s:ts) | ||
com -nargs=* TSType call call(s:ts.request, ['TSType'] + [<f-args>], s:ts) | ||
com -nargs=* TSTypeDef call call(s:ts.request, ['TSTypeDef'] + [<f-args>], s:ts) | ||
com -nargs=* TSGetErr call call(s:ts.request, ['TSGetErr'] + [<f-args>], s:ts) | ||
com -nargs=* TSSyncErr call call(s:ts.request, ['TSSyncErr'] + [<f-args>], s:ts) | ||
com -nargs=* TSRename call call(s:ts.request, ['TSRename'] + [<f-args>], s:ts) | ||
com -nargs=* TSImport call call(s:ts.request, ['TSImport'] + [<f-args>], s:ts) | ||
com -nargs=* TSGetDocSymbols call call(s:ts.request, ['TSGetDocSymbols'] + [<f-args>], s:ts) | ||
com -nargs=* TSExtractFunction call call(s:ts.request, ['TSExtractFunction'] + [<f-args>], s:ts) | ||
com -nargs=* TSSig call call(s:ts.request, ['TSSig'] + [<f-args>], s:ts) | ||
com -nargs=* TSRefs call call(s:ts.request, ['TSRefs'] + [<f-args>], s:ts) | ||
com -nargs=* TSEditConfig call call(s:ts.request, ['TSEditConfig'] + [<f-args>], s:ts) | ||
|
||
|
||
func! TSGetErrFunc(...) | ||
return call(s:ts.request, ['TSGetErrFunc'] + a:000, s:ts) | ||
endfunc | ||
func! TSGetDocSymbolsFunc(...) | ||
return call(s:ts.request, ['TSGetDocSymbolsFunc'] + a:000, s:ts) | ||
endfunc | ||
func! TSGetWorkspaceSymbolsFunc(...) | ||
return call(s:ts.request, ['TSGetWorkspaceSymbolsFunc'] + a:000, s:ts) | ||
endfunc | ||
func! TSComplete(...) | ||
return call(s:ts.request, ['TSComplete'] + a:000, s:ts) | ||
endfunc | ||
func! TSGetServerPath(...) | ||
return call(s:ts.request, ['TSGetServerPath'] + a:000, s:ts) | ||
endfunc | ||
func! TSOnBufEnter(...) | ||
return call(s:ts.request, ['TSOnBufEnter'] + a:000, s:ts) | ||
endfunc | ||
func! TSOnBufSave(...) | ||
return call(s:ts.request, ['TSOnBufSave'] + a:000, s:ts) | ||
endfunc | ||
func! TSCmRefresh(...) | ||
return call(s:ts.request, ['TSCmRefresh'] + a:000, s:ts) | ||
endfunc | ||
|
||
" @neovim.command("TSStop") | ||
" @neovim.command("TSStart") | ||
" @neovim.command("TSRestart") | ||
" @neovim.command("TSReloadProject") | ||
" @neovim.command("TSDoc") | ||
" @neovim.command("TSDef") | ||
" @neovim.command("TSDefPreview") | ||
" @neovim.command("TSType") | ||
" @neovim.command("TSTypeDef") | ||
" @neovim.command("TSGetErr") | ||
" @neovim.command("TSSyncErr") | ||
" @neovim.command("TSRename", nargs="*") | ||
" @neovim.command("TSImport") | ||
" @neovim.command("TSGetDocSymbols") | ||
" @neovim.command("TSExtractFunction", range='') | ||
" @neovim.command("TSSig") | ||
" @neovim.command("TSRefs") | ||
" @neovim.command("TSEditConfig") | ||
" @neovim.function("TSGetErrFunc") | ||
" @neovim.function("TSGetDocSymbolsFunc", sync=True) | ||
" @neovim.function("TSGetWorkspaceSymbolsFunc", sync=True) | ||
" @neovim.function('TSComplete', sync=True) | ||
" @neovim.function('TSGetServerPath', sync=True) | ||
" @neovim.function('TSOnBufEnter') | ||
" @neovim.function('TSOnBufSave') | ||
" @neovim.function('TSCmRefresh', sync=False) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import vim | ||
from nvim_typescript import TypescriptHost | ||
|
||
|
||
_obj = TypescriptHost(vim) | ||
# :r!sed -n '/neovim.function/,+1p' rplugin/python3/nvim_typescript/__init__.py | ||
|
||
|
||
def TSStop(*args): | ||
return _obj.tsstop(args) | ||
def TSStart(*args): | ||
return _obj.tsstart(args) | ||
def TSRestart(*args): | ||
return _obj.tsrestart(args) | ||
def TSReloadProject(*args): | ||
return _obj.reloadProject(args) | ||
def TSDoc(*args): | ||
return _obj.tsdoc(args) | ||
def TSDef(*args): | ||
return _obj.tsdef(args) | ||
def TSDefPreview(*args): | ||
return _obj.tsdefpreview(args) | ||
def TSType(*args): | ||
return _obj.tstype(args) | ||
def TSTypeDef(*args): | ||
return _obj.tstypedef(args) | ||
def TSGetErr(*args): | ||
return _obj.tsgeterr(args) | ||
def TSSyncErr(*args): | ||
return _obj.tssyncerr(args) | ||
def TSRename(*args): | ||
return _obj.tsrename(args) | ||
def TSImport(*args): | ||
return _obj.tsimport(args) | ||
def TSGetDocSymbols(*args): | ||
return _obj.tsgetdocsymbols(args) | ||
def TSExtractFunction(*args): | ||
return _obj.extractFunction(args) | ||
def TSSig(*args): | ||
return _obj.tssig(args) | ||
def TSRefs(*args): | ||
return _obj.tsrefs(args) | ||
def TSEditConfig(*args): | ||
return _obj.tseditconfig(args) | ||
|
||
def TSGetErrFunc(*args): | ||
return _obj.getErrFunc(args) | ||
def TSGetDocSymbolsFunc(*args): | ||
return _obj.getDocSymbolsFunc(args) | ||
def TSGetWorkspaceSymbolsFunc(*args): | ||
return _obj.getWorkspaceSymbolsFunc(args) | ||
def TSComplete(*args): | ||
return _obj.tsomnifunc(args) | ||
def TSGetServerPath(*args): | ||
return _obj.tstest(args) | ||
def TSOnBufEnter(*args): | ||
return _obj.on_bufenter(args) | ||
def TSOnBufSave(*args): | ||
return _obj.on_bufwritepost(args) | ||
def TSCmRefresh(*args): | ||
return _obj.on_cm_refresh(args) |