mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-06 16:19:07 -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"]
|
return self.tokens["value"]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def value(self) -> T.Optional[int]:
|
def value(self) -> T.Optional[str]:
|
||||||
type = self.context[ValueTypeCtx].value_type
|
type = self.context[ValueTypeCtx].value_type
|
||||||
if not isinstance(type, Enumeration):
|
if not isinstance(type, Enumeration):
|
||||||
return None
|
return None
|
||||||
elif member := type.members.get(self.name):
|
elif member := type.members.get(self.name):
|
||||||
return member.value
|
return member.nick
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
|
@ -118,6 +118,7 @@ class LanguageServer:
|
||||||
self.client_capabilities = {}
|
self.client_capabilities = {}
|
||||||
self.client_supports_completion_choice = False
|
self.client_supports_completion_choice = False
|
||||||
self._open_files: T.Dict[str, OpenFile] = {}
|
self._open_files: T.Dict[str, OpenFile] = {}
|
||||||
|
self._exited = False
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
# Read <doc> tags from gir files. During normal compilation these are
|
# Read <doc> tags from gir files. During normal compilation these are
|
||||||
|
@ -125,7 +126,7 @@ class LanguageServer:
|
||||||
xml_reader.PARSE_GIR.add("doc")
|
xml_reader.PARSE_GIR.add("doc")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
while True:
|
while not self._exited:
|
||||||
line = ""
|
line = ""
|
||||||
content_len = -1
|
content_len = -1
|
||||||
while content_len == -1 or (line != "\n" and line != "\r\n"):
|
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")
|
@command("textDocument/didOpen")
|
||||||
def didOpen(self, id, params):
|
def didOpen(self, id, params):
|
||||||
doc = params.get("textDocument")
|
doc = params.get("textDocument")
|
||||||
|
|
|
@ -7,7 +7,7 @@ corresponding .blp file and regenerate this file with blueprint-compiler.
|
||||||
<interface>
|
<interface>
|
||||||
<requires lib="gtk" version="4.0"/>
|
<requires lib="gtk" version="4.0"/>
|
||||||
<object class="GApplication">
|
<object class="GApplication">
|
||||||
<property name="flags">1|4</property>
|
<property name="flags">is-service|handles-open</property>
|
||||||
</object>
|
</object>
|
||||||
<object class="GtkEventControllerScroll">
|
<object class="GtkEventControllerScroll">
|
||||||
<property name="flags">1</property>
|
<property name="flags">1</property>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue