Skip to content

Commit

Permalink
tabnine in completion item (#86)
Browse files Browse the repository at this point in the history
* tabnine in completion item

* fix attribution elemnt
  • Loading branch information
dimacodota authored Nov 8, 2020
1 parent 7b3dc2c commit cb74af0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ repos:
rev: stable
hooks:
- id: black
entry: bash -c 'black "$@"; git add -u' --
language_version: python3
- repo: https://gitlab.com/pycqa/flake8
rev: 3.7.9
Expand Down
8 changes: 3 additions & 5 deletions completions/completions_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"paste",
]

STARS_PREFIX = ""
ATTRIBUTION_ELEMENT = ""


class TabNineCommand(sublime_plugin.TextCommand):
Expand Down Expand Up @@ -133,7 +133,7 @@ def on_selection_modified(self, view):

def on_activated(self, view):
self.on_any_event(view)
view.set_status("tabnine-status", "TabNine " + STARS_PREFIX)
view.set_status("tabnine-status", ATTRIBUTION_ELEMENT + " TabNine")

def on_query_completions(self, view, prefix, locations):
def _run_complete():
Expand Down Expand Up @@ -223,9 +223,7 @@ def _run_complete():
def get_completion(self):
return [
[
"{}\t{} {}".format(
r.get("new_prefix"), r.get("detail", "TabNine"), STARS_PREFIX
),
"{}\t{} {}".format(r.get("new_prefix"), ATTRIBUTION_ELEMENT, "TabNine"),
"{}$0{}".format(r.get("new_prefix"), r.get("new_suffix", "")),
]
for r in self._results
Expand Down

0 comments on commit cb74af0

Please sign in to comment.