mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Compare commits
5 commits
8b9614bf0c
...
32f763ed4c
Author | SHA1 | Date | |
---|---|---|---|
|
32f763ed4c | ||
|
f3faf4b993 | ||
|
e07da3c339 | ||
|
2ae41020ab | ||
|
f48b840cfa |
3 changed files with 13 additions and 4 deletions
|
@ -211,12 +211,12 @@ class Flag(AstNode):
|
|||
return self.tokens["value"]
|
||||
|
||||
@property
|
||||
def value(self) -> T.Optional[int]:
|
||||
def value(self) -> T.Optional[str]:
|
||||
type = self.context[ValueTypeCtx].value_type
|
||||
if not isinstance(type, Enumeration):
|
||||
return None
|
||||
elif member := type.members.get(self.name):
|
||||
return member.value
|
||||
return member.nick
|
||||
else:
|
||||
return None
|
||||
|
||||
|
|
|
@ -118,6 +118,7 @@ class LanguageServer:
|
|||
self.client_capabilities = {}
|
||||
self.client_supports_completion_choice = False
|
||||
self._open_files: T.Dict[str, OpenFile] = {}
|
||||
self._exited = False
|
||||
|
||||
def run(self):
|
||||
# Read <doc> tags from gir files. During normal compilation these are
|
||||
|
@ -125,7 +126,7 @@ class LanguageServer:
|
|||
xml_reader.PARSE_GIR.add("doc")
|
||||
|
||||
try:
|
||||
while True:
|
||||
while not self._exited:
|
||||
line = ""
|
||||
content_len = -1
|
||||
while content_len == -1 or (line != "\n" and line != "\r\n"):
|
||||
|
@ -221,6 +222,14 @@ class LanguageServer:
|
|||
},
|
||||
)
|
||||
|
||||
@command("shutdown")
|
||||
def shutdown(self, id, params):
|
||||
self._send_response(id, None)
|
||||
|
||||
@command("exit")
|
||||
def exit(self, id, params):
|
||||
self._exited = True
|
||||
|
||||
@command("textDocument/didOpen")
|
||||
def didOpen(self, id, params):
|
||||
doc = params.get("textDocument")
|
||||
|
|
|
@ -7,7 +7,7 @@ corresponding .blp file and regenerate this file with blueprint-compiler.
|
|||
<interface>
|
||||
<requires lib="gtk" version="4.0"/>
|
||||
<object class="GApplication">
|
||||
<property name="flags">1|4</property>
|
||||
<property name="flags">is-service|handles-open</property>
|
||||
</object>
|
||||
<object class="GtkEventControllerScroll">
|
||||
<property name="flags">1</property>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue