lsp: Show docs on hover

Also:
- Install the script to <prefix>/bin
- Fix a bug in XmlReader that would cause "uninteresting" tags to not be
  fully ignored
- Other minor improvements
This commit is contained in:
James Westman 2021-10-24 17:10:05 -05:00
parent 8fc0efb642
commit 55a117a5b7
No known key found for this signature in database
GPG key ID: CE2DBA0ADB654EA6
7 changed files with 85 additions and 31 deletions

View file

@ -20,22 +20,17 @@
from enum import Enum
from . import tokenizer, parser
from .errors import *
from .utils import *
class TextDocumentSyncKind(Enum):
None_ = 0,
Full = 1,
Incremental = 2,
class OpenFile:
def __init__(self, uri, text, version):
self.uri = uri
self.text = text
self.version = version
self.diagnostics = []
self._update()
def apply_changes(self, changes):
@ -50,8 +45,8 @@ class OpenFile:
try:
self.tokens = tokenizer.tokenize(self.text)
self.ast = parser.parse(self.tokens)
self.diagnostics = [self._create_diagnostic(text, err) for err in list(ast.errors)]
self.diagnostics += self.ast.errors
except MultipleErrors as e:
self.diagnostics += [self._create_diagnostic(text, err) for err in e.errors]
self.diagnostics += e.errors
except CompileError as e:
self.diagnostics += [self._create_diagnostic(text, e)]
self.diagnostics += e