quramy / tsuquyomi Goto Github PK
View Code? Open in Web Editor NEWA Vim plugin for TypeScript
Home Page: http://www.vim.org/scripts/script.php?script_id=5151
A Vim plugin for TypeScript
Home Page: http://www.vim.org/scripts/script.php?script_id=5151
I have set completeopt+=preview, but the preview window does not open when doing omni-completion.
It would be very nice if the "tooltip" functional worked in terminal vim (which doesn't support balloon functionality).
Would it be possible to have the option to show the "tooltip" in something like the preview window?
ENV:
I'm using Terminal.app + tmux on OSX
it works well under Terminal.app, but under tmux.
On OSX, /tmp is a soft link to /private/tmp
Given the file: /tmp/hello.ts
:
When under tmux, :echo tsuquyomi#bufManager#isOpened("/tmp/hello.ts")
outputs 1, however, :echo tsuquyomi#bufManager#isOpened("/private/tmp/hello.ts")
outputs 0 and expand("%:p")
echoes '/tmp/hellots'. I stepped into that fuction, only to found the variable $file
is /tmp/hello.ts
. Obviously, the problem has something to do with link
.
I'm not familiar with this project, nor have enough time to handle it. I'd appreaciate it if you are to cope with it.
PS: my gut feeling tell me that if can also be an upstream issue caused by tsserver's handling link.
Right now, tsuquyomi#config#tsscmd()
checks for "node_modules/typescript/bin/tsserver.js"
. In newer releases (1.6+), all JavaScript files will be in typescript/lib
and all scripts will be in typescript/bin
. Because of this change, tsuquyomi#config#tsscmd()
doesn't find a local tsserver.js
for the nightlies. tsuquyomi#config#tsscmd()
should instead be checking for "node_modules/typescript/bin/tsserver"
since it exists in 1.5+ and can be passed to the node executable.
Open a .tsx
file that has known compile errors.
:copen
will show nothing.
:cnext
will give the error:
E42: No Errors
Completion etc works fine, but any compilation errors are not available.
i.e. cwindow
shows nothing.
Anyone else seeing this?
Am I missing something obvious?
The filesGlob
options for tsconfig.json is supported by the tsconfig utility in NPM, however tsuquyomi ignores it and so you get errors from any files you are expecting it to pick up.
Is it a simple thing to support this?
I could see the error reported in #45, but with classic vim. Here is the procedure for reproducing.
# clone my repository
git clone https://github.com/delphinus35/tsuquyomi-error-reproducing
cd tsuquyomi-error-reproducing
# clone neobundle.vim
git submodule update --init
# install vimproc & tsuquyomi
vim -N -u ./vimrc -U NONE -i NONE +NeoBundleInstall +q
# edit sample vim
vim -N -u ./vimrc -U NONE -i NONE us.ts
# in vim, try to show Underscore.js methods
# jo_.<C-X><C-O>
# ↑(cursor down)(new line)(input _.)(start omni completion)
Then you see errors below. With huge definition files (this time, it is underscore.d.ts), tsserver makes wrong return values, I think.
Messages maintainer: Bram Moolenaar <[email protected]>
"us.ts" 2L, 43C
Error detected while processing function tsuquyomi#complete[48]..tsuquyomi#makeCompleteMenu[2]..tsuquyomi#tsClient#tsCompletionEntryDetails[2]..tsuquyomi#tsClient#sendCommandSyncResponse[7]..<SNR>63_decode:
line 17:
E114: Missing quote: "UnderscoreStatic
Error detected while processing function tsuquyomi#complete[48]..tsuquyomi#makeCompleteMenu[2]..tsuquyomi#tsClient#tsCompletionEntryDetails[2]..tsuquyomi#tsClient#sendCommandSyncResponse[7]..<SNR>63_decode:
line 17:
E15: Invalid expression: {"seq":0,"type":"response","command":"completionEntryDetails","request_seq":3,"success":true,"body":[{"name":"after","kindModifiers":"declare","kind":"method","displayParts":[{"text":"(","kind":"punctuation"},{"te
xt":"method","kind":"text"},{"text":")","kind":"punctuation"},{"text":" ","kind":"space"},{"text":"UnderscoreStatic","kind":"interfaceName"},{"text":".","kind":"punctuation"},{"text":"after","kind":"methodName"},{"text":"(","kind":"punctu
ation"},{"text":"count","kind":"parameterName"},{"text":":","kind":"punctuation"},{"text":" ","kind":"space"},{"text":"number","kind":"keyword"},{"text":",","kind":"punctuation"},{"text":" ","kind":"space"},{"text":"fn","kind":"parameterN
ame"},{"text":":","kind":"punctuation"},{"text":" ","kind":"space"},{"text":"Function","kind":"localName"},{"text":")","kind":"punctuation"},{"text":":","kind":"punctuation"},{"text":" ","kind":"space"},{"text":"Function","kind":"localNam
e"}],"documentation":[{"text":"Creates a version of the function that wi
Error detected while processing function tsuquyomi#complete[48]..tsuquyomi#makeCompleteMenu[2]..tsuquyomi#tsClient#tsCompletionEntryDetails[3]..tsuquyomi#tsClient#getResponseBodyAsList:
line 5:
E715: Dictionary required
Press ENTER or type command to continue
My setting
I'm getting this error on XUbuntu:
[Tsuquyomi] tsserver is not installed. Try "npm -g install typescript".
when I type which tsserver
I get:
/home/jon/.node/bin/tsserver
when I run tsserver
it seems to work.
I'm using node v4.2.2.
I'm using neovim
NVIM 0.0.0-alpha (compiled Oct 30 2015 08:52:19)
Add a function or command to replace identifiers in comments.
It's enabled that the argument name contained in @param someArg
is replaced when renaming someArg
is called.
If you want to show a method's signature in the preview window when you complete this method's arguments:
(The preview window isn't shown when completion properties or variables)
Is there a way to make the completion for properties show up as soon as you type the .
on an object? Something like the picture below, but without having to manually type <C-x><C-o>
in insert mode in order to get it to show the window?
I wonder why, instead of making manual post-install operation for vimproc.vim (to build it) in your README file, you don't let NeoBundle do it for you, as explained here:
https://github.com/Shougo/vimproc.vim#neobundle
Florent
Is it possible to disable the quickfix popup on save? I use neomake to provide similar feedback and don't like the window popping up.
Add "go back" Ex command, which move the cursor to the location where :TsuquyomiDefinition
was called.
And, I will map this command to Ctrl-t. (emulates tag's mapping).
I'm not up for all this fancy NeoBundle stuff with 12,000 million configuration options. I just want to copy and paste some curl script and have magic happen like what I'm used to. How do I do this the easy way with pathogen?
...and yes, I'm hangry so I probably should go eat a sandwich :-)
Not sure if this is supported at the moment but I tried to reference a type definition file and omnicomplete wouldn't work.
But if I setup the interfaces inside the file, omnicomplete works fine.
Is this not supported?
What more informations do you need from me?
When I save a change to a file that exports things, I get the error message above.
I have a tsconfig.json in the top directory of my project and it specifies "module": "amd" in the "compilerOptions" section. Is there something else I need to do or does tsuquyomi not support this yet?
I think this plugin tries to compile the file in the fugitive staging buffer somehow and fails badly. It also gets stuck, so I have to <C-C>
out of it constantly.
To reproduce, install fugitive, open a file under source control and when editing the file in vim, run :Gvd
. Then, edit the staged file by e.g. adding some hunks or making any changes and save the file.
This is the last lines of output from running :20verbose w
in that buffer:
continuing in BufWritePost Auto commands for "*"
Executing BufWritePost Auto commands for "*.ts"
autocommand silent! call tsuquyomi#reloadAndGeterr()
line 0: silent! call tsuquyomi#reloadAndGeterr()
Also note it only happens for typescript files, that is for files of filetype
typescript
(the staging buffer will have the same filetype as the original file).
Add the outline feature.
Tasks:
navbar
If TypeScript is installed locally, switch to use it( not use global installed one).
It will works only if g:tsuquyomi_use_dev_noed_module
is 0.
I'm not sure if this is a configuration setting for Vim that I just haven't learned about and therefore don't have set, but I've never seen it before and it only seems to happen in this plugin. When I run <C-x><C-o>
to omni-complete a property, I always get this random [Scratch]
file that pops up.
Is there a way to keep that new file from opening in my my current buffer? It's quite obtrusive.
Thanks a ton for making this plugin, it's incredible :)
Using signatureHelp
command of TSServer.
Problem:
tsOpen
.tsReferences
), vimproc interprets timedout because TSServer is busy to opening the file.In the present, tsClient return a empty list, but it's undesirable.
In this case, tsClient should wait that the response is returned.
Is there any experience running tsuquyomi with neovim?
Add a feature to enable to configure compiler options.
I have a TypeScript code generation process that re-runs when a definition file changes. However, tsuquyomi
(or the underlying TSServer) doesn't seem to pick up this change, because the auto-complete suggestions presented don't include new methods/functions etc defined in the regenerated code.
Is this expected to work?
PS massive thanks for this project
When adding a new file to an existing project with an existing tsconfig.json
and attempting to write to the new file, Tsuquyomi prints the following error message: error| Cannot compile modules unless the '--module' flag is provided.
. However, the module flag is provided in the project's tsconfig.json
, and restarting Vim fixes the problem — Tsuquyomi stops printing bogus error messages on write.
I've tried a few things to fix the problem, like running :TsuReloadProject
, but nothing seems to fix it other than a full Vim restart. Any ideas?
I'll migrate test code from UT to vesting and add script for Travis.
Given a file a.ts
:
// a.ts
export default class A {
name: string;
age: number;
}
And a file b.ts
;
import A from './a.ts';
A // put vim cursor over A, and run :echo tsuquyomi#hint()
// output: `import A`
In this case, you can see that the only information given back is that it is import A
. Is there a way to get back the type information of A as opposed to just the import A
?
TsuquyomiDefinition works successfully, but subsequent TsuquyomiGoBack does not and messages "[Tsuquyomi] No items in navigation stack... "
Getting an error inside of neovim
Error detected while processing function tsuquyomi#complete..tsuquyomi#tsClient#tsCompletions..tsuquyomi#tsClient#sendCommandSyncResponse..<SNR>222_
decode:
line 17:
E114: Missing quote: "declar
Error detected while processing function tsuquyomi#complete..tsuquyomi#tsClient#tsCompletions..tsuquyomi#tsClient#sendCommandSyncResponse..<SNR>222_
decode:
line 17:
E15: Invalid expression: {"seq":0,"type":"response","command":"completions","request_seq":0,"success":true,"body":[{"name":"AbstractWorker","kind":"
interface","kindModifiers":"declare","sortText":"0"},{"name":"ActiveXObject","kind":"interface","kindModifiers":"declare","sortText":"0"},{"name":"a
ddEventListener","kind":"function","kindModifiers":"declare","sortText":"0"},{"name":"alert","kind":"function","kindModifiers":"declare","sortText":
"0"},{"name":"Algorithm","kind":"interface","kindModifiers":"declare","sortText":"0"},{"name":"AnalyserNode","kind":"interface","kindModifiers":"dec
lare","sortText":"0"},{"name":"ANGLE_instanced_arrays","kind":"interface","kindModifiers":"declare","sortText":"0"},{"name":"AnimationEvent","kind":
"interface","kindModifiers":"declare","sortText":"0"},{"name":"animationStartTime","kind":"var","kindModifiers":"declare","sortText":"0"},{"name":"a
ny","kind":"keyword","kindModifiers":"","sortText":"0"},{"name":"applicationCache","kind":"var","kindModifiers":"declare","sortText":"0"
Error detected while processing function tsuquyomi#complete..tsuquyomi#tsClient#tsCompletions..tsuquyomi#tsClient#getResponseBodyAsList:
line 5:
E715: Dictionary required
Pattern not found
Neovim Version: NVIM 0.0.0-alpha+201510160154 (compiled Oct 17 2015 09:48:05)
OSX 10.11
Iterm 2 nightligh builds.
What other information do you need?
Request from #25 .
Let's say I have a project with the following set up:
app
└── directives
└── popover
├── popover.d.ts
└── popover.ts
Where popover.ts
has some property that uses an interface name (lets call it IPopoverConfig
) defined in popover.d.ts
.
When I open popover.ts
and save, I get an error saying something along the lines of
app/directives/popover/popover.ts|6 col 37 error| Cannot find name 'IPopoverConfig'.
The error is not "real", meaning that with my compile and build tasks, I can get the whole TypeScript app to work without problems. So it seems a bit strange. Especially considering that I have another folder, typings
, that is a sibling to app
, which contains other definition files that I am using that I'm not getting errors on.
app/
typings
├── some-file.d.ts
└── some-other-file.d.ts
If I include a reference path to popover.d.ts
in popover.ts
/// <reference path="./popover.d.ts" />
Everything works fine.
If I move popover.d.ts
into my typings
directory, everything works fine.
In fact, if I move popover.d.ts
into any directory that isn't app/directives/popover
, everything works fine.
It seems the only time I get an error complaining about not finding the interfaces defined in popover.d.ts
is when it is in the same path as popover.ts
.
I'm not sure why this is. I am not sure how tsuquyomi
traverses a project directory structure at compile time, but have you ever seen a case where definition files somehow appear "invisible" to the corresponding TypeScript files in the same path unless you include a reference path? Any light you can shed on this would be appreciated greatly.
FWIW, my co-worker using atom-typescript
does not seem to have this issue. I would prefer to continue using vim
and I love this TypeScript plugin and am thankful for all the work you've done on it, it's just this one thing that's causing a problem. If it's unsolvable for the time being, I can just make sure to have all of my definition files not in the same path as any .ts
files using them.
Thanks.
Maybe shorten them to :TsuDefinition etc.?
It'd be nice if it didn't overwrite mappings by default, or at least if there was a way to stop it... I use C-^
a lot...
Hello!
I get this error when running :TsuquyomiRenameSymbol
[Tsuquyomi] New symbol name : AppState2Error detected while processing function tsuquyomi#renameSymbol..<SNR>89_renameSymbolWithOptions..<SNR>89_renameLocal:
line 3:
E716: Key not present in Dictionary: /Users/derek/SlideroomGIT/goodprospect2015-ui/src/models/app-state.ts
E15: Invalid expression: s:locs_dict[expand('%:p')]
line 5:
E121: Undefined variable: locations_in_buf
E15: Invalid expression: locations_in_buf
Changed 4 locations.
it is an export class name that I am trying to rename. Let me know if you need other information!
When I save a file it is auto-compiled and checked to show the error list. However it causes a pause. Since I save often this wastes time. Can I disable check-on-save and instead manually issue a command for it?
Would it be possible to add compilation also on save?
Now, tsuquyomi search tsserver from:
tssserver
(globally installed)When project's package.json has the following, tsuquyomi can't get local typescript module.
{
"jspm": {
"directories": {
"baseURL": "src"
},
"dependencies": {
},
"devDependencies": {
"typescript": "npm:[email protected]"
}
}
}
- src/
|- jspm_packages/
|+ github/
|- npm/
|- [email protected]/
|- bin/
| tsc
| tsserver
- package.json
How to automatically show completion menu without explicitly triggering it with shortcut. YouCompleteMe isn't showing suggestion from tsuquyomi. How can i make both of them work together?
when use :TsuquyomiDefinition, how to open new tab?
i read your doc, but i can't find that setting.
https://github.com/Quramy/tsuquyomi/blob/master/doc/tsuquyomi.txt
if possible, please tell me that.
tsuquyomi#tsClient#tsGeterr sometimes miss semantics or syntax diagnostics.
I think that I'm mistaken handling diagnostics' events.
I have a bug that the file type of a Gstatus will be set to typescript erroneously.
Here is my .vimrc
"NeoBundle Scripts-----------------------------
if has('vim_starting')
if &compatible
set nocompatible " Be iMproved
endif
" Required:
set runtimepath+=/home/hao/.vim/bundle/neobundle.vim/
endif
" Required:
call neobundle#begin(expand('/home/hao/.vim/bundle'))
" Let NeoBundle manage NeoBundle
" Required:
NeoBundleFetch 'Shougo/neobundle.vim'
" Essential
NeoBundle 'tpope/vim-fugitive'
NeoBundle 'Shougo/vimproc.vim', {'build' : {'linux' : 'make'}}
NeoBundle 'Quramy/tsuquyomi'
NeoBundle 'bling/vim-airline'
call neobundle#end()
" Required:
filetype off
filetype plugin indent on
" If there are uninstalled bundles found on startup,
" this will conveniently prompt you to install them.
NeoBundleCheck
"End NeoBundle Scripts-------------------------
and here is the step to reproduce the bug:
This bug then becomes more serious because it will detect all other files as typescript.
Is it possible to have the Quickfix window always open full width when there are vertical splits?
Neovim offers the ability to interact with node plugins via a native node background process. Curious if you've looked into it at all as a way to speed up completion? Currently vimproc can get a little slow depending on the project.
This is a similar method to how editors like Atom and VSCode talk to TSS.
related to #55
I found this is a neovim specific issue. Maybe it is not a bug for tsuquyomi.
Minimal set up:
set rtp+=~/.vim/dein/repos/github.com/Shougo/dein.vim/
call dein#begin(expand('~/.vim/dein'))
call dein#add('Shougo/dein.vim')
call dein#add('Shougo/vimproc.vim', {'build': 'make'})
call dein#add('airblade/vim-gitgutter')
call dein#add('Quramy/tsuquyomi')
call dein#end()
filetype plugin indent on
syntax enable
neovim version: NVIM 0.1.3-dev
I cannot reliably reproduce this. Quite strange...
When I save a foo.ts
file I notice it leaves behind the compiled foo.js
file on the hard drive.
I tried setting noEmit: true
and out: /dev/null
in the tsconfig.json
but this behavior still happens.
Any idea why this is happening and how I can stop it?
Would you consider adding support for a command that shows (via an echom
perhaps?) the type of the identifier at the current cursor position?
e.g.
// cursor position shown by '_'
let test_Var = "test";
call the new command, output at the bottom of the window is:
string
Thanks
Running into this error message:
tsuquyomi/autoload/tsuquyomi.vim
Line 56 in 0d24de4
Amusingly with the tsconfig.json
file opened (several times). But there is no TsuquyomiOpen command available :(
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.