generated from S1M0N38/base.nvim
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(treesitter): add injections of glsl
- Loading branch information
1 parent
bc19527
commit f053933
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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")) |