aboutsummaryrefslogtreecommitdiffstats
path: root/python/vhdl_langserver/lsp.py
diff options
context:
space:
mode:
authorm-kru <mkru@protonmail.com>2020-08-15 04:17:53 +0200
committerGitHub <noreply@github.com>2020-08-15 04:17:53 +0200
commit8789de969e6673b195cbb28a692cc3fbbaa806e1 (patch)
tree51bf27abf5c553944543be5650ee2632a7b4153f /python/vhdl_langserver/lsp.py
parent68b879eb404e12a6414ef56e697b6dc99618d457 (diff)
downloadghdl-8789de969e6673b195cbb28a692cc3fbbaa806e1.tar.gz
ghdl-8789de969e6673b195cbb28a692cc3fbbaa806e1.tar.bz2
ghdl-8789de969e6673b195cbb28a692cc3fbbaa806e1.zip
py: adjust blank lines to PEP 8 for vhdl_langserver (#1434)
Why? 1. Conform to PEP 8. 2. Easier to read. 3. Make tools, such as PyCharm, not complain.
Diffstat (limited to 'python/vhdl_langserver/lsp.py')
-rw-r--r--python/vhdl_langserver/lsp.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/python/vhdl_langserver/lsp.py b/python/vhdl_langserver/lsp.py
index 8f5a98e5e..9a93b2a16 100644
--- a/python/vhdl_langserver/lsp.py
+++ b/python/vhdl_langserver/lsp.py
@@ -12,9 +12,11 @@ except ImportError:
log = logging.getLogger('ghdl-ls')
+
class ProtocolError(Exception):
pass
+
class LSPConn:
def __init__(self, reader, writer):
self.reader = reader
@@ -32,6 +34,7 @@ class LSPConn:
self.writer.write(out.encode())
self.writer.flush()
+
def path_from_uri(uri):
# Convert file uri to path (strip html like head part)
if not uri.startswith("file://"):
@@ -193,6 +196,7 @@ class LanguageProtocolServer(object):
# Standard defines and object types
#
+
class JSONErrorCodes(object):
# Defined by JSON RPC
ParseError = -32700
@@ -237,17 +241,20 @@ class DiagnosticSeverity(object):
Information = 3
Hint = 4
+
class TextDocumentSyncKind(object):
NONE = 0,
FULL = 1
INCREMENTAL = 2
+
class MessageType(object):
Error = 1
Warning = 2
Info = 3
Log = 4
+
class SymbolKind(object):
File = 1
Module = 2
@@ -268,6 +275,7 @@ class SymbolKind(object):
Boolean = 17
Array = 18
+
@attr.s
class HoverInfo(object):
language = attr.ib()
@@ -287,6 +295,7 @@ class Position(object):
line = attr.ib()
character = attr.ib()
+
@attr.s
class Range(object):
start = attr.ib(validator=instance_of(Position))