Coder Social home page Coder Social logo

Error on first startup about cmp-tabnine HOT 2 CLOSED

tzachar avatar tzachar commented on June 14, 2024
Error on first startup

from cmp-tabnine.

Comments (2)

tzachar avatar tzachar commented on June 14, 2024

Can you try this?

diff --git a/lua/cmp_tabnine/source.lua b/lua/cmp_tabnine/source.lua
index 8317372..13923fc 100644
--- a/lua/cmp_tabnine/source.lua
+++ b/lua/cmp_tabnine/source.lua
@@ -150,10 +150,6 @@ function Source.complete(self, ctx, callback)
        Source._do_complete(ctx)
 end
 
-Source._on_err = function(_, _, _)
-   table.remove(Source.ctx_list, 1)
-end
-
 Source._on_exit = function(_, code)
        -- restart..
        if code == 143 then
@@ -167,7 +163,7 @@ Source._on_exit = function(_, code)
        end
        Source.ctx_list = {}
        Source.job = fn.jobstart({bin, '--client=cmp.vim'}, {
-           on_stderr = Source._on_stderr;
+         on_stderr = nil;
                on_exit = Source._on_exit;
                on_stdout = Source._on_stdout;
        })
@@ -187,7 +183,10 @@ Source._on_stdout = function(_, data, _)
       --   "user_message": [],
       --   "docs": []
       -- }
-   -- dump(data)
+ -- check that we have a context.
+ if #Source.ctx_list == 0 then
+         return
+ end
        local items = {}
        local old_prefix = ""
        local show_strength = conf:get('show_prediction_strength')

from cmp-tabnine.

bangedorrunt avatar bangedorrunt commented on June 14, 2024

@tzachar git apply the patch failed to me so I had to do it manually, it seems the bug is fixed. I did some fresh install and no error shown up. Thank you!

from cmp-tabnine.

Related Issues (20)

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.