Giter VIP home page Giter VIP logo

company-tabnine's Introduction

company-tabnine

MELPA

TabNine is the all-language autocompleter. It uses machine learning to provide responsive, reliable, and relevant suggestions.

company-tabnine provides TabNine completion backend for company-mode. It takes care of TabNine binaries, so installation is easy.

screenshot screenshot-deep-1 screenshot-deep-2 screenshot-deep-3

Installation

  1. Make sure company-mode is installed and configured.

  2. Install company-tabnine. This package is part of MELPA.

    Note: See https://melpa.org/#/getting-started for MELPA usage. Make sure to use the "bleeding-edge" repository instead of MELPA stable.

    • With use-package

      Put the following in your config:

      (use-package company-tabnine :ensure t)
    • With package.el (built-in)

      Install the package:

      M-x package-install RET company-tabnine RET

      Put the following in your config:

      (require 'company-tabnine)
  3. Add company-tabnine to company-backends

    (add-to-list 'company-backends #'company-tabnine)
  4. Run M-x company-tabnine-install-binary to install the TabNine binary for your system.

Recommended Configuration

Below are some recommended company-mode configuration that works well with company-tabnine.

;; Trigger completion immediately.
(setq company-idle-delay 0)

;; Number the candidates (use M-1, M-2 etc to select completions).
(setq company-show-numbers t)

Usage

company-tabnine should work out of the box.

See M-x customize-group RET company-tabnine RET for customizations.

Auto-balance parentheses

TabNine can automatically balance parentheses, by removing and adding closing parentheses after the cursor. See the examples here.

Note: The automatically-balancing happens in company's post-completion hook. However, company-tng-frontend actually suppresses this hook. In order to use automatic parentheses balancing, you need to manually call company-complete-selection or similar commands in this case, which will almost always happen if you do not use company-tng-frontend.

Known Issues

  • company-transformers or plugins that use it (such as company-flx-mode) can interfere with TabNine's sorting. If this happens, put the following temporary workaround in your config:

    ;; workaround for company-transformers
    (setq company-tabnine--disable-next-transform nil)
    (defun my-company--transform-candidates (func &rest args)
      (if (not company-tabnine--disable-next-transform)
          (apply func args)
        (setq company-tabnine--disable-next-transform nil)
        (car args)))
    
    (defun my-company-tabnine (func &rest args)
      (when (eq (car args) 'candidates)
        (setq company-tabnine--disable-next-transform t))
      (apply func args))
    
    (advice-add #'company--transform-candidates :around #'my-company--transform-candidates)
    (advice-add #'company-tabnine :around #'my-company-tabnine)
  • Spacemacs configurations can override the settings for company-backends.

  • Conflict with ESS: See emacs-ess/ESS#955

  • TabNine's local deep learning completion might be enabled by default. It is very CPU-intensive if your device can't handle it. You can check by typing "TabNine::config" in any buffer (your browser should then automatically open to TabNine's config page) and disable Deep TabNine Local (you will lose local deep learning completion).

company-tabnine's People

Contributors

alanpearce avatar cireu avatar kisaragi-hiu avatar matthewzmd avatar nanjj avatar shuxiao9058 avatar tommyx12 avatar xqliu avatar yqrashawn 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

company-tabnine's Issues

Inline/full-function completions?

Hi, I'm wondering how we might go about getting multi-line, full-function completions from tabnine into emacs: https://www.tabnine.com/blog/introducing-inline-code-completions/

I've searched around and found no mention of it, and I suppose company might have a one-line limitation to its functionality though I don't know.

I've only just started using tabnine this month and decided to keep on with it for now, but would like to get more out of it of course.

Cheers for the elisp!

'Cannot complete at point' every time when 'M-x company-tabnine' is run

After following the instructions in the README-file, doing M-x company-tabnine does not bring up a completion, but instead shows the message Cannot complete at point in the minibuffer.

It seems like the client is communicating with the server, as typing TabNine::config brings up the configuration page in the browser, TabNine::sem shows the Semantic completion enabled. message and so on.

The TabNine server started.-message is the only other one to show up in the Messages-buffer after starting company-tabnine.

I am quite lost and nothing I try to do to fix this seems to work. If there are any details you would need to resolve this, I am happy to send them.

Thank you

tabnine is not triggered automatically

I'm not sure if it's on purpose but tabnine is not triggered automatically.
After following the install instructions, if I call the company-tabnine function then it works, but it's not called when I just type, like normal auto-completion.

Is there some setting I am missing or something I misunderstood?

Support starting TabNine through a wrapper script

Hi there,

I'd like to run TabNine through a wrapper script, to change a few things:

  • limit max CPU and memory that can be used by TabNine
  • adjust OOM score so that the Linux OOM kills TabNine instead of my web browser when I'm running tests that use tons of Docker containers...

Right now it's not easy to do. Would it be possible to change the way that TabNine is started so that it's easier to override?
Thanks!

How can I fix this problem?

Company: backend company-tabnine error "Wrong number of arguments: #, 5" with args (prefix)

The package is now the newest now.
And My Operation System is
Windows 7, emacs27

Semantic completion not working with `clangd`

I have followed the steps in the README to set up TabNine, and while it does work by itself, it does not seem to work with lsp-mode and clangd, even after typing TabNine::sem. I'm not sure what the issue is, since the *Messages* buffer, etc. do not report any errors. Please let me know how I can provide more info to help fix this.

Edit: For context, I'm on macOS 11, Emacs 28 w/ native-comp, using my own config (not Doom or Spacemacs).

Company-tabnine can't be activated at all.

On Ubuntu 20.04, I use the following settings:

(use-package company
  :config
    (global-company-mode)
  :custom
  (company-dabbrev-downcase nil) 
  (company-idle-delay 0) 
  (company-minimum-prefix-length 1)
  (company-tooltip-align-annotations t)
  (company-dabbrev-other-buffers t) ; search buffers with the same major mode
  (company-selection-wrap-around t)
    :bind (:map company-active-map
                ("C-n" . company-select-next)
                ("C-p" . company-select-previous)
                ("C-s" . company-filter-candidates)
                ("<tab>" . company-complete-selection))
    :bind (:map company-search-map
                ("C-n" . company-select-next)
                ("C-p" . company-select-previous))
  
 )

;https://github.com/TommyX12/company-tabnine
;Run M-x company-tabnine-install-binary to install the TabNine binary for your system.
(use-package company-tabnine)
(add-to-list 'company-backends #'company-tabnine)
;; Trigger completion immediately.
(setq company-idle-delay 0)
;; Number the candidates (use M-1, M-2 etc to select completions).
(setq company-show-numbers t)


(use-package eglot
  :hook 
  ((TeX-mode . eglot-ensure))
  :config
  ;https://github.com/joaotavora/eglot/issues/708#issuecomment-868616833
  (add-to-list 'eglot-stay-out-of 'company)
  ;;; ensure texlab is set as the server.
  (add-to-list 'eglot-server-programs
             '((latex-mode tex-mode context-mode texinfo-mode bibtex-mode) . ("texlab"))))

But it seems that the company-tabnine can't be activated at all. See the screenshot for more detailed info:

image

Any hints for this problem?

Regards,
HY

Type TabNine::sem to enable semantic completion on JavaScript

Fedora 34 XFCE,
npm 6.14.13
node v14.17.0
Emacs 27
Company and company-tabnine
Have installed typescript-language-server globally and ran it with: typescript-language-server --stdio
Also, the message on the echo area is too long to read, and even though the server is running, same message appears...

speed

I run "M-x company-tabnine-install-binary RET" in my emacs.But it always displays "TabNine installation complete".

Enable downloading static Linux binary

Following up to codota/TabNine#36 (comment) (summary: a statically-linked binary is now available for systems where dynamic linking is unavailable or the standard library is in the standard include path, e.g. NixOS).

It should be possible to install and use this new binary. I'm happy to submit a PR for this, the only question is whether there should be some auto-detection (which would only detect NixOS until someone else runs into the issue) or to add a config option that would need to be set before calling company-tabnine-install-binary.

Emacs package-install says "No match"

I'm following the README installation instructions "M-x package-install RET company-tabnine RET" but it just says "No match". Is there some repository I need to add? I'm using
GNU Emacs 25.2.2 (x86_64-pc-linux-gnu, GTK+ Version 3.22.21)

Error running timer ‘company-echo-show’

Error running timer ‘company-echo-show’: (error "Company: backend company-tabnine error "Invalid function: (messages (alist-get 'promotional_message company-tabnine--result))" with args (meta Singleton)")

My configuration:

(use-package company
        :demand
        :ensure t
        :hook ((after-init . global-company-mode))
        :config
        ;; Trigger completion immediately.
        (setq company-idle-delay 0)

        ;; Number the candidates (use M-1, M-2 etc to select completions).
        (setq company-show-numbers t)

        ;; Use the tab-and-go frontend.
        ;; Allows TAB to select and complete at the same time.
        (company-tng-configure-default)
        (setq company-frontends
              '(company-tng-frontend
                company-pseudo-tooltip-frontend
                company-echo-metadata-frontend)))

(use-package company-tabnine
        :ensure t
        :config
        (add-to-list 'company-backends #'company-tabnine))

Screenshot:

skarmavbild 2018-11-13 kl 10 52 32

Error while complete file path

Debugger entered--Lisp error: (json-string-format "?\\C-@")
  signal(json-string-format ("?\\C-@"))
  json-read-string()
  json-read()
  json-read-object()
  json-read()
  json-read-array()
  json-read()
  json-read-object()
  json-read()
  json-read-from-string("{\"suffix_to_substitute\":\"B\",\"results\":[{\"result\":\"Bee.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"BitBar.app\",\"prefix_to_substitute\":\"\"},
{\"result\":\"Boom 3D.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Blender.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"BearyChat.app\",\"prefix_to_substitute\":\"\"},
{\"result\":\"Basecamp 3.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Blenderplayer.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Backup and Sync.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"iBooks.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"qBittorrent.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"AnyBar.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"KextBeast.pkg\",\"prefix_to_substitute\":\"\"},
{\"result\":\"Font Book.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"MultiBeast.app\",\"prefix_to_substitute\":\"\"},
{\"result\":\"Photo Booth.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Kitematic (Beta).app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Robo 3T.app\",\"prefix_to_substitute\":\"\"},
{\"result\":\"Sublime Text.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Tongbu.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Numbers.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Keybase.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Dropbox.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Tweetbot.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Cakebrew.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Enjoyable.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Dashboard.app\",\"prefix_to_substitute\":\"\"},
{\"result\":\"Geekbench 4.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Keyboard Maestro.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Karabiner-Elements.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Karabiner-EventViewer.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Sketch Toolbox.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"NativeDisplayBrightness.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"YY.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Sketch.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Setapp.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Safari.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Remacs.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Reeder.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Photos.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"IDLE 3.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Flinto.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Dota 2.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Docker.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Deluge.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"ClashX.app\",\"prefix_to_substitute\":\"\"},{\"result\":\".localized\",\"prefix_to_substitute\":\"\"},{\"result\":\"Thunder.app\",\"prefix_to_substitute\":\"\"},
{\"result\":\"Textua")
  company-tabnine--decode("{\"suffix_to_substitute\":\"B\",\"results\":[{\"result\":\"Bee.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"BitBar.app\",\"prefix_to_substitute\":\"\"},
{\"result\":\"Boom 3D.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Blender.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"BearyChat.app\",\"prefix_to_substitute\":\"\"},
{\"result\":\"Basecamp 3.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Blenderplayer.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Backup and Sync.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"iBooks.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"qBittorrent.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"AnyBar.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"KextBeast.pkg\",\"prefix_to_substitute\":\"\"},
{\"result\":\"Font Book.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"MultiBeast.app\",\"prefix_to_substitute\":\"\"},
{\"result\":\"Photo Booth.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Kitematic (Beta).app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Robo 3T.app\",\"prefix_to_substitute\":\"\"},
{\"result\":\"Sublime Text.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Tongbu.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Numbers.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Keybase.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Dropbox.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Tweetbot.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Cakebrew.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Enjoyable.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Dashboard.app\",\"prefix_to_substitute\":\"\"},
{\"result\":\"Geekbench 4.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Keyboard Maestro.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Karabiner-Elements.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Karabiner-EventViewer.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Sketch Toolbox.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"NativeDisplayBrightness.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"YY.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Setapp\",\"prefix_to_substitute\":\"\"},{\"result\":\"mpv.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Paw.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Siri.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Maps.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Mail.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Logitech\",\"prefix_to_substitute\":\"\"},{\"result\":\"IINA.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"IDLE.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Folx.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Flux.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Dash.app\",\"prefix_to_substitute\":\"\"},{\"result\":\".gitkeep\",\"prefix_to_substitute\":\"\"},{\"result\":\"iTerm.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Xcode.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Utilities\",\"prefix_to_substitute\":\"\"},{\"result\":\"Surge.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Steam.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Spark.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Slack.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Pages.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Notes.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Marta.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Lumen.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Ivacy.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Eudic.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Emacs.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Chess.app\",\"prefix_to_substitute\":\"\"},{\"result\":\".DS_Store\",\"prefix_to_substitute\":\"\"},{\"result\":\"iTunes.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"WeChat.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"V2RayX.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Sketch.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Setapp.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Safari.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Remacs.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Reeder.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Photos.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"IDLE 3.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Flinto.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Dota 2.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Docker.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Deluge.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"ClashX.app\",\"prefix_to_substitute\":\"\"},{\"result\":\".localized\",\"prefix_to_substitute\":\"\"},{\"result\":\"Thunder.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Textua")
  company-tabnine--process-filter(#<process company-tabnine--process> "{\"suffix_to_substitute\":\"B\",\"results\":[{\"result\":\"Bee.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"BitBar.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Boom 3D.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Blender.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"BearyChat.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Basecamp 3.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Blenderplayer.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Backup and Sync.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"iBooks.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"qBittorrent.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"AnyBar.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"KextBeast.pkg\",\"prefix_to_substitute\":\"\"},{\"result\":\"Font Book.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"MultiBeast.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Photo Booth.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Kitematic (Beta).app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Robo 3T.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Sublime Text.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Tongbu.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Numbers.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Keybase.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Dropbox.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Tweetbot.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Cakebrew.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Enjoyable.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Dashboard.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Geekbench 4.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Keyboard Maestro.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Karabiner-Elements.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Karabiner-EventViewer.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Sketch Toolbox.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"NativeDisplayBrightness.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"YY.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Setapp\",\"prefix_to_substitute\":\"\"},{\"result\":\"mpv.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Paw.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Siri.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Maps.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Mail.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Logitech\",\"prefix_to_substitute\":\"\"},{\"result\":\"IINA.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"IDLE.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Folx.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Flux.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Dash.app\",\"prefix_to_substitute\":\"\"},{\"result\":\".gitkeep\",\"prefix_to_substitute\":\"\"},{\"result\":\"iTerm.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Xcode.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Utilities\",\"prefix_to_substitute\":\"\"},{\"result\":\"Surge.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Steam.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Spark.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Slack.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Pages.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Notes.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Marta.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Lumen.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Ivacy.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Eudic.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Emacs.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Chess.app\",\"prefix_to_substitute\":\"\"},{\"result\":\".DS_Store\",\"prefix_to_substitute\":\"\"},{\"result\":\"iTunes.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"WeChat.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"V2RayX.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Sketch.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Setapp.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Safari.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Remacs.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Reeder.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Photos.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"IDLE 3.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Flinto.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Dota 2.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Docker.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Deluge.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"ClashX.app\",\"prefix_to_substitute\":\"\"},{\"result\":\".localized\",\"prefix_to_substitute\":\"\"},{\"result\":\"Thunder.app\",\"prefix_to_substitute\":\"\"},{\"result\":\"Textua")
  accept-process-output(#<process company-tabnine--process> 0.25)
  company-tabnine-send-request((:version "0.11.1" :request (:Autocomplete (:before "                [:open_bracket [:!Tx :!T9 :open_bracket]]\n                 [:close_bracket [:!Tx :!T9 :close_bracket]]]}\n        {:des \"Vi Mode [D as Trigger Key]\"\n         :rules [:vi-mode\n                 [:##j :down_arrow]\n                 [:##k :up_arrow]\n                 [:##h :left_arrow]\n                 [:##l :right_arrow]\n                 [:##b :!Oleft_arrow]\n                 [:##w :!Oright_arrow]\n                 [:##0 :!Ta]\n                 [:##4 :!Te]]}\n        {:des \"Vi Visual Mode\"\n         :rules [:vi-visual-mode\n                 [:##j :!Sdown_arrow]\n                 [:##k :!Sup_arrow]\n                 [:##h :!Sleft_arrow]\n                 [:##l :!Sright_arrow]\n                 [:##b :!SOleft_arrow]\n                 [:##w :!SOright_arrow]\n                 [:##0 :!SCleft_arrow]\n                 [:##4 :!SCright_arrow]\n                 [:##open_bracket :!SOup_arrow]\n                 [:##close_bracket :!SOdown_arrow]]}\n        {:des \"Emacs switch buffer\"\n         :rules [:Emacs\n                 [:tab :!Ttab :period-mode]\n                 [:tab :!TStab :comma-mode]]}\n        {:des \"launcher mode\"\n         :rules [:launch-mode\n                 [:j [:open \"/Applications/Alacritty.app\"]]\n                 [:k [:open \"/Applications/Emacs.app\"]]\n                 [:l [:open \"/Applications/Google Chrome Canary.app/\"]]\n                 [:m [:open \"/Applications/Mail.app\"]]\n                 [:v [:open \"/Applications/WeChat.app\"]]\n                 [:q [:open \"/Applications/Karabiner-Elements.app\"]]\n                 [:f [:open \"/Applications/Finder.app\"]]\n                 [:9 [:open \"/Applications/PDF Expert.app\"]]\n                 [:comma [:open \"/Applications/Safari.app\"]]\n                 [:h [:open \"/Applications/Bee.app\"]]\n                 [:period [:open \"/Applications/Paw.app\"]]\n                 [:equal_sign [:open \"/Applications/Textual.app\"]]\n                 [:8 [:open \"/Applications/Karabiner-EventViewer.app\"]]\n                 [:b [:launch \"/Applications/B" :after "\"]]\n                 [:c [:launch \"VSCode\"]]\n                 [:t [:launch \"2do\"]]\n                 [:r [:launch \"Timing\"]]\n                 ;; [:t [:launch \"Pagico\"]]\n                 #_[:l [:!Cgrave_accent_and_tilde] :Chromes]\n                 [:d [{:key :n :modi [:right_option]} {:key :d :modi [:right_option]} {:key :b :modi [:right_option]} :return_or_enter]]]}\n        {:des \"caps_lock\"\n         :rules [[:##caps_lock :left_control nil {:alone :escape}]]}\n        {:des \"HHKB, FILCO MINILA Change left control to esc if alone\"\n         :rules [[:##left_control :left_control [:hhkb-bt :hhkb :hhkb-tmk :filco-minila] {:alone :escape}]]}\n        {:des \"Change right_command to command-tab when used alone\"\n         :rules [[:right_command :right_command nil {:alone [:!Ctab]}]\n                 [:application :right_command nil {:alone [:!Ctab]}]]}\n        {:des \"Change left_option to f18 when used alone\"\n         :rules [[:left_option :left_option nil {:alone [:f18]}]]}\n        {:des \"Quit application by pressing command-q twice\"\n         :rules [[:!C#Pq [:!Cq [\"command-q\" 0]] [\"command-q\" 1]]\n                 [:!C#Pq [\"command-q\" 1] nil {:delayed {:invoked [\"command-q\" 0] :canceled [\"commandq\" 0]}}]]}\n        {:des \"Change right_option to switch to second recent application when used alone\"\n         :rules [[:right_option :right_option nil {:alone [\"osascript ~/Dropbox/sync/Automator/switch-to-second-previous-app.scpt\"]}]]}\n        {:des \"some simultaneous keys\"\n         :rules [[[:h :l] [:alf \"helpSearch\" \"com.tedwise.menubarsearch\"]]\n                 [[:j :l] [:f19 [\"in-alfred\" 1]]]]}\n        {:des \"alfred mode\"\n         :rules [[:l :!COi :browsers-alfred-mode]\n                 [:l :!CTslash [:finder-alfred-mode [\"in-alfred\" 1]]]\n                 :alfred-mode\n                 [:h [[:alf \"search repos\" \"me.lachlan.githubjump\"] [\"in-alfred\" 1]]]\n                 [:j [:alf \"searchGithub\" \"nikivi.search-the-web\"]]\n                 [:return_or_enter [:alf \"web searches\" \"nik" :filename "/Users/yqrashawn/.config/karabiner.edn" :region_includes_beginning :json-false :region_includes_end :json-false :max_num_results 10))))
  company-tabnine-query()
  company-tabnine(prefix)
  apply(company-tabnine prefix)
  company-call-backend-raw(prefix)
  apply(company-call-backend-raw prefix)
  company--force-sync(company-call-backend-raw (prefix) company-tabnine)
  company-call-backend(prefix)
  company--begin-new()
  company--perform()
  company-auto-begin()
  company-idle-begin(#<buffer karabiner.edn> #<window 24 on *scratch*> 82662 7583)
  apply(company-idle-begin (#<buffer karabiner.edn> #<window 24 on *scratch*> 82662 7583))
  timer-event-handler([t 23592 9312 622957 nil company-idle-begin (#<buffer karabiner.edn> #<window 24 on *scratch*> 82662 7583) nil 0])

message buffer

error in process filter: json-read-string: Bad string format: "?\\C-@"
error in process filter: Bad string format: "?\\C-@"
error in process filter: Unrecognized keyword: "te" [2 times]
error in process filter: json-read: JSON readtable error: 115
error in process filter: JSON readtable error: 115
error in process filter: json-read-string: Bad string format: "?\\C-@"
error in process filter: Bad string format: "?\\C-@"
error in process filter: json-read: JSON readtable error: 95
error in process filter: JSON readtable error: 95
Company: An error occurred in auto-begin
Company: backend company-tabnine error "Wrong type argument: listp, "},{"" with args (prefix)

Treat periods as part of a word in nix-mode

Even after running
(modify-syntax-entry ?. “w” nix-mode-syntax-table),
if I type “msmtp” and get completion options like “msmtp.enable = true;” but then enter a period, the completion pop-up closes. Instead, I would have liked to filter to options of the form “msmtp.*”

Error running timer ‘company-echo-show’

My config:

;; tabnine
(use-package company :ensure t)
(add-hook 'after-init-hook 'global-company-mode)
(use-package company-tabnine :ensure t)
(add-to-list 'company-backends #'company-tabnine)
;; Trigger completion immediately.
(setq company-idle-delay 0)

;; Number the candidates (use M-1, M-2 etc to select completions).
(setq company-show-numbers t)

;; Use the tab-and-go frontend.
;; Allows TAB to select and complete at the same time.
(company-tng-configure-default)

Steps to reproduce:
Just type something and an error message with popup.

Error running timer ‘company-echo-show’: (error "Company: backend company-tabnine error \"Invalid function: (messages (alist-get (quote promotional_message) company-tabnine--result))\" with args (meta that)")

Should be disabled in strings and comments

Many company backends disable themselves when the user is editing a comment or a string. With company-tabnine, whenever I edit a comment, I get completion suggestions after every word. Is it possible to disable this behavior?

Error when trying to install tabnine binary on Apple M1

Description

When trying to install tabnine binary via company-tabnine-install-binary, the log shows

Installing at ~/.TabNine/3.2.28/i686-apple-darwin/TabNine. Downloading https://update.tabnine.com/3.2.28/i686-apple-darwin/TabNine ...
Wrote /Users/xqianliu/.TabNine/3.2.28/i686-apple-darwin/TabNine
TabNine installation complete.

But when I check content of file TabNine, it shows

<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>403 Forbidden</title></head>
<body>
<h1>403 Forbidden</h1>
<ul>
<li>Code: AccessDenied</li>
<li>Message: Access Denied</li>
<li>RequestId: 5CFD4148C692BBAA</li>
<li>HostId: ZzelKDLGX9jtSqMMbP1c4qcpIwp15Xi9jeNdHoGwDp45Ugj8cwx/Y+Kpxyf3aAk4E8gXkqvUVJg=</li>
</ul>
<h3>An Error Occurred While Attempting to Retrieve a Custom Error Document</h3>
<ul>
<li>Code: AccessDenied</li>
<li>Message: Access Denied</li>
</ul>
<hr/>
</body>
</html>

Operation system: Apple M1 11.01

Seems i686 was returned as arch here

[Question] company-tabnine-always-trigger

I'm curious what the rationale behind adding this behavior was. It makes things like using pdb(lots of one-letter commands) very difficult, because I have to cancel the completion for everything.

json-read: JSON readtable error: 101

Message
TabNine process restart limit reached.
TabNine server started.
Company: An error occurred in auto-begin
Company: backend company-tabnine error "Process company-tabnine--process not running" with args (prefix)
error in process filter: json-read: JSON readtable error: 101
error in process filter: JSON readtable error: 101
TabNine process # received event "exited abnormally with code 126

M-x toggle-debug-on-error
Debugger entered--Lisp error: (error "Process company-tabnine--process not running")
process-send-string(# "{"version":"1.0.14","request":{"Autocomplete":{"before":"#inclcj","after":"\n#include \"apue.h\"\n#include <fcntl.h>\nchar buf1[]=\"abcdefghij\";\nchar buf2[]=\"ABCDEFGHIJ\";\nint main(void)\n{\n int fd;\n if ((fd=creat(\"file.hole\",FILE_MODE)) < 0)\n err_sys(\"creat error\");\n if (write(fd,buf1,10) != 10)\n err_sys(\"buf1 write error\");\n if (lseek(fd,16394,SEEK_SET) == -1)\n err_sys(\"lseek error\");\n if (write(fd,buf2,10) != 10)\n err_sys(\"buf2 wirte error\");\n exit(0);\n}\n","filename":"/usr/home/tu/.block/c/UNIX/3-2.c","region_includes_beginning":true,"region_includes_end":true,"max_num_results":10}}}\n")
company-tabnine-send-request((:version "1.0.14" :request (:Autocomplete (:before "#inclcj" :after "\n#include "apue.h"\n#include <fcntl.h>\nchar buf1[]="abcdefghij";\nchar buf2[]="ABCDEFGHIJ";\nint main(void)\n{\n int fd;\n if ((fd=creat("file.hole",FILE_MODE)) < 0)\n err_sys("creat error");\n if (write(fd,buf1,10) != 10)\n err_sys("buf1 write error");\n if (lseek(fd,16394,SEEK_SET) == -1)\n err_sys("lseek error");\n if (write(fd,buf2,10) != 10)\n err_sys("buf2 wirte error");\n exit(0);\n}\n" :filename "/usr/home/tu/.block/c/UNIX/3-2.c" :region_includes_beginning t :region_includes_end t :max_num_results 10))))
company-tabnine-query()
company-tabnine--prefix()
company-tabnine(prefix)
apply(company-tabnine prefix)
company-call-backend-raw(prefix)
apply(company-call-backend-raw prefix)
company--force-sync(company-call-backend-raw (prefix) company-tabnine)
company-call-backend(prefix)
company--begin-new()
company--perform()
company-auto-begin()
company-idle-begin(#<buffer 3-2.c> #<window 3 on 3-2.c> 256 8)
apply(company-idle-begin (#<buffer 3-2.c> #<window 3 on 3-2.c> 256 8))
timer-event-handler([t 24272 37450 304347 nil company-idle-begin (#<buffer 3-2.c> #<window 3 on 3-2.c> 256 8) nil 875000])

what can i do to solve the problem

Something wrong with the vertical alignment on 'x%'

Hey there, I just installed this package and latest company-mode(20210527.1610), but there's something wrong with the vertical alignment as below,

image

I tried to search some fixes but they don't help...Can you please help with this?
Thanks!

company-tabnine-install-binary doesn't install binaries

Running Archlinux through VB, no errors but no binaries either:

~/.TabNine/version
Getting current version...
Contacting host: update.tabnine.com:443
Wrote /home/admin/.TabNine/version
Current version is 3.4.13
Installing at ~/.TabNine/3.4.13/x86_64-unknown-linux-gnu/TabNine. Downloading https://update.tabnine.com/bundles/3.4.13/x86_64-unknown-linux-gnu/TabNine.zip ...
Wrote /home/admin/.TabNine/3.4.13/x86_64-unknown-linux-gnu.zip
/bin/bash: line 1: unzip: command not found
TabNine installation complete.

The folder in question is empty after completion.

Downloading the binaries manually & putting them in that folder throws me a bunch of TabNine process restart limit reached. errors when trying to complete things, because I did not chmod the binaries. Log:

TabNine server started.
Company: An error occurred in auto-begin
Company: backend company-tabnine error "Process company-tabnine--process not running" with args (prefix)
TabNine process #<process company-tabnine--process> received event "exited abnormally with code 126
".
Restarting TabNine process.

Tries to untar a zipfile when downloading the binary

Just trying this out, and I got this in the *Messages* buffer:

Installing at ~/.TabNine/3.3.96/x86_64-unknown-linux-gnu/TabNine. Downloading https://update.tabnine.com/bundles/3.3.96/x86_64-unknown-linux-gnu/TabNine.zip ...
Wrote /home/spacey/.TabNine/3.3.96/x86_64-unknown-linux-gnu.zip
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Exiting with failure status due to previous errors

'TabNine::version' not working on Spacemacs

I'm using Spacemacs. And tried to configure based on the instruction on the readme. TabNine seems working for me. See the screenshot below:

screenshot 2019-01-11 at 10 02 42 am

But, the problem is I'm not able to get any response from TabNine::version or TabNine::active. See the below screenshot:

screenshot 2019-01-11 at 9 59 55 am

Adding --client flag when running the binary

Thanks for building and maintaining this plugin!

You are awesome and we appreciate your help in making TabNine approachable to Emacs users 🙌🏻🙌🏻

As I have no ability in reading/writing lisp, could you please add a flag to the binary when it is being ran? The flag is --client and its value should be emacs. This enables us to better understand our users and make sure we are not breaking any ability to any of them.

This is roughly the line that need to change (from what I was able to interpret from my zero lisp knowledge):
https://github.com/TommyX12/company-tabnine/blob/master/company-tabnine.el#L349

Thanks!!

company-tabnine and ess-mode

The use of company-tabnine with ess-mode presented a problem. You may want to incorporate the solution posted here into the Readme for company-tabnine.

Improve performance on typing

Using company tabnine, the typing feels very laggy, the letters take some time to appears, don't feel smooth like others backends (like LSP or dabbrev).

Using on neovim-qt or vscode ( installed only for test propose, dont judge me hahah ) the type feels smooth (the time between the key press and the lettter show and editor feels like 0ms ).

I dont know how to do it, but maybe change it to something more async.

Edit:

My PC is OK, i7 8gen, 16 ram, ssd nvme 2

Server does not start reliably on NixOS

Executable installation happens without any visible error, but once completion is requested, TabNine breaks.

Company: An error occurred in auto-begin
Company: backend company-tabnine error "Process company-tabnine--process not running" with args (prefix)
user-error: Cannot complete at point
TabNine server started.
json-read: JSON readtable error: 47

TabNine process restart limit reached

When I call company-tabnine , error occurs,

TabNine server started.
Company: An error occurred in auto-begin
Company: backend company-tabnine error "Process company-tabnine--process not running" with args (prefix)
user-error: Cannot complete at point
TabNine process # received event "killed: 9
".
TabNine process restart limit reached.

I use MacOS.

Error running timer ‘company-echo-show’

I have the same problem as in #2 , and I'm using the latest company-tabnine and emacs 26.1 on debian testing.
My configuration

            (use-package company-tabnine
              :ensure t
              :config (progn
                        (add-to-list 'company-backends #'company-tabnine)))

And below is the backtrace

Debugger entered--Lisp error: (invalid-function (messages (alist-get 'promotional_message company-tabnine--result)))
  (messages (alist-get 'promotional_message company-tabnine--result))()
  company-tabnine--meta("LocalDateTime")
  company-tabnine(meta "LocalDateTime")
  apply(company-tabnine (meta "LocalDateTime"))
  company-call-backend-raw(meta "LocalDateTime")
  apply(company-call-backend-raw (meta "LocalDateTime"))
  company--force-sync(company-call-backend-raw (meta "LocalDateTime") company-tabnine)
  company-call-backend(meta "LocalDateTime")
  company-fetch-metadata()
  company-echo-show(company-fetch-metadata)
  apply(company-echo-show company-fetch-metadata)
  timer-event-handler([t 0 0 10000 nil company-echo-show (company-fetch-metadata) idle 0])

license activation key

sorry, i went over and over, and I have no idea how to activate my tabnine license with this plugin.

301 Moved Permanently

Hello,
I'm on emacs 26.3 and MacOS 10.12. Ran through the installation steps fine and M-x company-tabnine-install-binary ran successfully. However, I get the following (attached) in my mini buffer when trying to type in any buffer.

Screen Shot 2019-10-30 at 10 34 39 AM

The longer you use it, the laggier it gets

I don't know if this is duplicate of #39 or company-mode/company-mode#1056 , but similar issue.

In a newly opened Emacs, company-tabine works like magic and super fast, there is no performance issues at all.

However after using it intensively for hours, regardless of in single or multiple files, the completion gets extremely slow and lag literally on every input. htop shows tabnine process takes up quite a bit of memory, and executing M-x company-tabnine-restart-server or TabNine::restart doesn't fix the issue. Restarting Emacs makes tabnine works great again.

Emacs 28 gccemacs, manjaro, config

Apple M1 Support

Hi, folks

Amir from tabnine here.

We have recently released support the new for Apple M1 processors.
This requires some changes on the plugin side too.

We've updated the how to write a plugin document.
We also implemented it in various other plugins, so you can check it out to get inspiration :-)

vscode
sublime
intellij
vim

Note that supporting m1 when the editor is run nativelyon arm is usually pretty straight forward. However, supporting a case where the editor is running on the Rosetta translator is a little more complex (see this).

Freezes during completion

If company-tabnine enabled, emacs frequently freezes when I type, even on small projects.

I think that reason is that completion is not asynchronous.
If so, please make it asynchonous, because processing completions takes a lot of time, so freezes are very annoying.

Emacs verison 25.2.2
company config

(use-package company
             :ensure t
             :config
             (setq company-minimum-prefix-length 1)
             (setq company-idle-delay 0))

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.