To support phpdoc blocks we have to use so called `injections`. This means delegating responsibility to other parsers. it's a recommended way. JS tree-sitter has corresponding jsdoc too. Based on a discussion in https://github.com/tree-sitter/tree-sitter-php/issues/50 Here is an example from NVIM treesitter plugin: https://github.com/nvim-treesitter/nvim-treesitter/blob/master/queries/php/injections.scm We have to use https://github.com/claytonrcarter/tree-sitter-phpdoc The same is going to apply if we would like to support SQL queries in strings