From cb74af03dd9dc86f5730387e8302b674cd74d79e Mon Sep 17 00:00:00 2001 From: dimacodota <60742964+dimacodota@users.noreply.github.com> Date: Sun, 8 Nov 2020 22:15:46 +0200 Subject: [PATCH] tabnine in completion item (#86) * tabnine in completion item * fix attribution elemnt --- .pre-commit-config.yaml | 1 + completions/completions_v2.py | 8 +++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a50863a..f015c9b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 diff --git a/completions/completions_v2.py b/completions/completions_v2.py index bbf9c03..6f8e81d 100644 --- a/completions/completions_v2.py +++ b/completions/completions_v2.py @@ -42,7 +42,7 @@ "paste", ] -STARS_PREFIX = "✨" +ATTRIBUTION_ELEMENT = "⌬" class TabNineCommand(sublime_plugin.TextCommand): @@ -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(): @@ -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