Commit Graph

5426 Commits

Author SHA1 Message Date
Mikhail Pyltsin
1ff383762f [java-completion] IDEA-344486 support correctness for completion
- allow extending class with no-default constructors

GitOrigin-RevId: 12e7ded76a87128b681ceb455ad9fb8c39b9c793
2024-01-30 15:49:08 +00:00
Bas Leijdekkers
6ef65a4cf9 Java: make constant private
GitOrigin-RevId: 7a1ee9c0c787a7cff39325aa668f2beae5cb551c
2024-01-27 11:44:47 +00:00
Mikhail Pyltsin
9286615c25 [java-completion] IDEA-344077 support correctness for completion
- allow not initialized variable

GitOrigin-RevId: 7c73aa1660f26ed1ca04ceb9f646074f4f24667d
2024-01-27 00:12:09 +00:00
Tagir Valeev
e6a69b2ceb [java] StringLiteralEscaper: do not mark text blocks and fragments as one-line
GitOrigin-RevId: e8d8645e351b843eaab06050a2ec872d0f89e306
2024-01-25 19:15:40 +00:00
Tagir Valeev
2fca99a68d [java] Improve injection support in string templates
1. Fix PsiFragmentImpl#updateText
2. Disallow mod-command actions that try to modify the guarded blocks
3. Make it more robust against host invalidation, which actually happens
4. Fix rename support in executor
5. Make it safe to call getWritable() on an already writable element from injected code

Part of IDEA-333006 Language injection in String templates

GitOrigin-RevId: 426ba89f28db8d8d4ac35f969847d5ff4cd56f14
2024-01-25 19:15:37 +00:00
Tagir Valeev
108f842a27 [java] Minimal support for injections in string templates
IDEA-333006 Language injection in String templates

GitOrigin-RevId: 6ea1bd6460658db2cb767819710c3595f4cdaffb
2024-01-25 19:15:27 +00:00
Andrey Cherkasov
1a62d88764 Cleanup: use light services
^IDEA-254577

GitOrigin-RevId: 01afb3f2166f8713cd4599f37d43ecf7f4d2944c
2024-01-23 06:03:51 +00:00
Dmitry Batkovich
0e123a278a make java method/field deferred icons not flickering IDEA-343602
GitOrigin-RevId: 56bbc9a8235bab6032ce6da531b517780f34c0c5
2024-01-22 18:47:13 +00:00
Sergei Tachenov
b68d3df6f8 IDEA-339254 Don't use the base symbol icon instead of the actual one
An old bug introduced in 2011 when refactoring JSP stuff: getClassIcon
may accept a non-null argument to force a specific icon (used only by JSP).
However, the same argument is also assigned a non-null value of the base
symbol icon which obviously shouldn't replace the actual one when the actual
one is evaluated. But it exactly what happened, because the value was assigned
to the same argument that is used to force an icon.

Fix by using a proper local variable instead of assigning to the argument.
Now the icon will only be forced if it's explicitly passed in by the caller,
and in other cases it'll be properly evaluated when the time comes,
replacing the base one as it should.

GitOrigin-RevId: b37a6d464a34262b29474e489c54e63906dc3d7a
2024-01-22 17:47:16 +00:00
Tagir Valeev
f9eccb5295 [java-stubs] Do not ignore groovy trait helper classes, as they could be referenced from non-Groovy language
Should fix IDEA-343318 Indexing ignores nested classes from Groovy traits

GitOrigin-RevId: 4009f7fcb54a6e571986c0395a92e41685cf5d8e
2024-01-22 10:54:30 +00:00
Dmitry Batkovich
bb75293a2a provide base icons for PsiClassImpl and ClsClassImpl IDEA-343602
GitOrigin-RevId: 03d25f509706bc290744663d489bf8a714f4f7e4
2024-01-22 07:58:34 +00:00
Alexandr Suhinin
79653f2633 CR-101244 clean up: remove redundant overriding methods
GitOrigin-RevId: d4d165c6280b7bead925940c82b20f5300c7750a
2024-01-20 15:47:17 +00:00
Tagir Valeev
3c4517f5cc Apply 'Standard hashCode() method can be used' inspection
GitOrigin-RevId: e4e96a944a005c83f0869c0465398f2e97309cf5
2024-01-19 11:20:36 +00:00
Mikhail Pyltsin
3f15cce0a5 [java-completion] IDEA-342465 support correctness for completion
- fix `implement` classes

GitOrigin-RevId: c20834fbc489aa4e1b0da2393e940e20c5a4439a
2024-01-18 20:12:41 +00:00
Mikhail Pyltsin
4085dad9bb [java-inspections] IDEA-343139 StaticAccessViaInstanceForImplicitClasses produces errors for implicitly declared classes
- allow such access

GitOrigin-RevId: 2deafb0f6fb0be420a33174ccc2265103a0ce183
2024-01-16 14:03:15 +00:00
Tagir Valeev
b29043047a [java-completion] Fix processing shadowed variables (IDEA-340271)
GitOrigin-RevId: 2e19d85a046923d078b78488f974acf6d443e1f4
2024-01-15 16:29:10 +00:00
Mikhail Pyltsin
e58c231650 [java-completion] IJ-CR-123816 IDEA-342465 support correctness for completion
- simplified logic
- add logs to measure times

GitOrigin-RevId: a378fe0a019105c2dc130a1ca25bef5e4f9001d4
2024-01-14 21:28:33 +00:00
Tagir Valeev
fc3e5df389 [java-completion] IDEA-339251 IDEA: make Postfix templates dumb aware
GitOrigin-RevId: 082102197a4a06457685b5d6cd94e7296e51d8db
2024-01-12 18:46:51 +00:00
Mikhail Pyltsin
82ae6a7e59 [java-completion] IDEA-342465 support correctness for completion
GitOrigin-RevId: e7d3dd5c9afec757fe2fcfb40499f7f174778264
2024-01-12 17:41:48 +00:00
Nikolay Chashnikov
2c187bc8b7 [java] API cleanup: remove unused deprecated API (IJPL-275)
GitOrigin-RevId: 460fb9a3eec415c9ebaf27e28493c9dc197cf8e3
2024-01-11 11:19:57 +00:00
Bas Leijdekkers
3e0ed000da Java: sensibly parse non-sealed modifier on local class and provide better error message (IDEA-342500)
GitOrigin-RevId: 574a5d9c31e5823127227622adaefaaea224b247
2024-01-10 16:08:52 +00:00
Tagir Valeev
b7e6bfcfa4 [java-completion] IDEA-340271 Cannot complete outer scope variable when anonymous class extends a class with same-named private field
GitOrigin-RevId: 6f70d8c9b5811240929a2d0a9b17c9ceb4a98ea2
2024-01-10 10:04:12 +00:00
Yuriy Artamonov
ca1151aa9f [platform] IJPL-457 Cheaper cached values for PSI without SoftReference
Update usages of Soft cached values

GitOrigin-RevId: ab730845b9ea8327741203c81af9f2d6f56d1373
2024-01-09 17:42:30 +00:00
Tagir Valeev
035a6e3d8f [java] JavaMultiReleaseUtil#getVersion: null-check
Fixes IDEA-341844 Argument for @NotNull parameter 'file' of com/intellij/psi/util/JavaMultiReleaseUtil.getVersion must not be null

GitOrigin-RevId: 92c5b70c0f4f102bbf891acb8a25231b2a2828f9
2024-01-09 13:09:56 +00:00
Mikhail Pyltsin
858b2cd664 [java-inspections] IJ-CR-123164 IDEA-341641 Intention to convert implicit class to explicit and vice versa
- more tests
- small optimization
- preserve first comment in created implicitly declared classes
- fixed java docs
- move highlighting to the whole declaration

GitOrigin-RevId: e7ea706151f09852473e31d3831bb3008da62475
2024-01-09 11:04:51 +00:00
Bas Leijdekkers
ab928055bb Java: better error reporting and quick fixes for the diamond operator and generic array creation (IDEA-299195)
GitOrigin-RevId: baa354ad9132bf6d939f19ecd2cfd6cfc56466a2
2024-01-08 17:34:42 +00:00
Bas Leijdekkers
551728bdca Java: report local class accessed from another switch branch (IDEA-113520)
GitOrigin-RevId: 7a467fc0cda90dc1944185e83607d8a7d2579cf4
2024-01-07 11:21:02 +00:00
Bas Leijdekkers
e7ee84d0ca Java: correctly check if class is inner class according to the JLS (IDEA-336426)
and clarify error message

GitOrigin-RevId: 4614ced685521a06fee1bb681001e1484f9dca7d
2024-01-05 11:51:41 +00:00
Mikhail Pyltsin
e7ff016f3e [java-inspections] IDEA-341640 Mark main(String[] args) parameter as unused with implicit classes
- return back support `premain`

GitOrigin-RevId: 71ed562fa9e0f514852cb3aff0e993452371aa44
2024-01-05 09:34:47 +00:00
Bas Leijdekkers
6feb5f4628 Java: don't suggest 'final' modifier in error message for interfaces (IDEA-336055)
GitOrigin-RevId: 6023a90b7e15a4154ca030f7cfc175bb1a3d21c7
2024-01-04 11:32:25 +00:00
Mikhail Pyltsin
36bab0a817 [java-inspections] IDEA-341641 Intention to convert implicit class to explicit and vice versa
- new inspection to convert ordinary classes into implicitly declared classes

GitOrigin-RevId: 4a1756d52b672edafcb43a5f9f725a64bb19fa6d
2024-01-04 10:44:59 +00:00
Bas Leijdekkers
bee5c5dacd Java: Improve error message on accessing static field from enum initializer (IDEA-342001)
GitOrigin-RevId: 533518be63dded4577e70a4ecbd747203d136689
2024-01-01 18:09:31 +00:00
Bas Leijdekkers
2636eb83b0 Java: statements before super() part II - report return before explicit constructor call (IDEA-340403)
GitOrigin-RevId: 8d9ad8ec48b2eff6af3b582dfb935ece24041299
2023-12-28 17:39:22 +00:00
Bas Leijdekkers
176a8e0bec Java: statements before super() part I (IDEA-340403)
GitOrigin-RevId: 7307a469267746ed3432acd1e73c894ccc87a254
2023-12-28 17:39:19 +00:00
Bas Leijdekkers
6b0ded8130 Java: improve error message on return statement with value in constructor (IDEA-341462)
GitOrigin-RevId: bfccfa5f988469dc67df16e441f3d6f882853149
2023-12-28 17:39:12 +00:00
Tagir Valeev
983a35136e [java] MR-JAR: proper reference search from version-specific classes
GitOrigin-RevId: bba45a94e1d120695cfdc4f46943bfc23588de21
2023-12-20 18:10:20 +00:00
Tagir Valeev
ba99685bf5 [java] Minor cleanup in multi-release JAR support
GitOrigin-RevId: 0ebe25242ef514ba1025d8e7eb63ca6955c1defb
2023-12-20 12:47:21 +00:00
Tagir Valeev
c74bfa2e57 [java] IDEA-341317 Navigation into multi-release JARs
GitOrigin-RevId: 43612b6950fca72ab58af9b1eb5dc4940f90c501
2023-12-19 16:48:57 +00:00
Mikhail Pyltsin
4a7e2fc711 [java-refactoring] IJ-CR-122503 IDEA-340596 Unable to rename file with implicit class
- reuse library methods

GitOrigin-RevId: a2a2de5a34bbd623eae1c408b45a96b79907f7d4
2023-12-19 11:16:31 +00:00
Mikhail Pyltsin
4d18cc897e [java-highlighting] IDEA-340063 Don't offer import from implicitly declared classes
- fix incorrect return for a case: implicit class and non-implicit-class

GitOrigin-RevId: 690c9c8df180fcb814a4c4a342f46fcbbb921ebb
2023-12-18 20:57:15 +00:00
Mikhail Pyltsin
b6d5c4c5c4 [java-completion] IDEA-340791 Incorrect completion for nested in implicitly declared classes
- fix `bindToClass` for implicit classes

GitOrigin-RevId: 1a4223e897f2efb339e7a086c1d4bf7bfecf8918
2023-12-18 14:38:15 +00:00
Mikhail Pyltsin
8dad073ca5 [java-completion] IDEA-340596 Implementation isEquivalentTo for Implicit class
- it needs to work with non-physical copies
- fix tests

GitOrigin-RevId: e281c6e80f24e760f7f5ba46907e15a5d6da19eb
2023-12-15 18:58:37 +00:00
Anna Kozlova
6aebaca523 [java] deprecate and scheduler for removal PsiModifiableCodeBlock
interface is not used externally, and after removing PsiModificationTracker#getOutOfCodeBlockModificationCount() it makes no sense anymore.

^IDEA-340901 fixed

GitOrigin-RevId: e121babc02bf14f820dd8b3f974111e8240d692b
2023-12-14 21:16:04 +00:00
Mikhail Pyltsin
58e3af039d [java-highlighting] IDEA-340604 Improve an error message for unresolved references for implicit classes
GitOrigin-RevId: a4f319c4e48053ec57bce1e171f61d665154ed55
2023-12-14 19:49:24 +00:00
Bas Leijdekkers
88bd39ef0d Java: remove spurious error highlighting (IDEA-340885)
GitOrigin-RevId: 955d86aca0ceb262cee8f3ae5744856108eeb412
2023-12-14 16:13:39 +00:00
Andrey Cherkasov
019a6852f4 [java] Make extension classes final
GitOrigin-RevId: 1aae04982598568a111e8c78b9a71c9d2b4aa150
2023-12-13 20:02:09 +00:00
Tagir Valeev
46e00356c2 [java-highlighting] IDEA-340618 Update String templates type and exception for Java 22
GitOrigin-RevId: fc208b0f19ef048bce0baf462b227f6b16d34a2f
2023-12-13 15:22:17 +00:00
Aleksey Dobrynin
131bfc4609 [java] add default static imports
GitOrigin-RevId: 746402d1272aa0a410abbbfb18bd8571f545029c
2023-12-13 11:31:37 +00:00
Mikhail Pyltsin
45b4e8e23c [java-intentions] IDEA-340601 allow creating methods in ImplicitClass
GitOrigin-RevId: 1e0cd613359f27e889df5cf03ce535c1a1a99ca7
2023-12-12 20:14:00 +00:00
Mikhail Pyltsin
7ed93305c1 [java-refactoring] IDEA-340087 produce accurate PsiType for implicit classes
- fix Introduce variable throws exception in implicit classes

GitOrigin-RevId: c3489b1c6df3669f01b6e5defbf8a2208a7b441d
2023-12-11 21:06:07 +00:00