Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autocompletion for PHP Attributes #4300

Closed
SebNetbeans opened this issue Jun 30, 2022 · 3 comments · Fixed by #6929
Closed

Autocompletion for PHP Attributes #4300

SebNetbeans opened this issue Jun 30, 2022 · 3 comments · Fixed by #6929
Assignees
Labels
kind:feature A feature request PHP [ci] enable extra PHP tests (php/php.editor)
Milestone

Comments

@SebNetbeans
Copy link

Apache NetBeans version

Apache NetBeans 14

What happened

Hello,

Just a simple question. Is it possible to activate autocompletion for
PHP Attributes in Netbeans 14 ?

For an attribute like this :

#[Attribute]
final class MaxLength(int $maxLength) { ... }

And use it like this :


#[MaxLength(40)] // <-- Autocomplete here !
private string $test;

I didn't find any documentation on this trick.

Thank you !

Sébastien

How to reproduce

autocompletion

Not test in an earlier version

Did this work correctly in an earlier version?

No

Operating System

Linux Ubuntu

JDK

OpenJDK 64-Bit Server VM 17.0.3

Apache NetBeans packaging

Apache NetBeans provided installer

Anything else

No response

Are you willing to submit a pull request?

No

Code of Conduct

Yes

@SebNetbeans SebNetbeans added kind:bug Bug report or fix needs:triage Requires attention from one of the committers labels Jun 30, 2022
@KacerCZ KacerCZ added PHP [ci] enable extra PHP tests (php/php.editor) kind:feature A feature request and removed kind:bug Bug report or fix needs:triage Requires attention from one of the committers labels Jun 30, 2022
@KacerCZ
Copy link
Contributor

KacerCZ commented Jun 30, 2022

NetBeans currently does not support code completion.
Support added in #2640 supports basic editing and formatting.

@m7md3omr
Copy link

I ve reported a bug couple of days ago about auto-compelete crushes

@junichi11 junichi11 self-assigned this Jun 30, 2022
@junichi11 junichi11 added this to the NB21 milestone Jan 8, 2024
junichi11 added a commit to junichi11/netbeans that referenced this issue Jan 8, 2024
- apache#4300
- https://wiki.php.net/rfc/attributes_v2
- https://wiki.php.net/rfc/shorter_attribute_syntax
- https://wiki.php.net/rfc/shorter_attribute_syntax_change
- Fix the code completion feature
- Index classess marked as the Attribute(`#[\Attribute]`)
- Add/Fix unit tests for the indexer and the code completion
- Increment the spec version

Note: The following case is not fixed yet.
```php
 #[MyAttr(self::^CONST1)] // don't work here yet
 class Example {
     public const CONST1 = 1;
 }
```
@junichi11 junichi11 linked a pull request Jan 8, 2024 that will close this issue
junichi11 added a commit to junichi11/netbeans that referenced this issue Jan 9, 2024
- apache#4300
- https://wiki.php.net/rfc/attributes_v2
- https://wiki.php.net/rfc/shorter_attribute_syntax
- https://wiki.php.net/rfc/shorter_attribute_syntax_change
- Fix the code completion feature
- Index classess marked as the Attribute(`#[\Attribute]`)
- Add/Fix unit tests for the indexer and the code completion
- Increment the spec version

Note: The following case is not fixed yet.
```php
 #[MyAttr(self::^CONST1)] // don't work here yet
 class Example {
     public const CONST1 = 1;
 }
```
@stollr
Copy link

stollr commented Jan 9, 2024

Great news. Thank you :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:feature A feature request PHP [ci] enable extra PHP tests (php/php.editor)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants