Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Quramy
Copy link
Owner

@Quramy Quramy commented May 11, 2017

provide tsuquyomi#getCompletion function for #140.

@Quramy
Copy link
Owner Author

Quramy commented May 11, 2017

@prabirshrestha

You can create asyncomplete#sources#tsuquyomi#completor with tsuquyomi#getCompletion function.

I've checked the operation via the following code:

function s:ts_comp(opt, ctx)
  call tsuquyomi#getCompletions({candidates, startcol ->
         \ asyncomplete#complete('typesctipt', a:ctx, startcol, candidates)
         \ })

endfunction

call asyncomplete#register_source({
    \ 'name': 'tsuquyomi',
    \ 'whitelist': ['typescript'],
    \ 'priority': 5,
    \ 'completor': function('s:ts_comp'),
    \ })

How about it ?

endfunction

function tsuquyomi#getCompletions(callback)
if tsuquyomi#statusServer() == 'dead'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the server has not started is it still considered dead?

@prabirshrestha
Copy link

looks good but some comments here.

  • asyncomplete#complete('typesctipt', should beasyncomplete#complete('tsuquyomi', since that is the name you used.
  • rather than checking if tsuquyomi#statusServer() == 'dead' is it possible to know if the tsserver has been initialized instead. Initializing tsserver for large code base is slow. so the first time I type vim in unresponsive for few seconds since tsuquyomi is not completly async and then once it has been initialized the completion is fast.

@prabirshrestha
Copy link

Seems like even saving a file for a big project has this issue. So I don't think anything can be done now to fix the initial unresponsiveness unless it is moved to full async implmentation.

PR looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants