Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use status suffix from json.short #305

Merged
merged 1 commit into from Oct 5, 2020
Merged

Use status suffix from json.short #305

merged 1 commit into from Oct 5, 2020

Conversation

@tonycheang
Copy link
Contributor

@tonycheang tonycheang commented Oct 2, 2020

Addresses kiteco/kiteco#11798 for vim

What was done

We removed model warmup and added a new status for when models are warming up. I considered adding a simple

if status == 'initializing'
  let msg = 'Kite: initializing'
endif

but this seemed a little more flexible from a future changes standpoint (text is also harder to synchronize between editors if each editor switches off the status response). The endpoint has been returning { status, short, long }, where short is ready | indexing | initializing | ready (no index) | unsupported | disabled, for long while now, so I don't think this would break anything for users not on the most recent version of Kite.

Kind of a separate question: does kite#statusline() integrate with lightline on neovim? Wanted to manually test this, but had some trouble with that, so I ended up just doing some string checking instead.

@tonycheang tonycheang requested a review from airblade Oct 2, 2020
@airblade
Copy link
Contributor

@airblade airblade commented Oct 5, 2020

Looks good to me and works at my end.

...does kite#statusline() integrate with lightline on neovim?

It should do. I'm not too familiar with lightline but you just need to get it to call kite#statusline(). Maybe something like this (untested):

let g:lightline = {
      \ 'active': {
      \   'left': [ [ 'mode', 'paste' ],
      \             [ 'kite', 'readonly', 'filename', 'modified' ] ]
      \ },
      \ 'component_function': {
      \   'kite': 'kite#statusline'
      \ },
      \ }

Alternatively if you're manipulating the status line directly, do set statusline+=%{kite#statusline()}.

@tonycheang tonycheang merged commit ea90a11 into master Oct 5, 2020
1 check passed
1 check passed
Travis CI - Pull Request Build Passed
Details
@tonycheang tonycheang deleted the kited-status branch Oct 5, 2020
@tonycheang
Copy link
Contributor Author

@tonycheang tonycheang commented Oct 5, 2020

Oh thanks, that works! I might've been testing in a js file without js enabled (oops).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.