Skip to content

Instantly share code, notes, and snippets.

@rondreas
Created August 4, 2022 09:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rondreas/e587a38e5f55e2c8f19c107970113335 to your computer and use it in GitHub Desktop.
Save rondreas/e587a38e5f55e2c8f19c107970113335 to your computer and use it in GitHub Desktop.
quick ctag option file for unreal shaders
# definitions for hlsl to be used for unreal shaders, usf, ush etc...
--langdef=hlsl
--map-hlsl=+.ush
--map-hlsl=+.usf
# for now just catch all functions,
# [a-zA-Z2-4]+ should match any type identifier,
# [a-zA-Z_]+ should match the function names,
# \((([a-zA-Z2-4]+[[:space:]]+[a-zA-Z]+)([[:space:]]*[,]*[[:space:]]*))*\) should match any inputs to functions,
# \2 means the second group is the name,
# f means it will be tagged as a function,
# {mgroup=N} is required, this sets jumps us to the first line of the pattern when jumping to tag
--kinddef-hlsl=f,function,function
--mline-regex-hlsl=/([a-zA-Z2-4]+)[[:space:]]+([a-zA-Z_]+)\((([a-zA-Z2-4]+[[:space:]]+[a-zA-Z_]+)([[:space:]]*[,]*[[:space:]]*))*\)/\2/f/{mgroup=0}
--fields=+ln
@rondreas
Copy link
Author

rondreas commented Aug 4, 2022

Run ctags --languages="hlsl" --options=$HOME/ctags.d/hlsl.ctags -R . in ...\Engine\Shaders to create tags file for all usf and ush files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment