nvim-treesitter/tests/query/highlights/hack/generics.hack

24 lines
567 B
Text

class Box<T> {
// ^ @type
// ^ @type
protected T $data;
// ^ @keyword.modifier
// ^ @type
public function __construct(T $data) {
// ^ @type
// ^ @variable.parameter
// ^ @keyword.function
// ^ @keyword.modifier
// ^ @function.method
$this->data = $data;
}
public function getData(): T {
// ^ @function.method
// ^ @keyword.modifier
return $this->data;
// ^ @operator
// ^ @variable.builtin
}
}