From 8c26ee6d3f078c4e662387a705e57b68edc9e814 Mon Sep 17 00:00:00 2001 From: Nimaoth Date: Sat, 16 Mar 2024 17:46:04 +0100 Subject: [PATCH] added log when ts query failed to load --- src/text/text_document.nim | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/text/text_document.nim b/src/text/text_document.nim index c25c9295..9874d86b 100644 --- a/src/text/text_document.nim +++ b/src/text/text_document.nim @@ -539,12 +539,16 @@ proc initTreesitter*(self: TextDocument): Future[void] {.async.} = try: let queryString = fs.loadApplicationFile(fmt"./languages/{languageId}/queries/highlights.scm") self.highlightQuery = language.get.query(queryString) + if self.highlightQuery.isNil: + log(lvlError, fmt"Failed to create highlight query for '{languageId}'") except CatchableError: log(lvlError, fmt"No highlight queries found for '{languageId}'") try: let errorQueryString = fs.loadApplicationFile(fmt"./languages/{languageId}/queries/errors.scm") self.errorQuery = language.get.query(errorQueryString) + if self.errorQuery.isNil: + log(lvlError, fmt"Failed to create error query for '{languageId}'") except CatchableError: log(lvlError, fmt"No error queries found for '{languageId}'")