Commit Graph

677 Commits

Author SHA1 Message Date
Tagir Valeev
3b688121d2 [java] IDEA-353981 'Rename to ignored' fix: ModCommand, allow 'fix all' action
GitOrigin-RevId: 83676caca1d4a0f6308d649efd92d6f58845b57e
2024-05-23 19:00:36 +00:00
Bas Leijdekkers
f668f5a02e [java] javadoc
GitOrigin-RevId: 079f44c6020a1eeb86126e93e08697aca5a7658c
2024-05-23 12:46:43 +00:00
Tagir Valeev
8fad668268 [java-inspection] IDEA-345669 Report value compared to itself with == or !=
GitOrigin-RevId: 601c0bb6c5beddaace52d3b094506d2229195d37
2024-05-15 15:55:21 +00:00
Tagir Valeev
ee495db972 [java-intentions] MoveMembersIntoClassFix: improve and revive property test
After implicit classes, out-of-class member is parsed. If it was mistakenly put out of the class, it may have many unrelated compilation errors. E.g. extra Override annotation, unresolved reference (to another member of the class), etc. These errors were masking the 'Move member to class' action, because its scope was larger (the whole method).
Now, we put 'feature not available' error specifically to the method/field name identifier, so it's almost always available. Also, action name is more friendly now, and JavaOutOfClassDefinitionPropertyTest is tuned: caret position and language level set correctly.

GitOrigin-RevId: 39917d11fb216be4db3f6fbc9e984ca7378f7302
2024-04-23 10:35:24 +00:00
Tagir Valeev
a3e3ed8591 [java-highlighting] Remove extra space
GitOrigin-RevId: 98a9c2395ef5f9605d39029dfe5e695d76c4237e
2024-04-23 09:43:59 +00:00
Tagir Valeev
11097530d4 [java-intentions] Remove outdated MoveMemberIntoClassFix.java
Superseded by MoveMemberIntoClassFix.java

GitOrigin-RevId: cc3a29aa7089f91ff5c13a61e722c0ad3843985e
2024-04-22 19:34:03 +00:00
Tagir Valeev
f943967aec [java-inspections] Minor fixes for IDEA-346242 Add 'minimal java version' clause automatically to inspection descriptions
1. Add features to assertion inspections
2. Remove redundant feature message from HTML descriptions
3. Display Java 1.3 and Java 1.4 version properly
4. Display several features when necessary

GitOrigin-RevId: 133b46152ad8376a37aa4fd847bedf38d45f3135
2024-04-05 10:20:31 +00:00
Bas Leijdekkers
9e22b48c16 [java] show containing file name of implicit classes in batch inspection results (IJ-CR-130524)
GitOrigin-RevId: 280b18e1a50ed18db8dfcc79ce95dc2d9669f9df
2024-04-03 14:14:27 +00:00
Tagir Valeev
15c815e7e2 [java-analysis] LanguageLevelUtil: cosmetic, javadoc
GitOrigin-RevId: f3fe627da3d6a72b94d88e2bb3bd945ad9d148ae
2024-04-03 09:29:41 +00:00
Bart van Helvert
fdbb442f08 [java] Fix getForbiddenApi doc
GitOrigin-RevId: 8db2036887fba88a69dd61b09761ca07422a15f4
2024-04-02 13:11:17 +00:00
Bart van Helvert
ee73aef512 [java] Only log when API file can't be found for non-highest language level
Makes it possible to add API files for language levels higher than the current HIGHEST like preview levels.

GitOrigin-RevId: 0b6b572609238d5015ca2361fb8ab59df35d088f
2024-04-02 13:11:12 +00:00
Bas Leijdekkers
ab2af3d314 [java] don't show implicit classes as "anonymous" in batch inspection results (IDEA-334425)
GitOrigin-RevId: 1c636b01743409c25ef084faca47f34b0127ff4d
2024-04-01 10:52:12 +00:00
Bart van Helvert
c5bc52d9fd [java] Don't do forbidden API check for highest language level
For the highest language level, no API should be forbidden. #IDEA-349722 Fixed

GitOrigin-RevId: 4819e096b798d4cc4b328cc85671a7180851b219
2024-03-28 15:54:54 +00:00
Alexey Kudravtsev
bd069c730f do not perform double conversion KtType<->JvmType, to avoid losing some type info in tricky cases (part of KTIJ-28926 K2: Create Function From Usage Fix)
GitOrigin-RevId: 1c86e6c4ef2c3ba3dbcff8caca906eac57d083aa
2024-03-28 14:43:53 +00:00
Tagir Valeev
6c6697d422 [java-inspections] CreateFieldFromParameterAction: ModCommand
Otherwise, it's hard to make it compatible with new-style unused inspection (IDEA-349083)
Also: remove empty line in constructor body automatically

GitOrigin-RevId: ab1cd08352d9f0168b86acc1d4b87cb89cfe7d69
2024-03-22 12:27:40 +00:00
Evgenii Zakharchenko
67fdd7d602 [ultimate] IDEA-348085 Spring bean autoinjection via completion: scroll jumps to the bottom
KTIJ-28883 Do not suggest a live template for Kotlin quick fix if there are no available variables

GitOrigin-RevId: 2cfc8120c17665774de31a3ee483aa0c0ec195ba
2024-03-21 14:17:29 +00:00
Alexey Kudravtsev
f294fccb79 K2: implement "create function from usage" for members (part of KTIJ-28926 K2: Create Function From Usage Fix)
- support "fir" version for dependency files in test data for AbstractQuickFixMultiFileTest
- support generation of @Nullable/@NotNull in java method signatures
- support nullability in generated java types (ExpectedTypeWithNullability)
- support implicit receivers in generation (see computeImplicitReceiverType)
- suggest creating new function in case of too many/too few arguments (K2CreateFromUsageQuickFixesRegistrar)

GitOrigin-RevId: d1adac9e7a4f5caeb2300e80c953e95a0c339dcf
2024-03-18 18:06:15 +00:00
Tagir Valeev
193b2cb477 [java-inspections] Experimental ModCommand-based DeletePrivateMethodFix for unused inspection
GitOrigin-RevId: efd9306505048695f1aa1de1851383e170b0c1ca
2024-03-12 16:55:18 +00:00
Evgenii Zakharchenko
c2db9ae649 [ultimate] IDEA-346716 Spring beans auto-injection via completion: scroll jumps to the top
GitOrigin-RevId: 84e1685d43d9c54e5d7452647a227e3532be47b6
2024-03-01 19:19:54 +00:00
Tagir Valeev
d89c17fc59 [kotlin-dfa] Move inspection.data.flow.warn.when.reading.a.value.guaranteed.to.be.constant to JavaAnalysisBundle
Preparatory step for KTIJ-28908 Convert "Constant conditions" inspection to K2

GitOrigin-RevId: 68798782d260f8245947423efd936ae82bde841c
2024-02-24 12:22:09 +00:00
Evgenii Zakharchenko
4deae98f45 [ultimate] IDEA-346716 Spring beans auto-injection via completion: scroll jumps to the top
KTIJ-28883 Do not suggest a live template for Kotlin quick fix if there are no available variables

GitOrigin-RevId: 65642a313c337517083830878b72a8b678230233
2024-02-22 22:38:26 +00:00
Aleksey Dobrynin
1b565a13b9 [java, quickfix] Refactor module access checking method and improve module naming. IJ-CR-125003
GitOrigin-RevId: 078deb60a0fbf497020fe73bd99e170171a30381
2024-02-16 11:31:20 +00:00
Tagir Valeev
64327f79d6 [java-inspections] IDEA-346242 Add 'minimal java version' clause automatically to inspection descriptions, based on the required feature(s)
GitOrigin-RevId: 50a25148d4d36c46e9552b3123d1ef966b40a2c2
2024-02-15 15:28:00 +00:00
Tagir Valeev
47a98d4500 [java] LanguageLevel#feature method; javadoc
GitOrigin-RevId: f3c57f7101b3ce7369c66b97411c897bdcd46d24
2024-02-15 13:23:21 +00:00
Tagir Valeev
2aa52eea2d [java] IDEA-345517 Feature-based support of unsupported preview language levels
GitOrigin-RevId: 3037d36588c239d6236ba64a7df2bf2a3b51cba4
2024-02-12 19:12:39 +00:00
Tagir Valeev
a7674dca70 [java] IDEA-345355 Refactor HighlightingFeature (in progress)
Create JavaLanguageFeature; move HighlightingFeature functionality there; move preview highlighting related utilities to new PreviewFeatureUtil class

GitOrigin-RevId: 116bcc9feb6fb40a0bd6a25ba10c2f35b41ffea6
2024-02-08 10:07:12 +00:00
Alexey Kudravtsev
8dc9393675 cleanup: get rid of mutable stuff (part of KTIJ-26893 K2: Create*FromUsageFix fix)
GitOrigin-RevId: 9504fa61ca4d88d2b01f837d0d00ca7d4768f93f
2024-02-06 22:38:17 +00:00
Alexey Kudravtsev
18b384f5d9 fix typos and incorrect links in javadoc
GitOrigin-RevId: 25daa667902e8ffac4612306b6c6e2019873ae2b
2024-02-06 22:38:12 +00:00
Dmitriy.Panov
103eee0118 Revert "fix typos and incorrect links in javadoc"
This reverts commit b0a6236002781f491a71059c7d96ee625717bfa0.

GitOrigin-RevId: 8d1bcb419b22ab480f7a5f3d10fef0edd1582dba
2024-02-05 23:42:36 +01:00
Dmitriy.Panov
0bace9e4a0 Revert "cleanup: get rid of mutable stuff (part of KTIJ-26893 K2: Create*FromUsageFix fix)"
This reverts commit c9d8c5845babc20e58a38f0dc2d83363ff7378d3.

GitOrigin-RevId: 1fd74bfc8c347e5ed633f662f2e19978d25c7d64
2024-02-05 23:42:35 +01:00
Alexey Kudravtsev
7a79a8bf2a cleanup: get rid of mutable stuff (part of KTIJ-26893 K2: Create*FromUsageFix fix)
GitOrigin-RevId: c9d8c5845babc20e58a38f0dc2d83363ff7378d3
2024-02-05 19:01:06 +00:00
Alexey Kudravtsev
c77511e324 fix typos and incorrect links in javadoc
GitOrigin-RevId: b0a6236002781f491a71059c7d96ee625717bfa0
2024-02-05 19:01:01 +00:00
Mikhail Pyltsin
e467d25f90 [java-completion] IJ-CR-124074 IDEA-342465 support correctness for completion
- rollback changes for `createDeleteDefaultFix`

GitOrigin-RevId: 2bd379fe147da2ef83dca1efdc6af381e0b57c56
2024-02-02 16:39:17 +00:00
Tagir Valeev
5cc6eb573f Revert "[java-intentions] A simple generic rename mod-command based intention; used in createRenameFix to avoid creating a descriptor."
This reverts commit ac583b578e486be3a679fc22f373a53b5fdfe596.

GitOrigin-RevId: 822ad73092935356065fd6b5499cd15b060bb85c
2024-02-01 10:31:53 +00:00
Aleksey Dobrynin
0d8b737e97 [java, kotlin, quickfix] Add dependency in a single step while using Jigsaw modules. IDEA-341660
GitOrigin-RevId: 7c0ad3a4079ca76c1f1afb4147498e0ae08cc449
2024-01-30 14:29:06 +00:00
Mikhail Pyltsin
df015bbcf7 IJ-CR-124074 [java-completion] IDEA-342465 support correctness for completion
- DeleteDefaultFix to PsiUpdateModCommandAction
- delete measureTime for JavaCorrectnessChecker

GitOrigin-RevId: 3ba81bc4b5971257988efe37d85ac586396908cf
2024-01-29 20:59:21 +00:00
Tagir Valeev
165421c59d [java-intentions] A simple generic rename mod-command based intention; used in createRenameFix to avoid creating a descriptor.
GitOrigin-RevId: ac583b578e486be3a679fc22f373a53b5fdfe596
2024-01-29 16:51:36 +00:00
Mikhail Pyltsin
897bfa4e1c [java-completion] IJ-CR-124074 IDEA-342465 support correctness for completion
- Allow running highlighting on the copy of the file. Add comments

GitOrigin-RevId: c568202e7b1462834ab70fbdb1c3bd0bac448c92
2024-01-22 13:42:28 +00:00
Mikhail Pyltsin
82ae6a7e59 [java-completion] IDEA-342465 support correctness for completion
GitOrigin-RevId: e7d3dd5c9afec757fe2fcfb40499f7f174778264
2024-01-12 17:41:48 +00:00
Bas Leijdekkers
176a8e0bec Java: statements before super() part I (IDEA-340403)
GitOrigin-RevId: 7307a469267746ed3432acd1e73c894ccc87a254
2023-12-28 17:39:19 +00:00
Tagir Valeev
f7074186ea [java-inspections] PreviewFeatureInspection: add features from Java 20-22
Fixes IDEA-340983 Preview API (structured concurrency) usage in Java 21 is not highlighted

GitOrigin-RevId: cd02d5e1fe328104a47ac1fd684b2e2324b6558d
2023-12-14 15:51:27 +00:00
Tagir Valeev
6e1d684df0 [java-inspections] UseHashCodeMethodInspection: support double type
Also: fix comment processing
Improvement of IDEA-338114

GitOrigin-RevId: 87d057ccbea4262c40e2717c2ea3c004ac9865b0
2023-12-11 21:37:14 +00:00
Mikhail Pyltsin
3f86cf9292 [java-highlighting] IDEA-339935 JEP 463
- rename unnamed classes to implicitly declared classes

GitOrigin-RevId: 2c6d7f16a1dc6d2371b8f8b5f5675246c9bc99f9
2023-12-11 15:49:28 +00:00
Tagir Valeev
2a4fc312fb [java] IDEA-327241 Enable compilation and running Java projects with configured unsupported preview versions
GitOrigin-RevId: df85f51ac1d4249ec3baf34f5ce7d150e06d2a13
2023-12-09 13:20:33 +00:00
Tagir Valeev
3d075de8e5 [java] LanguageLevelUtil: fold ourPresentableShortMessage filling into the loop
GitOrigin-RevId: 7bd9e5390e7740163d18ea4f129148843686652f
2023-12-09 12:53:09 +00:00
Bas Leijdekkers
0b59d209aa Introduce language levels for Java 22
GitOrigin-RevId: cbc48e46a05c15e13d3c5e23cf32ae5f958ef615
2023-12-07 00:58:17 +00:00
Bas Leijdekkers
a50138d2c8 Java: improve javac quirks inspection texts (IJPF-CR-15669)
GitOrigin-RevId: fa038ac62b8f9e0a4fd56a483578741a353e0886
2023-11-29 20:30:35 +00:00
Andrey Cherkasov
f6af5745f7 [llm] Declare the text attribute for internal actions in plugin.xml
instead of using property files, as we do not intend to localize all internal actions.

IJ-CR-120022

GitOrigin-RevId: bdf91572dd59128131e54537f382851acf29a762
2023-11-20 11:11:06 +00:00
Yuriy Artamonov
55084d2618 [java] Make usages of OuterModelsModificationTrackerManager less verbose
GitOrigin-RevId: eb38feae25335f7a3a2d676e34409fa3d63f70de
2023-11-19 13:07:05 +00:00
Tagir Valeev
2770254f2f [java-inspections] IDEA-338114 Suggest to replace (int)(v ^ (v >>> 32)) with a Long.hashCode(v)
GitOrigin-RevId: 2d9591f9d9a558c4a61ac226556ef9f551d6e0c2
2023-11-15 21:43:17 +00:00