Comments (7)
also reported at symfony2 plugin Haehnchen/idea-php-symfony2-plugin#311.
do you have some reallife examples?
from idea-php-annotation-plugin.
If the class names and class constants below would be part of the auto completion dialog, that would work perfectly for me:
/**
* @Route Routes::TEACHER_REGISTRATION_INVITE
* @Method Methods::POST
* @ContentType MimeTypes::APPLICATION_JSON
* @Accept MimeTypes::APPLICATION_JSON
*/
public function booger () { }
Basically these are completions that will trigger within class methods. So Routes for instance is just a class, no specific comment blocks within that class that would be required to make it appear.
Use case would be that I can limit suggestions for classes after the @
by using the @annotation
comment, but can then pass any class constant as argument to it. This way I can put f.i. all my Routes in a single wrapper class for easy maintenance and easy request mapping because autocompletion :)
I noticed by default it is wrapped within ()
, I could work with that, if it makes it easier to implement:
/**
* @Route(Routes::TEACHER_REGISTRATION_INVITE)
* @Method(Methods::POST)
* @ContentType(MimeTypes::APPLICATION_JSON)
* @Accept(MimeTypes::APPLICATION_JSON)
*/
And actually, I wouldn't mind if I'd have to annotate the classes to appear in the arguments suggestion box either. Preferably not all the constants though, as that could become quite a number (many URLs).
from idea-php-annotation-plugin.
from @litvinok at symfony2 issues: Haehnchen/idea-php-symfony2-plugin#311
The Symfony2 supports using constant in annotation, so we've used constants for set group validation in the annotation.
use MyBundle\ValidationGroup;
/**
* @var string
*
* @ORM\Column(type="string", nullable=false)
* @Assert\NotNull(groups={ValidationGroup::CREATE})
*/
private $name;
The Phpstorm's plugin doesn't highlighted use
block and doesn't suggest anything in annotation.
from idea-php-annotation-plugin.
then just use ´ClassName::.*´ for "Optimize Imports" detection. completion events is a little bit harder, need to think in which situations allow this, first.
from idea-php-annotation-plugin.
completion and goto are in. references (Optimize Imports) not possible, because of api limits. only "@tag" is accessible, i can attach class there, but thats not really nice.
external issue:
http://youtrack.jetbrains.com/issue/WI-24566
from idea-php-annotation-plugin.
You sir, are a king.
This certainly looks like it'll be good to work with. Using the *@Routes(Class::constant)
format gives me excellent suggestions, dropdowns and all. The *@Routes Class::constant
format gives the tooltip once I've typed Class::c
and hit ctrl+space (so hinting based on first char(s)), while the (Class::
will hint me all constants in the class when I hit ctrl+space. Very nice, thanks.
from idea-php-annotation-plugin.
"Optimize Imports" will go with new phpstorm8 api #22
from idea-php-annotation-plugin.
Related Issues (20)
- Autocompletion sort order HOT 2
- Сollapse the code of nested annotations
- Unused imports detected for classes with generic type annotations HOT 1
- Stub index points to a file without PSI HOT 1
- Error in PhpStorm HOT 1
- JavascriptParserDefinition error in PhpStorm HOT 1
- Embedded classes => @ORM\Embeddable instead of @ORM\Embedded.
- [attributes] Incorrect Doctrine autocomplete HOT 1
- Argument autocompletion based on .phpstorm.meta.php
- Add PHP 8 Attribute generator for supported classes HOT 3
- Tests are not running due toolbox.xml conflict
- Incorrect Doctrine deprecation flagged on OpenApi attributes
- Symfony Doctrine - Decision between Annotation and Attribute could be better HOT 1
- Error with PHPStorm 2023.1 EAP HOT 9
- Support "Use Alias" feature for PHP 8 attributes HOT 1
- Remove / Fix inspection preview feature for "Add Doctrine repository"
- Annotations marked as unused in PHPStorm 2023.2 EAP HOT 7
- Import is considered "used" if FQCN + ::foo() in doc comment.
- Renaming class is not working HOT 2
- Unused import: "Unused statement use" reported when using Doctrine annotations HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from idea-php-annotation-plugin.