Having defined this attribute:
#[Attribute(Attribute::TARGET_CLASS_CONSTANT)]
class StyleFieldTypeInformationAttribute
{
public function __construct(string $jsonName, string $className)
{
$this->JsonName = $jsonName;
$this->WebStyleFieldDefinitionType = $className;
}
public string $JsonName;
public string $WebStyleFieldDefinitionType;
}
and then attaching it to an enum like this:
enum StyleFieldType : int
{
case Unknown = -1;
#[StyleFieldTypeInformationAttribute(
jsonName: 'text-singleline',
className: WebStyleFieldDefinitionTextBoxSingleLine::class)]
case TextBoxSingleLine = 0;
}
results in a correctly running application.
Unfortunately the class names StyleFieldTypeInformationAttribute and WebStyleFieldDefinitionTextBoxSingleLine are not colored in the foreground color of a class, but only as plain text.
When in contrast attaching the above attribute to e.g. a class member:
class Bar
{
#[StyleFieldTypeInformationAttribute(
jsonName: 'text-singleline',
className: WebStyleFieldDefinitionTextBoxSingleLine::class)]
public int $i = 1;
}
the syntax coloring works correctly.
So in my opinion, this is a "bug".
My question
Could you please make attributes attached to enum cases correctly being syntax-colored?