Skip to content

Commit

Permalink
style: $ make fix
Browse files Browse the repository at this point in the history
Signed-off-by: Jack Cherng <jfcherng@gmail.com>
  • Loading branch information
jfcherng committed Nov 10, 2023
1 parent 9efe5f4 commit 6958c4e
Show file tree
Hide file tree
Showing 3 changed files with 127 additions and 127 deletions.
136 changes: 68 additions & 68 deletions plugin/ui/completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand All @@ -292,7 +292,7 @@ class _PopupCompletion(_BaseCompletion):
``````{lang}
{code}
``````
"""
"""
)

@property
Expand Down
116 changes: 58 additions & 58 deletions plugin/ui/panel_completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -209,7 +209,7 @@ class _PanelCompletion:
</div>
<hr>
{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.
Expand All @@ -219,7 +219,7 @@ class _PanelCompletion:
``````{lang}
{code}
``````
"""
"""
)

def __init__(self, view: sublime.View) -> None:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '''
/(
Expand Down

0 comments on commit 6958c4e

Please sign in to comment.