diff options
| author | DanielGavin <danielgavin5@hotmail.com> | 2024-10-05 20:58:23 +0200 |
|---|---|---|
| committer | DanielGavin <danielgavin5@hotmail.com> | 2024-10-05 20:58:23 +0200 |
| commit | 90c90ae5dd0619f246c2379f48a4f0a7b5f5e0b7 (patch) | |
| tree | c989ed5cc3672827c848b277c27e0776245f3824 /src/server | |
| parent | 8508eb6004ec4dd3fa032d08cf7036daf94d97e5 (diff) | |
Add the ability to error out of the formatter.
Diffstat (limited to 'src/server')
| -rw-r--r-- | src/server/format.odin | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/server/format.odin b/src/server/format.odin index c518532..d981b9c 100644 --- a/src/server/format.odin +++ b/src/server/format.odin @@ -38,6 +38,10 @@ get_complete_format :: proc(document: ^Document, config: ^common.Config) -> ([]T src := printer.print(&prnt, &document.ast) + if prnt.errored_out { + return {}, true + } + edit := TextEdit { newText = src, range = common.get_document_range(document.text[0:document.used_text]), |