Skip to content

Commit

Permalink
Improved error message when highlight query fails to parse
Browse files Browse the repository at this point in the history
  • Loading branch information
Nimaoth committed Jul 19, 2024
1 parent 3a91f7a commit a953824
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/text/custom_treesitter.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down

0 comments on commit a953824

Please sign in to comment.