diff options
Diffstat (limited to 'python/vhdl_langserver/lsp.py')
-rw-r--r-- | python/vhdl_langserver/lsp.py | 9 |
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)) |