Code Monkey home page Code Monkey logo

tsuquyomi's Introduction

Tsuquyomi Build Status Greenkeeper badge

Make your Vim a TypeScript IDE.

capture

Features

Tsuquyomi works as a client for TSServer (which is an editor service bundled into TypeScript). So, installing Tsuquyomi, your vim gets the following features provided by TSServer:

  • Completion (omni-completion)
  • Navigate to the location where a symbol is defined.
  • Show location(s) where a symbol is referenced.
  • Display a list of syntax and semantics errors to Vim quickfix window.
  • and so on,,,

Relevant plugins

Tsuquyomi does not provide syntax-highlight nor indentation. You can use the following Vim plugins for writing .ts:

How to install

Tsuquyomi requires the following:

Install TypeScript

npm -g install typescript

Install Tsuquyomi

Download zip.file from here, or use your favorite Vim plugin manager.

Pathogen

See https://github.com/tpope/vim-pathogen for instructions to install pathogen itself (very simple one-line install, one-line config)

# create bundle folder if it doesn't exist
mkdir -p ~/.vim/bundle

# Install and compile procvim.vim
git clone https://github.com/Shougo/vimproc.vim.git ~/.vim/bundle/vimproc.vim
pushd ~/.vim/bundle/vimproc.vim
make
popd

# Install tsuquyomi
git clone https://github.com/Quramy/tsuquyomi.git ~/.vim/bundle/tsuquyomi

NeoBundle

If you use NeoBundle for Vim plugin management, append the following to your .vimrc:

NeoBundle 'Shougo/vimproc.vim', {
\ 'build' : {
\     'windows' : 'tools\\update-dll-mingw',
\     'cygwin' : 'make -f make_cygwin.mak',
\     'mac' : 'make -f make_mac.mak',
\     'linux' : 'make',
\     'unix' : 'gmake',
\    },
\ }

NeoBundle 'Quramy/tsuquyomi'

And exec :NeoBundleInstall.

(About vimproc installation, please see the original install guide.)

How to use

Completion

Tsuquyomi supports Omni-Completion.

By the default, type <C-x> <C-o> in insert mode, Tsuquyomi shows completions.

Customize completion

You can configure completion with the completeopt option.

If you don't want the popup menu:

autocmd FileType typescript setlocal completeopt-=menu

If you want to show a method's signature in the popup menu, set g:tsuquyomi_completion_detail. Remarks: This option makes completion slow

let g:tsuquyomi_completion_detail = 1

If you want to show a method's signature in the preview window when you complete this method's arguments (default):

(The preview window isn't shown when completion properties or variables)

autocmd FileType typescript setlocal completeopt+=menu,preview

Navigations

Definition

Type <C-]> in normal mode or visual mode, Tsuquyomi navigates to the location where the symbol under the cursor is defined.

Alternatively, call the Ex command :TsuquyomiDefinition or :TsuDefinition. (All Tsuquyomi's commands have aliases with short prefix 'Tsu'.)

And type <C-t> , Tsuquyomi moves the cursor to the location where the last <C-]> was typed.

Type Definition

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

References

Type <C-^> in normal mode or visual mode, Tsuquyomi shows a list of location where the symbol under the cursor is referenced.

Alternatively, call the Ex command :TsuReferences.

If you want where an interface is implemented, use :TsuImplementation.

Keyword search

Call the Ex command :TsuSearch {keyword} to get the list of locations which contain the keyword. This command searches the keyword from opened or referenced files in your project.

The search term minimum length can be configured with let g:tsuquyomi_search_term_min_length = 3.

Disable default mappings

If you do not want to use the above key mappings please add let g:tsuquyomi_disable_default_mappings = 1 to your .vimrc file.

Show compile errors

When a buffer is saved, Tsuquyomi checks syntax and semantics. Alternatively call the Ex command :TsuGeterr. And if it contains errors, Tsuquyomi shows them to Vim quickfix window.

If your use TypeScript v1.6.0 or later, you can use :TsuGeterrProject command. This command shows all compilation errors contained in your project to quickfix window.

Quick fix

If the cursor is on an error and TypeScript's LanguageService has a code fix for this error, call :TsuQuickFix. The code fix will be applied.

Configure compile options

Make tsconfig.json.

For example:

{
  "compilerOptions": {
    "noImplicitAny": true,
    "target": "es5",
    "module": "commonjs"
  }
}

When you change tsconfig.json after opening *.ts files, you should exec :TsuquyomiReloadProject command. So, the changes of tsconfig.json are reflected in the TSServer.

Integrate with syntastic

If you use syntastic, you can use syntastic for displaying syntax and semantics errors instead of vim's default quickfix window. To integrate syntastic, write the following setting to your .vimrc.

let g:tsuquyomi_disable_quickfix = 1
let g:syntastic_typescript_checkers = ['tsuquyomi'] " You shouldn't use 'tsc' checker.

syntastic has default TypeScript checker whose name is 'tsc'. You shouldn't use it with running Tusuquyomi because they don't share compile options. Tusuquyomi's checker whose name is 'tsuquyomi' uses tsserver and your tsconfig.json.

Refactor

Rename symbols

Using the command :TsuRenameSymbol, you can rename the identifier under the cursor to a new name.

If you want to rename identifiers including in comments, you can use :TsuRenameSymbolC command. For example, this command is useful when you want rename opt in the following code:

/**
*
* @param opt
*
**/
var someFunc = (opt: any) => {...};

This feature does not have the default key mapping. If you need, configure your .vimrc . For example:

autocmd FileType typescript nmap <buffer> <Leader>e <Plug>(TsuquyomiRenameSymbol)
autocmd FileType typescript nmap <buffer> <Leader>E <Plug>(TsuquyomiRenameSymbolC)

Tooltip

Tsuquyomi can display tooltip window about symbol under the mouse cursor. If you want to use this feature, configure .vimrc as follows:

set ballooneval
autocmd FileType typescript setlocal balloonexpr=tsuquyomi#balloonexpr()

The ballonexpr option is not available in terminal Vim. So, Tsuquyomi also provides a tooltip function tsuquyomi#hint().

For example:

autocmd FileType typescript nmap <buffer> <Leader>t : <C-u>echo tsuquyomi#hint()<CR>

The above example works in terminal Vim.

Unite sources

Tsuquyomi provides some unite sources.

Show project information(a source of unite)

Execute the following command, your project information is displayed.

:Unite tsproject

The project information contains:

  • tsconfig.json which the current buffer use.
  • .ts(or .tsx) source files which TypeScript compiles. These files are determined by tsconfig.json

This feature requires [email protected] or later.

Show outline(an extension of unite-outline)

This feature requires Vim plugins:

If you have installed these plugins, calling the following Ex command, the outline of the current buffer is displayed.

:Unite outline

Use TypeScript installed locally

By the default, Tsuquyomi searches locally installed TypeScript. If not hit, Tsuquyomi uses TypeScript installed globally.

And execute the following command, you can confirm the path of tsserver:

:echo tsuquyomi#config#tsscmd()

Create es6 import declaration

It's highly experimental

For example, if your buffer is the following state:

readFile('hoge', 'utf-8', (err, content) => {
  if(!err) console.log(content);
});

Move cursor onto readFile and call :TsuImport, so Tsuquyomi appends the import declaration.

import { readFile } from 'fs';
readFile('hoge', 'utf-8', (err, content) => {
  if(!err) console.log(content);
});

To allow Tsuquyomi to import the shortest path instead of the complete one (where the initial module declaration is) one, put this in your .vimrc:

let g:tsuquyomi_shortest_import_path = 1

For example, if your project has the following 2 files, the plugin will use: import { foo } from './lib'; instead of: import { foo } from './lib/foo';.

/* lib/index.ts */
export * from './foo';
/* lib/foo.ts */
export const foo = 'FOO'

More details

If you want more details, please see doc.

Contribute

How to test

Prepare test

cd test/
yarn install
cd ..

Run test cases

# Run all test cases with all supported TypeScript version
./runtest-all-ts.sh

# Run all test cases with the latest TypeScript version
./runtest.sh

# Run all test cases with the specified TypeScript version
VERSION=2.3 ./runtest.sh

# Run a test file
./run-one-test.sh test/path/to/test.spec.vim

# Run a test file with the specified TypeScript version
VERSION=2.3 ./run-one-test.sh

License

MIT

tsuquyomi's People

Contributors

ajcrites avatar bobrippling avatar dannysu avatar donniewest avatar greenkeeper[bot] avatar gurdiga avatar heavenshell avatar ichizok avatar icholy avatar jasonharrison avatar joshuavial avatar lumakernel avatar m5oul avatar majecty avatar mattn avatar mrpeabody avatar myitcv avatar nickspoons avatar oliverjash avatar ondrowan avatar op avatar pocke avatar quramy avatar rcarraretto avatar remyoudemans avatar rhysd avatar thinca avatar vlebedeff avatar willfrew avatar ymgch avatar

Stargazers

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

Watchers

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

tsuquyomi's Issues

TsuquyomiGoBack not working

TsuquyomiDefinition works successfully, but subsequent TsuquyomiGoBack does not and messages "[Tsuquyomi] No items in navigation stack... "

Command :TsuquyomiOpen does not exist?

Running into this error message:

echom '[Tsuquyomi] Buffers ['.join(not_opend, ', ').'] are not opened by TSServer. Please exec command ":TsuquyomiOpen '.join(not_opend).'" and retry.'

Amusingly with the tsconfig.json file opened (several times). But there is no TsuquyomiOpen command available :(

Implement "retry" to request to TSServer

Problem:

  • Call tsOpen .
  • Immediately, call some commands(e.g. 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.

tsuquyomi#open() does not work well

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.

Support for tsconfig filesGlob

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?

Error in Rename Symbol

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!

Cannot find interfaces if definition file is in the same path as ts file

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.

Support "tooltip" in terminal vim.

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?

file type bug with fugitive

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:

  1. open a .tsx file
  2. :Gst
    You'll find the .git/index buffer is detected as typescript.

This bug then becomes more serious because it will detect all other files as typescript.

Cannot compile external modules unless the --module flag is provided

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?

Error coming up with latest release in neovim

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?

Searching for contextual tsserver.js

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.

  • add an option to search tsserver.js installed locally

Scratch File Created on Completion

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.
screen shot 2015-12-18 at 9 05 02 pm
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 :)

Search local executable tsserver under jspm env

Now, tsuquyomi search tsserver from:

  1. ./node_modules/typescript (locally installed)
  2. 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

Support [email protected]

  • add new commands(projectInfo, reloadProjects, geterrForProject)
  • add new unite source with projectInfo

False warning of experimentalDecorators

Hey there. So it seems that in my current projects tsconfig is being ignored for a project

screen shot 2016-01-23 at 8 14 59 am

screen shot 2016-01-23 at 8 15 10 am

Any time I use an experimental decorator, I get a warning, even though I have the compiler option for decorators enabled. Any ideas?

Omni-complete on Object Properties

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?

screen shot 2015-12-18 at 8 54 04 pm

Is there a way to disable check-on-save?

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?

Support for showing the type of the identifier under the cursor

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

Tries to compile fugitive buffer

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).

tsx files no longer working

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?

Autocompletion with YouCompleteMe

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?

Local tsserver checks for JS instead of script

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.

Support for definitions by referance

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?

How to use with pathogen?

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 :-)

Rename identifiers in comments

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.

Cleanup compiled files

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?

tsuquyomi hangs when used with fugutive in neovim

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...

Disable quickfix?

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.

Error in Ubuntu TSServer not found when installed. Node 4.x. Neovim

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)

Tsuquyomi doesn't pick up new file settings correctly

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?

Add "go back" command

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).

Add the outline feature

Add the outline feature.

Tasks:

  • Implement a client method that calls navbar
  • Implement a extension of unite-outline.

File changes not being picked up

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

Error occurred with huge type definition files

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

  • vim 7.4.936 (installed from homebrew)
  • Mac OS X 10.11.1
  • Terminal.app
  • See vimrc in repository for neobundle setting

Showing type information instead of `import` in `tsuquyomi#hint`

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?

Recommend Projects

  • React photo React

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

  • Vue.js photo Vue.js

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

  • Typescript photo Typescript

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

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

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

  • web

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

  • server

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

  • Machine learning

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

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

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

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.