From a953824d13541db643feb5f86586509631a533e5 Mon Sep 17 00:00:00 2001 From: Nimaoth Date: Fri, 19 Jul 2024 23:06:27 +0200 Subject: [PATCH] Improved error message when highlight query fails to parse --- src/text/custom_treesitter.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/text/custom_treesitter.nim b/src/text/custom_treesitter.nim index 8fca96c7..89c4e6ff 100644 --- a/src/text/custom_treesitter.nim +++ b/src/text/custom_treesitter.nim @@ -237,7 +237,7 @@ else: var queryError: ts.TSQueryError = ts.TSQueryErrorNone result = TSQuery(impl: self.impl.tsQueryNew(source.cstring, source.len.uint32, addr errorOffset, addr queryError)) if queryError != ts.TSQueryErrorNone: - log(lvlError, fmt"Failed to load highlights query: {errorOffset} {source.byteIndexToCursor(errorOffset.int)}: {queryError}: {source}") + log lvlError, &"Failed to load highlights query: {errorOffset} {source.byteIndexToCursor(errorOffset.int)}: {queryError}\n{source}" return nil proc parseString*(self: TSParser, text: string, oldTree: Option[TSTree] = TSTree.none): TSTree =