mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
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:
parent
8fc0efb642
commit
55a117a5b7
7 changed files with 85 additions and 31 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue