Skip to content

Commit

Permalink
feat(treesitter): add injections of glsl
Browse files Browse the repository at this point in the history
  • Loading branch information
DanilaMihailov committed May 10, 2024
1 parent bc19527 commit f053933
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions after/queries/lua/injections.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
;; extends

;; inject glsl for any string that starts `#pragma language glsl`
(string
content: _ @injection.content
(#lua-match? @injection.content "^%s*#pragma language glsl")
(#set! injection.language "glsl"))


; inject glsl for calls to newShader
; love.graphics.newShader([[...]])
; and even just newShader([[...]])
((function_call
name: (_) @_function
arguments: (arguments
(string
content: _ @injection.content)))
(#contains? @_function "newShader")
(#set! injection.language "glsl"))

0 comments on commit f053933

Please sign in to comment.