Git Product home page Git Product logo

Comments (7)

Haehnchen avatar Haehnchen commented on May 28, 2024

also reported at symfony2 plugin Haehnchen/idea-php-symfony2-plugin#311.

do you have some reallife examples?

from idea-php-annotation-plugin.

KrekkieD avatar KrekkieD commented on May 28, 2024

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.

Haehnchen avatar Haehnchen commented on May 28, 2024

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.

Haehnchen avatar Haehnchen commented on May 28, 2024

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.

Haehnchen avatar Haehnchen commented on May 28, 2024

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.

KrekkieD avatar KrekkieD commented on May 28, 2024

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.

Haehnchen avatar Haehnchen commented on May 28, 2024

"Optimize Imports" will go with new phpstorm8 api #22

from idea-php-annotation-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.