Skip to content

Commit

Permalink
chore: introduce black formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
tombh committed Jul 29, 2023
1 parent 476eaf1 commit 6e932f0
Show file tree
Hide file tree
Showing 59 changed files with 1,380 additions and 1,098 deletions.
46 changes: 19 additions & 27 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@

# -- Project information -----------------------------------------------------

project = 'pygls'
copyright = 'Open Law Library'
author = 'Open Law Library'
project = "pygls"
copyright = "Open Law Library"
author = "Open Law Library"

# The short X.Y version
version = ''
version = ""
# The full version, including alpha/beta/rc tags
release = ''
release = ""

title = 'pygls Documentation'
description = 'a pythonic generic language server'
title = "pygls Documentation"
description = "a pythonic generic language server"


# -- General configuration ---------------------------------------------------
Expand All @@ -41,27 +41,26 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
]
extensions = []

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
source_suffix = ".rst"

# The master toctree document.
master_doc = 'index'
master_doc = "index"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = 'en'
language = "en"

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand All @@ -77,7 +76,7 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'
html_theme = "sphinx_rtd_theme"

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand All @@ -88,7 +87,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
#html_static_path = ['_static']
# html_static_path = ['_static']

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
Expand All @@ -104,7 +103,7 @@
# -- Options for HTMLHelp output ---------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'pyglsdoc'
htmlhelp_basename = "pyglsdoc"


# -- Options for LaTeX output ------------------------------------------------
Expand All @@ -113,15 +112,12 @@
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
Expand All @@ -131,18 +127,15 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'pygls.tex', title,
author, 'manual'),
(master_doc, "pygls.tex", title, author, "manual"),
]


# -- Options for manual page output ------------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'pygls', description, [author], 1)
]
man_pages = [(master_doc, "pygls", description, [author], 1)]


# -- Options for Texinfo output ----------------------------------------------
Expand All @@ -151,8 +144,7 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'pygls', title, author,
'pygls', description, 'Miscellaneous'),
(master_doc, "pygls", title, author, "pygls", description, "Miscellaneous"),
]


Expand All @@ -171,4 +163,4 @@
# epub_uid = ''

# A list of files that should not be packed into the epub file.
epub_exclude_files = ['search.html']
epub_exclude_files = ["search.html"]
12 changes: 9 additions & 3 deletions examples/fountain-vscode-extension/src/server.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
import re
from pygls.server import LanguageServer
from lsprotocol.types import TEXT_DOCUMENT_COMPLETION
from lsprotocol.types import (CompletionItem, CompletionParams, CompletionList, CompletionOptions)
from lsprotocol.types import (
CompletionItem,
CompletionParams,
CompletionList,
CompletionOptions,
)

server = LanguageServer("foutain-language-server", "v0.1")

CHARACTER = re.compile(r"^[A-Z][A-Z ]+$", re.MULTILINE)

@server.feature(TEXT_DOCUMENT_COMPLETION, CompletionOptions(trigger_characters=['.']))

@server.feature(TEXT_DOCUMENT_COMPLETION, CompletionOptions(trigger_characters=["."]))
def on_completion(ls: LanguageServer, params: CompletionParams) -> CompletionList:
"""Completion suggestions for character names."""

Expand All @@ -18,5 +24,5 @@ def on_completion(ls: LanguageServer, params: CompletionParams) -> CompletionLis

return CompletionList(
is_incomplete=False,
items=[CompletionItem(label=character) for character in characters]
items=[CompletionItem(label=character) for character in characters],
)
22 changes: 5 additions & 17 deletions examples/json-vscode-extension/server/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,10 @@
def add_arguments(parser):
parser.description = "simple json server example"

parser.add_argument(
"--tcp", action="store_true",
help="Use TCP server"
)
parser.add_argument(
"--ws", action="store_true",
help="Use WebSocket server"
)
parser.add_argument(
"--host", default="127.0.0.1",
help="Bind to this address"
)
parser.add_argument(
"--port", type=int, default=2087,
help="Bind to this port"
)
parser.add_argument("--tcp", action="store_true", help="Use TCP server")
parser.add_argument("--ws", action="store_true", help="Use WebSocket server")
parser.add_argument("--host", default="127.0.0.1", help="Bind to this address")
parser.add_argument("--port", type=int, default=2087, help="Bind to this port")


def main():
Expand All @@ -56,5 +44,5 @@ def main():
json_server.start_io()


if __name__ == '__main__':
if __name__ == "__main__":
main()
Loading

0 comments on commit 6e932f0

Please sign in to comment.