Use the method Parser.Query.matches() instead of Parser.Query.captures() to get the types and their namespaces from syntax tree. This is because the method captures() return an array. Currently, if we want to find out which type belongs to which namespace, we rely on the order of elements in that array (ex. class at index n belongs to the next namespace at index < n).
Use the method
Parser.Query.matches()
instead ofParser.Query.captures()
to get the types and their namespaces from syntax tree. This is because the methodcaptures()
return an array. Currently, if we want to find out which type belongs to which namespace, we rely on the order of elements in that array (ex. class at index n belongs to the next namespace at index < n).