Commit Graph

2693 Commits

Author SHA1 Message Date
Bas Leijdekkers
638d02690b Java: anonymous and local classes are not runnable, don't show run line marker (IDEA-310635)
GitOrigin-RevId: f1ff2c762a9c2936004aa9f56e4721ccf60e1591
2023-01-20 17:50:36 +00:00
Bas Leijdekkers
c5e1e1bff9 Java: fix main method detection
in "Call to System.exit() or related methods" inspection

GitOrigin-RevId: ba2ebdcce52fae51c30e6c3321a0cbbc4382afb3
2023-01-20 17:50:31 +00:00
Mikhail Pyltsin
df163482cf IDEA-310500 JavaCodeStyleManager returns more common names for fields and parameters
GitOrigin-RevId: 40dc2a001f35af6cc5cb7db8aeb4c0304016b9fd
2023-01-20 16:50:07 +00:00
Nikolay Chashnikov
5ef8398f8b [java] add workaround for deadlock during PsiType initialization (IDEA-309438)
In order to fix the deadlock properly, we need to remove constants of PsiPrimitiveType from PsiType, but this would break compatibility with many plugins. So as a temporary workaround, we can ensure that initialization of PsiType is triggered before its inheritors are initialized. Since many classes refer to PsiType from they static initializers, it seems that the problem may happen only if one of PsiType's inheritors is accessed in some static initializer before PsiType is accessed. I've found only 2 such places in intellij sources, and both are fixed here.

GitOrigin-RevId: 4f4ed9d363a3c317d5719112527e64d80ba256f1
2023-01-20 16:48:46 +00:00
Nikolay Chashnikov
37ce2ff8a6 cleanup: remove redundant '@author' tags from javadoc comments - 10
Now we have Code Vision hints which determine the author via Git history and show it in the editor automatically, and this information is more accurate than the tags which were automatically added when files were created.

GitOrigin-RevId: c9da0e5b671b6049f85db4824ea81782e2977d77
2023-01-18 17:01:57 +00:00
Nikolay Chashnikov
1487a324c4 cleanup: remove redundant '@author' tags from javadoc comments - 7
Now we have Code Vision hints which determine the author via Git history and show it in the editor automatically, and this information is more accurate than the tags which were automatically added when files were created.

GitOrigin-RevId: f2a6ec37a89b7497556ced0b92be3fa7679ba304
2023-01-18 17:01:47 +00:00
Nikolay Chashnikov
98b622aa27 cleanup: remove redundant '@author' tags from javadoc comments - 5
Now we have Code Vision hints which determine the author via Git history and show it in the editor automatically, and this information is more accurate than the tags which were automatically added when files were created.

GitOrigin-RevId: e1f798814ca7f22747768b99cbcd962d820bbfb9
2023-01-18 17:01:41 +00:00
Nikolay Chashnikov
0a451b153a cleanup: remove redundant '@author' tags from javadoc comments - 4
Now we have Code Vision hints which determine the author via Git history and show it in the editor automatically, and this information is more accurate than the tags which were automatically added when files were created.

GitOrigin-RevId: 2a8d01dd0d66c54b47502b43899db4ca541387ed
2023-01-18 17:01:37 +00:00
Roman Ivanov
fe14e15bbe [java] fix tests after migration to PsiForeachPatternStatement
GitOrigin-RevId: 03ee3891a40d75beebb1be84b803bc04b31109b3
2023-01-18 13:59:08 +00:00
Roman Ivanov
ef8f26b484 [java, psi] introduce new PSI element: PsiForeachPatternStatement and extract base interface for foreach stmt
GitOrigin-RevId: d57f03553d360bf18bcb3a5a0a1f0c57fea58f91
2023-01-18 13:58:58 +00:00
Tagir Valeev
5cef9a17e6 [java-psi] IDEA-310203 Support type inference changes in Java 20
GitOrigin-RevId: 6a2699b68b1babf14683df9939033cd394f87a8d
2023-01-17 09:26:59 +00:00
Alexey Kudravtsev
8cdf09320c fix method signature types
GitOrigin-RevId: 77702c655d62f2fffb3fc6b9124931ebc3133375
2023-01-14 20:40:47 +00:00
Roman Ivanov
29246b4b6a [java, psi] mark getIterationParameter not deprecated, but nullable
GitOrigin-RevId: 71c26eacc83591209a5fc2cf2ba7a4c37cd5e653
2023-01-12 14:45:06 +00:00
Tagir Valeev
4b5400beb3 [java-highlighting] Report ':' or '->' expected instead of ':' expected when parsing switch case (IDEA-309553)
GitOrigin-RevId: 1820e2fc1045450cee2abe0064b6a12576bd5abc
2023-01-11 16:33:07 +00:00
Daniil Ovchinnikov
30fa6f95fa Kotlin 1.8 language and API versions
GitOrigin-RevId: d019dab5535d6f9405514bb0efb7ffa6cd27f5b0
2023-01-07 13:16:21 +00:00
Andrey Cherkasov
1b6720c0e1 [java] change language level 20 preview description
IDEA-309350

GitOrigin-RevId: 8370c079df4fc95ab44b76ed1d2c42d8b0aadfff
2023-01-04 12:39:42 +00:00
Alexey Kudravtsev
6f0bbff76d mark some core methods returning List @Unmodifiable to reduce risk of modifying immutable collections
GitOrigin-RevId: 19f2b45dc06093e0da59ff3990ad62ca96ac4329
2022-12-28 13:57:21 +00:00
Andrey Cherkasov
0d2bc9f50c language level 20 (IDEA-309350)
GitOrigin-RevId: dc36fd66f692a01ec8dbecb3100449ea55f7200f
2022-12-26 13:39:16 +00:00
Roman Ivanov
568844bfd0 [java, psi] add superinterface for pattern and parameter for better API in new foreach
GitOrigin-RevId: 93afc2a7ab4f5515f8afc4a8c2877e0cfaa4d180
2022-12-16 16:22:51 +00:00
Roman Ivanov
eddad6b023 [psi, parser, java] implement parser and PSI for foreach patterns from Record Patterns (Second Preview)
IDEA-308153

GitOrigin-RevId: 71fafb4ada07e40cfe586cff51d415d415d216ad
2022-12-15 09:51:03 +00:00
Bas Leijdekkers
3616dd0068 Java: add some JavaDoc to document the method's contract
GitOrigin-RevId: 68fadfea9807aad520ac6260b5c03228fa576d0c
2022-12-14 00:10:55 +00:00
Bas Leijdekkers
08fad4393b Java: cleanup
GitOrigin-RevId: 8464852435df637515d8f15c7f2530d9dd3320e2
2022-12-13 00:13:30 +00:00
Alexey Kudravtsev
dba91f1146 cleanup: extract ArrayUtil.contains
GitOrigin-RevId: 657f7feef66073a76f2a76635ceb9af79e347d56
2022-12-08 16:54:26 +00:00
Michail Plushnikov
dc1dac6314 [lombok] IDEA-305806 IDEA-301687 moved default implementation to interface
GitOrigin-RevId: a784171572707e57aee4687b56257d60233436fa
2022-12-05 19:44:43 +00:00
Bas Leijdekkers
14a69c17fc Java: offer quick-fix to implement abstract method in enum (IDEA-231187)
GitOrigin-RevId: d7ee95a34123b69ad5ad2b3f59a5da614412e074
2022-12-05 13:46:39 +00:00
Michail Plushnikov
50788430bd [lombok] IDEA-305806 IDEA-301687 provided new extension point for custom property group handling : added support to "structure tool tab" to show lombok's @With methods and @Accessors(fluent = true) in properties (together with getters and setter)
GitOrigin-RevId: f7baae1c9c5690c2b0002d3b1276b7d25ec83040
2022-12-04 13:24:02 +00:00
Tagir Valeev
b1b86663f5 Fix warnings, remove redundant code
GitOrigin-RevId: 51a10169e1f613fc5564a0c056a697fd054de112
2022-12-02 10:26:15 +00:00
Tagir Valeev
48b51341fc [java-psi] getEnclosingStaticElement: simplify check
GitOrigin-RevId: ff93d2045d8f0a2cd84b02d7ad5cdb7cdc5a6fda
2022-12-01 09:24:24 +00:00
Tagir Valeev
ca92dff63c [java-inspections] Use context in PsiUtil.getEnclosingStaticElement
Alternative fix for IDEA-157610 Don't shorten reference in static context when in dummy holder

GitOrigin-RevId: 7f0ec05cea2e7e762a54a76ac33a6ee1e544075f
2022-11-29 14:05:41 +00:00
Alexey Kudravtsev
a2192e09d5 cleanup
GitOrigin-RevId: fe9ee62f2f76c4b183515c6332a911858869044e
2022-11-23 13:38:55 +00:00
Andrei.Kuznetsov
4b96a7f0d8 IJP-1342: Remove invalid dependency core>non.core (intellij.java.psi>intellij.platform.analysis)
"Core" modules are the modules that used not only from IDEA, but also from some other code (kotlin compiler for example). We don't want intellij.platform.analysis to leak into kotlin compiler. Instead, we introduce new Application level service with the ugliest possible (still comprehensible) name and provide two implementations: default (will be used by kotlin compiler and other non-IDE code), and non-default (InternalPersistentJavaLanguageLevelReaderServiceImpl), which overrides default in IDE, and delegates to JavaLanguageLevelPusher.

We want to delete this ugly InternalPersistentJavaLanguageLevelReaderServiceImpl as soon as we find a good way to quickly evaluate if some file needs to be indexed in `JavaFileElementType#isInSourceContent` (where we have no Project, nor even ProjectManager)

GitOrigin-RevId: b553d774ff529ba507b5f5b35488f9dfc28ed58e
2022-11-17 18:56:13 +00:00
andrei.kuznetsov
21de7c822c IJP-1342: Use FilePropertyKey in pushers
GitOrigin-RevId: 4801d976d564f2c82839c10c0b8955e6af9d4fad
2022-11-17 18:56:07 +00:00
Bas Leijdekkers
27df791975 Java: cleanup
GitOrigin-RevId: 2e6c18048fed76ce0e03dd844a1622b2dbb3f4ff
2022-11-16 19:42:21 +00:00
Bas Leijdekkers
b9a6e40f0c Java: render array initializer expressions, switch expressions and instanceof expression correctly
GitOrigin-RevId: aad22125d6c8cbea4c398282a0eabb429c65e735
2022-11-16 19:42:12 +00:00
Anna Kozlova
91021e29ae [kotlin] slightly optimize entry points calculations
GitOrigin-RevId: b1559b955b6aefe05e160ecfbfccfa1ba3f36371
2022-11-08 10:41:49 +00:00
Nikolay Chashnikov
634cd37c99 [java] ensure that Query::forEach call processes all elements
When a reference to Set::add method is passed to it, it stop processing elements at first duplicate, because 'add' will return 'false' and it'll be interpreted as the stop signal.

GitOrigin-RevId: f0318ec0b42946f2f5d1c46ac389eb96bca15c33
2022-11-08 09:57:52 +00:00
Vladimir Krivosheev
1fab830b47 cleanup
GitOrigin-RevId: c5fde4046470262a6468c52896b8ee9c6fa26358
2022-10-26 18:46:22 +00:00
Nikolay Chashnikov
e7195f6214 cleanup: remove '@author peter' tags from javadoc comments
Now we have Code Vision hints which determine the author via Git history and show it in the editor automatically, and this information is more accurate than the tags which were automatically added when files were created.

GitOrigin-RevId: 99ea11604b3d5dfdf838d7f3685477814e642ceb
2022-10-13 14:39:10 +00:00
Daniil Ovchinnikov
45d44ea146 @JvmDefault: use -Xjvm-default=all
GitOrigin-RevId: 461876a557e97c9fd17fe5324c38ea268d18162e
2022-10-13 14:13:50 +00:00
Bas Leijdekkers
80e45ca73f avoid unnecessary unicode escape warnings
GitOrigin-RevId: fc6a3de26e047c646fa068a220356a9ebd20150c
2022-10-01 14:21:20 +00:00
Anna Kozlova
260ef14b96 [java] java 19 is released
GitOrigin-RevId: cb7515e3add378d5ec5598ff074421d867f3693a
2022-09-22 20:32:14 +00:00
Nikolay Chashnikov
4679eb06e2 [java] API: remove 'for removal' flag from deprecated API which aren't going to be removed soon (IDEA-301912)
GitOrigin-RevId: 3ce76a4f3ee030f3212317b875980bbd6b139567
2022-09-16 12:41:24 +00:00
Nikolay Chashnikov
07946fb1dd [java] cleanup: remove unused deprecated API (IDEA-295370)
GitOrigin-RevId: c8370b89546b74bf94c6c6d249d7cdd34233c7a4
2022-09-06 12:45:03 +00:00
Tagir Valeev
98e7ca52f1 [java-inspections] IDEA-301083 "Replace lambda with method reference" doesn't work for constructor calls in nested Enum
Copied enum was created always at top-level. In fact, as we copy the whole file anyway, there's no need to do something additional with enum. Just find it in copy and return.

GitOrigin-RevId: d85c21acfc879c02be0ef85eff4264faf0c99ffb
2022-09-05 20:08:11 +00:00
Bas Leijdekkers
e7c55493a1 Java: fix IOE on replacing single character string operation
GitOrigin-RevId: 26ba697294eebb109148b86672a22e7aa2e921e4
2022-08-29 22:19:46 +00:00
Nikolay Chashnikov
2251f9330d [platform] move 'getPackageNameByDirectory' from platform to Java plugin
...because packages is a Java thing.

GitOrigin-RevId: 4974402aab9aaf77b3e725e83a4d96979c83319d
2022-08-26 17:14:26 +00:00
Vladimir Krivosheev
0e886c903e Icon class should be not used directly and should be located in ui but not generic modules
GitOrigin-RevId: 4c3b4a1ec67a88fb32df9cd618a4fe42ed4423ed
2022-08-24 20:05:20 +00:00
Bas Leijdekkers
9addc5eaf7 java: include parentheses () in text when referring to methods
GitOrigin-RevId: 1cfc8afb26b5db175d865f6bbdc752356040d8bb
2022-08-22 17:58:06 +00:00
Tagir Valeev
a7b011c256 [java-psi] Check not-nullity in TypeAnnotationProvider.Static.create
Should supersede EA-636157 - NPE: PsiImmediateClassType.isValid

GitOrigin-RevId: a8fa43d196712d62c89ea72eda7725f61106034f
2022-08-18 20:52:02 +00:00
Tagir Valeev
4b6f8b9e2a [java-completion] IDEA-300061 Java 19: add completion for deconstruction patterns
GitOrigin-RevId: 359d20c7cf1703864417bd0dc37760cc88dd6729
2022-08-17 18:22:06 +00:00