Apply some of @jwestman's suggestions

This commit is contained in:
gregorni 2023-09-17 10:10:25 +02:00
parent 455924e22f
commit f777c531e4
4 changed files with 66 additions and 69 deletions

View file

@ -292,18 +292,15 @@ class LanguageServer:
return
try:
XmlOutput().emit(open_file.ast)
except:
printerr(traceback.format_exc())
self._send_error(id, ErrorCode.RequestFailed, "Could not compile document")
formatted_blp = Format.format(
open_file.text,
params["options"]["tabSize"],
params["options"]["insertSpaces"],
)
except PrintableError:
self._send_error(id, ErrorCode.RequestFailed, "Could not format document")
return
formatted_blp = Format.format(
open_file.text,
params["options"]["tabSize"],
params["options"]["insertSpaces"],
)
lst = []
for tag, i1, i2, j1, j2 in SequenceMatcher(
None, open_file.text, formatted_blp