From 6958c4efff2bae43c5358cecead763c133a3abd7 Mon Sep 17 00:00:00 2001 From: Jack Cherng Date: Fri, 10 Nov 2023 20:56:17 +0800 Subject: [PATCH] style: $ make fix Signed-off-by: Jack Cherng --- plugin/ui/completion.py | 136 +++++++++++++++++----------------- plugin/ui/panel_completion.py | 116 ++++++++++++++--------------- pyproject.toml | 2 +- 3 files changed, 127 insertions(+), 127 deletions(-) diff --git a/plugin/ui/completion.py b/plugin/ui/completion.py index 4f5a457..e738f9b 100644 --- a/plugin/ui/completion.py +++ b/plugin/ui/completion.py @@ -214,73 +214,73 @@ class _PopupCompletion(_BaseCompletion): CSS_CLASS_NAME = "copilot-completion-popup" CSS = """ - html {{ - --copilot-accept-foreground: var(--foreground); - --copilot-accept-background: var(--background); - --copilot-accept-border: var(--greenish); - --copilot-reject-foreground: var(--foreground); - --copilot-reject-background: var(--background); - --copilot-reject-border: var(--yellowish); - }} - - .{class_name} {{ - margin: 1rem 0.5rem 0 0.5rem; - }} - - .{class_name} .header {{ - display: block; - margin-bottom: 1rem; - }} - - .{class_name} a {{ - border-radius: 3px; - border-style: solid; - border-width: 1px; - display: inline; - padding: 5px; - text-decoration: none; - }} - - .{class_name} a.accept {{ - background: var(--copilot-accept-background); - border-color: var(--copilot-accept-border); - color: var(--copilot-accept-foreground); - }} - - .{class_name} a.accept i {{ - color: var(--copilot-accept-border); - }} - - .{class_name} a.reject {{ - background: var(--copilot-reject-background); - border-color: var(--copilot-reject-border); - color: var(--copilot-reject-foreground); - }} - - .{class_name} a.reject i {{ - color: var(--copilot-reject-border); - }} - - .{class_name} a.prev {{ - border-top-right-radius: 0; - border-bottom-right-radius: 0; - border-right-width: 0; - padding-left: 8px; - padding-right: 8px; - }} - - .{class_name} a.next {{ - border-top-left-radius: 0; - border-bottom-left-radius: 0; - border-left-width: 0; - padding-left: 8px; - padding-right: 8px; - }} - - .{class_name} a.panel {{ - padding-left: 8px; - padding-right: 8px; - }} + html {{ + --copilot-accept-foreground: var(--foreground); + --copilot-accept-background: var(--background); + --copilot-accept-border: var(--greenish); + --copilot-reject-foreground: var(--foreground); + --copilot-reject-background: var(--background); + --copilot-reject-border: var(--yellowish); + }} + + .{class_name} {{ + margin: 1rem 0.5rem 0 0.5rem; + }} + + .{class_name} .header {{ + display: block; + margin-bottom: 1rem; + }} + + .{class_name} a {{ + border-radius: 3px; + border-style: solid; + border-width: 1px; + display: inline; + padding: 5px; + text-decoration: none; + }} + + .{class_name} a.accept {{ + background: var(--copilot-accept-background); + border-color: var(--copilot-accept-border); + color: var(--copilot-accept-foreground); + }} + + .{class_name} a.accept i {{ + color: var(--copilot-accept-border); + }} + + .{class_name} a.reject {{ + background: var(--copilot-reject-background); + border-color: var(--copilot-reject-border); + color: var(--copilot-reject-foreground); + }} + + .{class_name} a.reject i {{ + color: var(--copilot-reject-border); + }} + + .{class_name} a.prev {{ + border-top-right-radius: 0; + border-bottom-right-radius: 0; + border-right-width: 0; + padding-left: 8px; + padding-right: 8px; + }} + + .{class_name} a.next {{ + border-top-left-radius: 0; + border-bottom-left-radius: 0; + border-left-width: 0; + padding-left: 8px; + padding-right: 8px; + }} + + .{class_name} a.panel {{ + padding-left: 8px; + padding-right: 8px; + }} """.format( class_name=CSS_CLASS_NAME ) @@ -292,7 +292,7 @@ class _PopupCompletion(_BaseCompletion): ``````{lang} {code} `````` - """ + """ ) @property diff --git a/plugin/ui/panel_completion.py b/plugin/ui/panel_completion.py index fafe9ff..5756cce 100644 --- a/plugin/ui/panel_completion.py +++ b/plugin/ui/panel_completion.py @@ -143,62 +143,62 @@ def close(self) -> None: class _PanelCompletion: CSS_CLASS_NAME = "copilot-completion-panel" CSS = """ - html {{ - --copilot-close-foreground: var(--foreground); - --copilot-close-background: var(--background); - --copilot-close-border: var(--foreground); - --copilot-accept-foreground: var(--foreground); - --copilot-accept-background: var(--background); - --copilot-accept-border: var(--greenish); - }} - - .{class_name} {{ - margin: 1rem 0.5rem 0 0.5rem; - }} - - .{class_name} .navbar {{ - text-align: left; - }} - - .{class_name} .synthesis-info {{ - display: inline-block; - text-size: 1.2em; - }} - - .{class_name} .header {{ - display: block; - margin-bottom: 1rem; - }} - - .{class_name} a {{ - border-radius: 3px; - border-style: solid; - border-width: 1px; - display: inline; - padding: 5px; - text-decoration: none; - }} - - .{class_name} a.close {{ - background: var(--copilot-close-background); - border-color: var(--copilot-close-border); - color: var(--copilot-close-foreground); - }} - - .{class_name} a.close i {{ - color: var(--copilot-close-border); - }} - - .{class_name} a.accept {{ - background: var(--copilot-accept-background); - border-color: var(--copilot-accept-border); - color: var(--copilot-accept-foreground); - }} - - .{class_name} a.accept i {{ - color: var(--copilot-accept-border); - }} - """.format( + html {{ + --copilot-close-foreground: var(--foreground); + --copilot-close-background: var(--background); + --copilot-close-border: var(--foreground); + --copilot-accept-foreground: var(--foreground); + --copilot-accept-background: var(--background); + --copilot-accept-border: var(--greenish); + }} + + .{class_name} {{ + margin: 1rem 0.5rem 0 0.5rem; + }} + + .{class_name} .navbar {{ + text-align: left; + }} + + .{class_name} .synthesis-info {{ + display: inline-block; + text-size: 1.2em; + }} + + .{class_name} .header {{ + display: block; + margin-bottom: 1rem; + }} + + .{class_name} a {{ + border-radius: 3px; + border-style: solid; + border-width: 1px; + display: inline; + padding: 5px; + text-decoration: none; + }} + + .{class_name} a.close {{ + background: var(--copilot-close-background); + border-color: var(--copilot-close-border); + color: var(--copilot-close-foreground); + }} + + .{class_name} a.close i {{ + color: var(--copilot-close-border); + }} + + .{class_name} a.accept {{ + background: var(--copilot-accept-background); + border-color: var(--copilot-accept-border); + color: var(--copilot-accept-foreground); + }} + + .{class_name} a.accept i {{ + color: var(--copilot-accept-border); + }} + """.format( class_name=CSS_CLASS_NAME ) COMPLETION_TEMPLATE = reformat( @@ -209,7 +209,7 @@ class _PanelCompletion:
{sections} - """ + """ ) # We use many backticks to denote a fenced code block because if we are writing in Markdown, # Copilot may suggest 3 backticks for a fenced code block and that can break our templating. @@ -219,7 +219,7 @@ class _PanelCompletion: ``````{lang} {code} `````` - """ + """ ) def __init__(self, view: sublime.View) -> None: diff --git a/pyproject.toml b/pyproject.toml index 8eabd91..3ec843a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,7 +39,7 @@ exclude = '\.git,\.?venv,\.mypy_cache,br-.*,branch-.*,libs,stubs,tests/files,typ [tool.black] line-length = 120 target-version = ['py33'] - +preview = true # regex exclude = ''' /(