Comments (10)
so highlighting should be moved from annotation extension itself to inspections, so then it can be disabled.
also thinking of add whitelist ui in settings, also getting some failreports on drupal8
from idea-php-annotation-plugin.
Would also be interested in seeing this fixed. As you say, this occurs quite often in Drupal 8. Having an inspection setting for this ("Warn about missing annotation imports") would be perfect!
Also, the warning has only the label "Import" and currently links to "General » Annotator" – the former a bit monosyllabic, the latter pretty confusing.
(See also: http://youtrack.jetbrains.com/issue/WI-24731)
from idea-php-annotation-plugin.
Yeah I keep getting missing import as well whereas its not needed .. highly annoying as it highlights all the annotations..
from idea-php-annotation-plugin.
Ideally, the warning should be smart enough not to warn when the annotations are used in a Drupal 8 context, but to warn in more typical situations where they are needed. This probably needs a degree of cooperation with the Drupal support plugin.
from idea-php-annotation-plugin.
Is there any update on this?
from idea-php-annotation-plugin.
Chiming in here as well to see if any progress been made. Happy to help if given some guidance :)
from idea-php-annotation-plugin.
The warning is created here, I would guess it should be possible to find out whether the inspection defined as localInspection groupPath="PHP" shortName="AnnotationMissingUseInspection" displayName="Missing Import"
etc is enabled or not and change this to createInfoAnnotation
when not.. A bit shooting in the dark as I am not particularly familiar with the class hierarchy of IDEA but getting there. @sylus is this enough to start?
from idea-php-annotation-plugin.
Given a scenario where both types of annotations are used:
How should this plugin decide which annotation needs importing and which does not?
from idea-php-annotation-plugin.
Given a scenario where both types of annotations are used:
How should this plugin decide which annotation needs importing and which does not?
If fixing this just for Drupal 8 (don't know whether import-less annotations exist in other projects and, if so, how common they are), it might be possible to either cooperate with the "Drupal" plugin, or to just look whether an annotation with that classname exists in some sub-namespace of \Drupal
.
However, only a single person here has actually requested this, I think the much more typical case is just wanting to disable the warnings completely.
Also, currently I can't even reproduce the problem anymore. I have enabled the new PHP > Annotation > Missing Import inspection, but I still don't get any warnings for them. That actually seems like a new bug caused by this. But in general, with this setting now present, it looks like this is resolved as far as my requirements are concerned. So thanks a lot for that!
from idea-php-annotation-plugin.
only a single person here has actually requested this
Make this +1 :)
I am working on something where I would have a Drupal module which uses Drupal and non-Drupal annotations.
I think the much more typical case is just wanting to disable the warnings completely.
Problem is, those annotations that do require an import won't work without it. So for those I really would appreciate the warning.
or to just look whether an annotation with that classname exists in some sub-namespace of \Drupal
Maybe implement this for a start, and then if the question pops up again, make these namespaces somehow configurable.
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.