Skip to content

Commit

Permalink
added log when ts query failed to load
Browse files Browse the repository at this point in the history
  • Loading branch information
Nimaoth committed Mar 16, 2024
1 parent 72694db commit 8c26ee6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/text/text_document.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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}'")

Expand Down

0 comments on commit 8c26ee6

Please sign in to comment.