Skip to content

feat: add GLSL support via tree-sitter-glsl (#685)#688

Open
KadirKess wants to merge 1 commit into
colbymchenry:mainfrom
KadirKess:feature/issue-685-glsl
Open

feat: add GLSL support via tree-sitter-glsl (#685)#688
KadirKess wants to merge 1 commit into
colbymchenry:mainfrom
KadirKess:feature/issue-685-glsl

Conversation

@KadirKess
Copy link
Copy Markdown

Summary

Add GLSL shader file indexing (.glsl, .vert, .frag, .comp, .geom, .tesc, .tese) — functions, structs, and intra-file calls are extracted so you can navigate and query shader code alongside the rest of the project.

Closes #685

Changes

  • Vendor tree-sitter-glsl.wasm (ABI-15) in src/extraction/wasm/
  • Add glslExtractor with:
    • resolveBody — GLSL function_definition exposes compound_statement as a plain named child, not a body field
    • visitNode — intercepts declaration nodes containing nested struct_specifier so structs aren't swallowed by the variable extraction path
  • Register all 7 shader extensions in the extension map, WASM grammar map, and display name map
  • Add 'glsl' to the LANGUAGES const array in types.ts
  • Add extraction tests covering language detection, function extraction, struct extraction, and call extraction
  • Update README supported languages table and summary line
  • Update CHANGELOG

Testing

All 5 new GLSL extraction tests pass:

  • Language detection for all 7 shader extensions
  • isLanguageSupported('glsl') and getSupportedLanguages() include 'glsl'
  • Function extraction (void main(), typed vec3 computeNormal(...))
  • Struct extraction (struct Light { ... })
  • Intra-file call extraction (square() → unresolved reference)

tsc --noEmit passes cleanly.

Add GLSL shader file indexing (.glsl, .vert, .frag, .comp, .geom,
.tesc, .tese) — functions, structs, and intra-file calls are extracted
so you can navigate and query shader code alongside the rest of the
project.

- Vendor tree-sitter-glsl.wasm (ABI-15)
- Add glslExtractor with resolveBody (compound_statement lookup) and
  visitNode (nested struct_specifier interception)
- Register all 7 shader extensions in the extension map
- Add extraction tests (language detection, functions, structs, calls)
- Update README supported languages table and CHANGELOG
@treytracedit-lab
Copy link
Copy Markdown

C++

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Add support for GLSL

2 participants