Skip to content

Show inlay hints for php attributes (maybe as option) #383

@still-dreaming-1

Description

@still-dreaming-1

PHP 8.0 added official support for attributes. In that link you can see some examples where you are actually passing parameters into a constructor while...attributing. I created a framework I am using that makes heavy use of attributes and it can get pretty gnarly. It would be nice if the inlay hints worked for these parameter names. I'm not sure, but it might be even better as a separate setting. Some people may want inlay hints in other places but not in the attributes. Or maybe I'm over thinking it and they should show up here if inlay hints are enabled.

Here is an example of me attributing a method where inlay hints may be helpful. I put the tests directly above the method they are testing as attributes:

#[Test(new self(0, 0), [new self(0, 0)], new Returns(new self(0, 0)))]
#[Test(new self(2, 99), [new self(1, 99)], new Returns(new self(4, 98)))]

Metadata

Metadata

Assignees

Labels

featureNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions