Commit Graph

82 Commits

Author SHA1 Message Date
Sergey Patrikeev
5c3f54c486 IDEA-219976: False-positive "class must not be extended" for a nested class, whose enclosing class is @NonExtendable.
GitOrigin-RevId: 3686fadd23c193966411419f354e94f58ecb5faa
2019-08-08 15:05:59 +03:00
Nicolay Mitropolsky
6e357707cb SuspiciousPackagePrivateAccessInspection: fully Uast-based retrieval of the context class for given node
GitOrigin-RevId: 4d5707b7322883d2735f7e636de6491e8b31b303
2019-07-04 13:03:50 +03:00
Daniil Ovchinnikov
cd3ee635f8 [uast] add UAnnotated#uAnnotations instead of #annotations
GitOrigin-RevId: 61851be3b0a9526ecb21d6f4f6b91b833f306d28
2019-07-02 06:52:16 +03:00
Sergey Patrikeev
ed274916d8 UnstableApiUsageInspection: update description.
GitOrigin-RevId: 7af1c361f331adad5efcc85b0a62bc23560b8c26
2019-07-02 06:52:16 +03:00
Sergey Patrikeev
409320be50 UnstableTypeUsedInSignatureInspection: update inspection description.
GitOrigin-RevId: f5ff043796554fa0f0d64632c59f549d7e00532c
2019-07-02 06:52:16 +03:00
Sergey Patrikeev
9287b50dcd UnstableTypeUsedInSignatureInspection: disable by default.
GitOrigin-RevId: fcbab879fe5c45ad4316b6680554d896f2b2127e
2019-07-02 06:52:16 +03:00
Sergey Patrikeev
397efd89ee UnstableTypeUsedInSignatureInspection: cleanup imports.
GitOrigin-RevId: 6562e34a128922de35e2ed42b628729af19e8023
2019-07-02 06:52:16 +03:00
Sergey Patrikeev
444fede6e0 Revert "UnstableTypeUsedInSignatureInspection: do not produce a warning in a annotated Kotlin file.
This reverts commit ad36f41a.

@file:ApiStatus.Experimental does not mean that all classes\methods declared in this file are experimental, as it may seem naively. Instead, it only means that a class generated for top level declarations in the file (for file with name 'file.kt' class name will be 'FileKt') will be annotated but not other top-level classes in the file.

GitOrigin-RevId: 5dadbf90aff8a0f421379f0e55786eac7848f201
2019-07-02 06:52:16 +03:00
Sergey Patrikeev
90e915819b UnstableTypeUsedInSignatureInspection: ensure warnings are not produced for anonymous classes declarations.
GitOrigin-RevId: b6c241f54ea29482172f8b01fdd6c6a88d3139a7
2019-07-02 06:52:16 +03:00
Sergey Patrikeev
846e687b26 UnstableTypeUsedInSignatureInspection: do not produce a warning in a Kotlin file annotated with unstable annotation.
GitOrigin-RevId: ad36f41acde6f97f1b3f24d23bbab59d0def7d22
2019-07-02 06:52:16 +03:00
Sergey Patrikeev
84b036832c MustAlreadyBeRemovedApiInspection description: encode less-than signs "<" with HTML codes.
GitOrigin-RevId: aeba913e798bb3dda6e60fa3cc6caae15b5f62e4
2019-07-02 06:52:16 +03:00
Sergey Patrikeev
c080fa6df2 UnstableApiUsageInspection: do not report API usages of members declared in the same file.
GitOrigin-RevId: c103f514fcc7dcdddc94c761d275a135e6bf580c
2019-07-02 06:52:16 +03:00
Sergey Patrikeev
9329e65e5b UnstableTypeUsedInSignature: do not emit warning if declaration is containing inside private or package local class.
GitOrigin-RevId: 3c55d941a582af00a01faf65f14a4d8fc07dc709
2019-07-02 06:52:16 +03:00
Sergey Patrikeev
ddc5ccd24c UnstableApiUsageInspection: check if signature of the referenced API contains an unstable type.
For example, if a method's parameter is marked with @ApiStatus.Experimental annotation, the method is effectively experimental. Invoking such a method from plugin code must be highlighted even if the method itself is not marked with the same annotation.

GitOrigin-RevId: 5ebd52b3a525a0d51aa2cbed5cb2603157e7f292
2019-07-02 06:52:16 +03:00
Sergey Patrikeev
3d3e5ed2bc UnstableTypeUsedInSignatureInspection refactoring: move PSI visitor to top-level.
GitOrigin-RevId: a148b87b43fbdd00ddc6215ee24ca5533e0c6a86
2019-07-02 06:52:16 +03:00
Sergey Patrikeev
4e0b7c950e UnstableApiUsageInspection: extract overridden method case to a separate method. Update testdata for ScheduledForRemoval
GitOrigin-RevId: a855fca7fbc9c3865108aa6937d962709a1471dc
2019-07-02 06:52:16 +03:00
Sergey Patrikeev
c9ea0a57e6 Unstable\ScheduledForRemoval API usage inspections: improve messages for methods\fields declared in annotated classes.
GitOrigin-RevId: 95db4460a5f65bfcc0846b0840dccf16af720645
2019-07-02 06:52:16 +03:00
Sergey Patrikeev
06e57b5034 JvmAnalysisBundle: remove unused property.
GitOrigin-RevId: 58a79be19190ba4df61f6f8e17cd3c8242d39128
2019-07-02 06:52:16 +03:00
Sergey Patrikeev
37fd165f7e Merge ScheduledForRemovalInspection into UnstableApiUsageInspection.
ScheduledForRemovalInspection is effectively the same as more general UnstableApiUsageInspection. The only thing that differs is the provided message "Foo is scheduled for removal in 2.3.4" instead of "Foo is marked unstable". To customize the message a dedicated "message provider" interface is extracted. It may later be utilized for other annotations.

Also tests for "scheduled for removal API usages" are moved next to the tests of the UnstableApiUsageInspection.

GitOrigin-RevId: 0693f41954bd5a4d79699b83a76cd4d293a56f9a
2019-07-02 06:52:16 +03:00
Sergey Patrikeev
f04eaad9a2 IDEA-215432: UnstableApiUsage\ScheduledForRemoval inspections: check if containing declaration is marked with annotation
If a class is marked with @ApiStatus.Internal annotation, all its methods must be considered internal, even if invocation is performed via a subclass and no explicit reference onto a class exists.
If a package is marked with @ApiStatus.Internal, all its classes and their members must be considered internal.

GitOrigin-RevId: f8bcb2a91cf958b878cd45a58d4fed69297fd372
2019-07-02 06:52:16 +03:00
Sergey Patrikeev
fcac91fe5f Refactoring of ScheduledForRemovalInspection\UnstableApiUsageInspection: avoid unnecessary inheritance from base class.
GitOrigin-RevId: fee3aa43418998f249a8d094bd108f6075748a93
2019-07-02 06:52:16 +03:00
Sergey Patrikeev
c9eae61072 UnstableTypeUsedInSignatureInspection: do not report if declaration is not accessible (private), or in the same package
GitOrigin-RevId: ac1182eefc5894b9893481015d3b3355785b37a0
2019-07-02 06:52:16 +03:00
Sergey Patrikeev
6c8d9ccd9b IDEA-215436: Inspection that checks if declaration with "unstable" API type in signature is "unstable" on its own.
GitOrigin-RevId: 6ba9bf7a8ebfd8b34488cb98536c5fa3e781deb7
2019-07-02 06:52:16 +03:00
Sergey Patrikeev
31144cdb6f UnstableApiUsageInspection: restore serialization of annotations list.
GitOrigin-RevId: 574a362606944cb9990bc50fa5666a7cd42e7888
2019-07-02 06:52:16 +03:00
Sergey Patrikeev
ed1acb9b0d ScheduledForRemovalInspection and UnstableApiUsageInspection: convert to Kotlin and support method overriding case.
GitOrigin-RevId: dd24dbf613673ae788e1f2ae0229c0ef27e66fe3
2019-07-02 06:52:16 +03:00
Sergey Patrikeev
9b498304a6 IDEA-216155: inspection that warns if API marked with @ScheduledForRemoval annotation must already be removed.
GitOrigin-RevId: bb9cc3c842e6110d801f718717665498a077e3a3
2019-07-02 06:52:16 +03:00
Nikita Katkov
bd23318cb4 BlockingMethodInNonBlockingContextInspection: now works on Android Studio (KT-30561)
GitOrigin-RevId: 1954773735187c8daf1193299718b03f655fc698
2019-07-02 06:52:16 +03:00
Nikita Katkov
0e68be5bb9 BlockingMethodInNonBlockingContextInspection: ui fixes for (IDEA-208839, IDEA-209407)
GitOrigin-RevId: de736c973c7b5a1383355d0573217cd3ac76b7aa
2019-07-02 06:52:16 +03:00
Nikita Katkov
0e25daec99 BlockingMethodInNonBlockingContextInspection: both thrown exception and it's supers are checked (IDEA-209249)
GitOrigin-RevId: b9f74b84e6fd68482cb49e2c7753b0f338eceee4
2019-07-02 06:52:16 +03:00
Sergey Patrikeev
73eefb0d8b AnnotatedElementInspectionBase: rename property to correspond with class name.
GitOrigin-RevId: 6aa2a4345e39c48211760fae5ecbefb7cc47d6f9
2019-07-02 06:52:16 +03:00
Sergey Patrikeev
ff1c88be77 NonExtendableApiUsageInspection optimization: do not evaluate method name until it is required.
GitOrigin-RevId: dc54abcfc63ff8d0914c635d447b6d2c0193f663
2019-07-02 06:52:16 +03:00
Sergey Patrikeev
cbe1384451 IDEA-211503: Add inspection checking that @ApiStatus.ScheduledForRemoval annotation is accompanied by the @Deprecated.
GitOrigin-RevId: 071f0a6c823037bade61bc42a1e9714515439111
2019-07-02 06:52:16 +03:00
Sergey Patrikeev
33d5494265 Remove mistakenly committed file.
GitOrigin-RevId: 066bba673b83b7bb42b54ef1c938b070793c7b41
2019-07-02 06:52:16 +03:00
Rustam Vishnyakov
123242c4b2 EditorConfig documentation test
GitOrigin-RevId: fd52ace3d7a32ecd02c2c5ab90e077967604c15e
2019-06-16 04:03:21 +03:00
Egor Zhdan
c1813cfb52 Cleanup: NotNull/Nullable
GitOrigin-RevId: b8e892f32ea84c2115973155dba7127b892cc36e
2019-06-16 04:02:08 +03:00
Anna Kozlova
91f7445298 constructor reference: don't ignore constructor parameters during method reference inference (IDEA-185578)
GitOrigin-RevId: e836468e05db28157713e9edd3c70382f8ecdebc
2019-06-13 03:15:49 +03:00
Egor Zhdan
39d2d77155 Cleanup: NotNull/Nullable
GitOrigin-RevId: b8e892f32ea84c2115973155dba7127b892cc36e
2019-06-13 03:14:35 +03:00
Yann Cébron
0c639a2c22 DumpUastLog: fix text casing
GitOrigin-RevId: c42fe6139e7205f411d7f1acc6639044524183d8
2019-05-28 19:11:36 +03:00
Aleksey Rostovskiy
185284cee6 get rid of intellij.build.toolbox.litegen parameter and use BuildOptions.TOOLBOX_LITE_GEN_STEP to skip it instead
GitOrigin-RevId: 9aac8ee4ed1ebf2a29de18a238825fafb1ab88f9
2019-05-27 15:08:08 +03:00
Alexandr Suhinin
9215f4240b [duplicates] enable duplicates analysis in PyCharm/WebStorm/PhpStorm/RubyMine
GitOrigin-RevId: 1545b79fdca4888f4b94f47f22703fd37694fa7a
2019-05-27 15:07:30 +03:00
Roman Shevchenko
87233032bd Cleanup (unwarranted use of ApplicationEx)
GitOrigin-RevId: 502e79a13135bcd6c39dbcf487fef6f455022508
2019-05-27 13:07:08 +03:00
Anton Makeev
c105e26db3 Merge remote-tracking branch 'origin/master' into amakeev/gradle
GitOrigin-RevId: f9a633252daf311ecab19002c0f4757052eee9dc
2019-05-17 19:13:15 +03:00
Anton Makeev
aa103fd53c Merge branch 'master' into amakeev/gradle
# Conflicts:
#	community/plugins/gradle/src/org/jetbrains/plugins/gradle/service/settings/IdeaGradleProjectSettingsControlBuilder.java

GitOrigin-RevId: d931e798108685731bf185f7c2e3221680b8e5a2
2019-05-17 19:11:16 +03:00
Anton Makeev
b54aaf7e4e IDEA-210281 Cleanup Gradle settings: separate Runner configurable removed
GitOrigin-RevId: adbc39121fe91beb633e125b4cf39bfe0a422e4b
2019-05-17 19:02:16 +03:00
Sergey Patrikeev
44ad67b999 Platform API (IDEA-211307): add annotations prohibiting certain types of API usages.
Added annotations @ApiStatus.NonExtendable and @ApiStatus.OverrideOnly.
Added corresponding inspections checking violation of usages of annotated API.
Fix a couple of bugs in ApiUsageUastVisitor. Enforce both "processReference" (for class) and "processConstructorInvocation" (for constructor) events. Suppose code "new SomeClass(42)". We want ApiUsageVisitorBase to invoke both "processReference" for "SomeClass" and "processConstructorInvocation" for "SomeClass()", though they point to the same PSI element.

GitOrigin-RevId: 811b4d5a875dcb246582df1cd2e6be48cc96c990
2019-05-15 17:08:41 +03:00
Alexey Kudravtsev
44c620df51 add PECS wildcards to method signatures where necessary and where methods are not overridden by plugins
GitOrigin-RevId: 1ec7f1a1aa17d2d4f42e647207323ab8a3138683
2019-05-13 17:06:40 +03:00
Sergey Patrikeev
95cc10cd5e IDEA-210618: Reference implementation of PSI visitor for UAST-supporting languages that detects usages of APIs in source code. 2019-04-18 19:58:17 +03:00
nik
3ab4ba71b7 platform API: introduce ApiStatus.Internal annotation (IDEA-211175)
Usages of elements annotated with it in external plugins will be highlighted as warnings.
2019-04-17 09:05:22 +03:00
Nikita Katkov
eb073e18d2 BlockingMethodInNonBlockingContextInspection: removing the inspection level cache (IDEA-206047) 2019-02-11 15:15:07 +03:00
Sergey Patrikeev
4e1d9527ca ScheduledForRemoval: display version when API is going to be removed, if it's specified. 2019-02-01 19:12:40 +03:00