-
-
Notifications
You must be signed in to change notification settings - Fork 94
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
not interprets @mixin annotations. #123
Comments
Same here! |
That's a so great feature, It will be bravo if only vsc-intel did recognize mixin. |
Any updates on this? This is one of the only things that this extension is missing. Please implement it! 🙏 |
Hey @bmewburn, did you forget this feature? |
Also get the same feature request today working with traits (1 year old issue, wow) This will be wonderful for everything on PHP |
Is it difficult to support |
Is it just Laravel that needs this? With barryvdh/laravel-ide-helper ? Reason I haven't prioritised it is because |
I guess not, There should be many frameworks which prefer to use |
The package |
Models can extend the |
I have tried the extension. No hope for it. Still rely on mixin and Barry extension doesn't support all facade |
I forgot to clarify. Eloquent isn't available on Lumen, so that's why I said no hope. Only eloquent file stub that you share to me can make the autocomplete work. If without that file stub even I use PHP artisan ide-helper:generate it won't add any facade for model and I still need to extend from Illuminate\... \Model
…On October 8, 2019 5:27:52 PM GMT+07:00, Ben Mewburn ***@***.***> wrote:
Can I get an example of what methods aren't shown when extending
`\Eloquent`? In my tests `barryvdh/laravel-ide-helper` works well.
![Screenshot from 2019-10-08
21-27-11](https://user-images.githubusercontent.com/5885195/66388705-72edaa80-ea12-11e9-858a-80da36a36930.png)
--
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
#123 (comment)
--
Sent from my ASUS Pegasus X005 with K-9 Mail.
|
Not only the lumen, But also |
Ugh seems yes. https://laravel.com/api/5.6/Illuminate/Foundation/Auth/User.html I never touch it because it's my friend job so I never know this. Anyway let Ben decide first, I think if it's about money then why don't we set up the patreon again :v |
I'm not saying this won't get implemented. I'm just trying to understand the need for it and to decide the priority amongst all the other issues. |
with this feature, I can use vscode instead of phpstorm.:satisfied: |
Yeah. Just left phpstrom. It's not tpo great. I hate java memory management especially on windows. It sucks.
…On October 16, 2019 5:22:11 PM GMT+07:00, zed ***@***.***> wrote:
with this feature, I can use vscode instead of phpstorm.:satisfied:
--
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
#123 (comment)
--
Sent from my ASUS Pegasus X005 with K-9 Mail.
|
@bmewburn Mixin is required for it to show both Edit: Sorry, this is not the case, or maybe I didn't use IDE helper the right way before. Mixin support would enable full autocompletion with IDE helper without having to replace all model |
What he said. I was a little surprised to know it did not support it. Its a very useful feature. I wont type everything he said as a reason since he alrewady mentioned it, but it's very useful. |
im using it for another library other than laravel stuff. @mixin is amazing in phpstorm but in vscode :/ |
@bmewburn I'd like to ping you on this. There are many PHP frameworks that utilize some kind of magic, thus making it harder for IDEs to track down what properties/methods are available. Speaking of Laravel, there is an ide-helper plugin that helps generate missing docs and helps IDE also by inserting @mixin. While @mixin is not an official api, it would allow inherit those methods for many classes. In Laravel it would provide complete set of methods for model classes, for facades, for static calls. I understand that it may be hard to foresee the need, however having auto completion, method signatures are insanely helpful. I already use it as a main extension and loving all the full features. This would improve PHP developers performance by a significant amount! For reference, I include phpStorm issue https://youtrack.jetbrains.com/issue/WI-1730 and a practical article about it https://freek.dev/1482-the-mixin-php-docblock |
Then it doesn't autocomplete doc-defined methods or properties after the first one: However, if I change \Eloquent to ...\Builder in doc-defined properties or if it extends Model instead of \Eloquent, it works. So, I think it would be better using @mixin than extending \Eloquent. |
Thanks, late to the party here. Just want to point out that extending The addition of Also...
PHPDoc doesn't even have a formal standardisation. PSR is/was working on it but I'm not sure whether to hold out hope for it. The draft doesn't even have |
@Deji69 isn't |
For what it's worth the Silverstripe CMS also relies on |
Replicating PHPDocs is annoying! |
I guess we will need to do it on our own ... Did anyone look into the topic already? If anyone gathered some info on how to add an annotation please share it. Let's see if someone has a pull request for it until Monday 😉 |
@tjventurini I am in if someone needs any collaboration! |
implemented in 1.7 |
Finally! Wuhu!
Regards,
Benyamin Limanto
sent from my Sony XPERIA XZ Premium
…On Sun, 21 Mar 2021, 10:32 Ben Mewburn, ***@***.***> wrote:
implemented in 1.7
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#123 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAVP2NDUDK2PLLROWVLB42DTEVSDLANCNFSM4FN54DVQ>
.
|
Christmas came early guys!! The best message to wake up to! |
🥳🥳🥳🥳🥳🥳🥳🥳🥳🥳🥳🥳🥳🥳🥳🥳🥳 |
🎉 🎉 🎉 |
Finally! Whoop whoop! |
THANK YOU!!! |
Awesome!!!! When do you expect to release 1.7? |
Hope @bmewburn can do a pre-release~ the 1.7 milestone now only 14 percent, we are too difficult to wait. |
no, CodeIgniter 4.1.1 need this too for the Controller's e.g. this code will error on
please fix it :( |
It's 96% now :D |
Guys~ Finnally th 1.7 was release! Just go to have a try! But a sadness news is my favorite framework laravel, removed mixin from |
So how we get around it? Still need Barry Package? What a joke :/ @bmewburn work so hard to implement it, and they removed it.. what... |
You can If Laravel deleted some Example: <?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model as EloquentModel;
/**
* @mixin WHATEVER
*/
class Model extends EloquentModel {
} Your existing models should be extending from <?php
namespace App\Models;
class Post extends Model {
...
} |
Thanks to @alielmajdaoui, <?php
namespace App\Models;
use App\Traits\SetTransformer;
use Illuminate\Database\Eloquent\Model;
/**
* @mixin \Illuminate\Database\Query\Builder
* @mixin \Illuminate\Database\Eloquent\Builder
*/
abstract class BaseModel extends Model
{
use SetTransformer;
} Because all my final models are extending from <?php
namespace App\Models;
use App\Models\Relations\BelongsToUser;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class Cert extends BaseModel
{
use HasFactory;
use BelongsToUser;
} Seems that's the perfect solution for now. |
Sorry for commenting on this old issue, but I cannot get it to work. I'm Using PHP Intelephense v1.10.2, with VSCode 1.85.1. This is my model class: /**
* App\Models\Game
*
* @property int $id
* @property string $name
* @property OperativeSystem $operative_system
* @property GamePlatform $platform
* @property string $latest_version
* @property \Carbon\Carbon $created_at
* @property \Carbon\Carbon $updated_at
* @mixin \Eloquent
*/
class Game extends Model
{
//
} And when I try to autocomplete for Any idea of what am I missing? The |
Have you tried re-indexing just in case? @jhm-ciberman |
Do you have the premium license? |
@flexchar I just re-indexed and it still doesn't work.
@piotrjoniec Nope. But as far as I understand that feature should be under the "Code completion" category, and that is included in the non premium license. |
The premium licence is unfairly cheap so I'd totally suggest getting it. Make sure VS Code native PHP extension is off and check for the extension output to see for hints. |
I have the VSCode native PHP disabled: The Intelephense output log doesn't seem to have any info:
|
This extension works perfect under vscode.
but interprets
@mixin
annotations. eg: laravel's framework code..The text was updated successfully, but these errors were encountered: