go-tree-sitter icon indicating copy to clipboard operation
go-tree-sitter copied to clipboard

PHP file structure doesn't play nice with 'vendor'

Open vtechev opened this issue 3 months ago • 0 comments

I have never done any Go programming so please forgive my ignorance.

I have been trying to debug a build error in a project that depends on go-tree-sitter:

# github.com/smacker/go-tree-sitter/php
parser.c:1:10: fatal error: tree_sitter/parser.h: No such file or directory
    1 | #include "tree_sitter/parser.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

This was pretty confounding, since looking at the repo php/tree_sitter/parser.h is obviously there. parser.h is also in php itself, which seems weird.

In any case I eventually rooted around in the vendor folder of the build and found that, sure enough, php/tree_sitter does not exist!

I have to guess that there is something about the 'vendor' process that is excluding that directory when it downloads the source.

vtechev avatar Sep 28 '25 06:09 vtechev