Mikhail Pyltsin
4b11fb634b
[java] IJ-CR-159341 IDEA-370304 "Go to Declaration and Usages" seems to leak memory in both IntelliJ 2024.2 and 2024.3 (a lot of memory used by java PSI)
...
- move `USE_WEAK_FILE_SCOPE` to `GlobalSearchScope`
- IJ-CR-159341
(cherry picked from commit 1e049676158a010d82ac528a15328ea717ba4681)
GitOrigin-RevId: 74c5c4e70f02a3c5b159aff1aa7048daf29bb2d6
2025-04-29 21:34:00 +00:00
Mikhail Pyltsin
a8dcad0919
[java] IDEA-370304 "Go to Declaration and Usages" seems to leak memory in both IntelliJ 2024.2 and 2024.3 (a lot of memory used by java PSI)
...
- use weak file scope
- IJ-CR-159341
(cherry picked from commit f4d24ffa9ef29af589916f2e6da217b0bcbe7007)
GitOrigin-RevId: 74cd2f5b45140d86492336266c1bd360fa03401d
2025-04-29 21:34:00 +00:00
Tagir Valeev
a7701ac82b
[java-psi] Simplify PsiPackageImpl.isValid
...
It's probably ok to consider a package as valid, even if it doesn't contain any directories, and the prefix does not exist. Usually, invalid PsiElement is something deleted, or replaced, which cannot be used anymore. This is likely not the case here.
May help IDEA-368981 Renaming package never finishes, stuck "Looking for Usages"
(cherry picked from commit 27a08684daed8fd9232dbab3815e19deddd79b0d)
IJ-CR-160042
GitOrigin-RevId: 4a6291490f1687eaf459e3197bf0902760d0174b
2025-04-12 11:13:00 +00:00
Tagir Valeev
ff056b8c7a
[java-refactoring] IDEA-368385 Refactor introduce field added NotNull annotation
...
(cherry picked from commit c695550e832b648d31097d85ee887358551e95ac)
IJ-CR-156646
GitOrigin-RevId: 6288ec8f7abe19c87a57f03121883c0f5049b2ad
2025-03-12 12:15:46 +00:00
Bart van Helvert
2342dbb3ff
[java] Consider candidates from all class finders in class finder
...
This will make sure the best class is always found. For example, when there are multiple dependencies that contain the same class, the class from the first dependency should be picked, even if it only is found by a PsiElementFinder that appears later in the chain. #IDEA-342753 Fixed
(cherry picked from commit fcd905b1cea47dd488664eff62e2ff1049c4e336)
IJ-MR-155802
GitOrigin-RevId: 7d99cc055ddb03678d162f471dfb0e4fb46cd0a3
2025-03-06 20:18:59 +00:00
Tagir Valeev
e6aa4536a9
[java-psi] Proper order of annotations inside PsiNewExpressionImpl
...
Fixes IDEA-366918 Wrong order of annotations in new array expressions
(cherry picked from commit 29bbfb29123cd273f4c3d34f74e8a00bc6ab5ec1)
IJ-CR-156763
GitOrigin-RevId: 2eac2a8cae68edddc4f538f164764cb1cdcc2f0d
2025-03-06 10:09:58 +00:00
Tagir Valeev
42ce63523e
[java-highlighting] checkModuleReference migrated to ModuleChecker and JavaModuleDefinitionInspection
...
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)
GitOrigin-RevId: b801fdbe22df163a4f0db153016ae50671ccc866
2025-02-19 20:42:37 +00:00
Tagir Valeev
b9999a124d
[java-highlighting] SwitchBlockHighlightingModel: move getValuesAndLabels to JavaPsiSwitchUtil
...
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)
GitOrigin-RevId: 45cfc36addf6faa44c7a12081e5f22cadf6daae2
2025-02-19 20:42:37 +00:00
Tagir Valeev
69ec209f9b
[java-highlighting] SwitchBlockHighlightingModel: isolate duplicates search code
...
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)
GitOrigin-RevId: c207684c048db5a739c684b74792ca8bf2a7e674
2025-02-19 17:57:38 +00:00
Tagir Valeev
f8b210a481
[java-highlighting] Minor fixes in switch statement highlighting
...
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)
GitOrigin-RevId: 2924ae6c9984caa6e8a45f640c4de54e02134ad3
2025-02-19 14:57:00 +00:00
Vladimir Krivosheev
c04871fce9
fix GroupNode visibility
...
GitOrigin-RevId: b433a9634288517c2433d1fdf11a502d65c6a1c1
2025-02-19 08:33:02 +00:00
Tagir Valeev
cb626d5749
[java-highlighting] checkSwitchSelectorType migrated
...
Error messages unified; do not list allowed switch types anymore
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)
GitOrigin-RevId: 69675af87ac8866fb5ba1475094b93af07aa1ad5
2025-02-18 09:36:18 +00:00
Tagir Valeev
16c58ccd5d
[java-highlighting] JavaPsiSwitchUtil.getSwitchSelectorKind extracted
...
Also: unified between pattern and non-pattern switches; always returns non-null now
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)
GitOrigin-RevId: aaf556f2c32dc36fe54047ac95683a15d7728bf7
2025-02-18 09:36:18 +00:00
Tagir Valeev
492c6bdaec
[java-core] JavaPsiSealedUtil moved to codeserver.core
...
GitOrigin-RevId: d4d5b683216563029bf817a964fbd020c33ac990
2025-02-18 09:36:18 +00:00
Tagir Valeev
47ea843d98
[java-core] JavaPsiReferenceUtil moved to codeserver.core
...
GitOrigin-RevId: acad9e3fddb54a91d678aead628c2124128e93f0
2025-02-18 09:36:18 +00:00
Tagir Valeev
f659d57b70
[java-core] JavaPsiEnumUtil moved to codeserver.core
...
GitOrigin-RevId: c4f14fb79181cebe0ff87f5830b64228c0937e70
2025-02-18 09:36:18 +00:00
Tagir Valeev
4abe8788e2
[java-core] JavaPsiSingleFileSourceUtil moved to codeserver.core
...
GitOrigin-RevId: 2368062535cd331747a871d22f405e4683ae8bd6
2025-02-18 09:36:18 +00:00
Tagir Valeev
eec026b0ea
[java-core] JavaPsiModifierUtil moved to codeserver.core
...
GitOrigin-RevId: 72b18a9acec8597aad73610937894f2c2e6d1b36
2025-02-18 09:36:18 +00:00
Tagir Valeev
d0e7c1e66e
[java-core] JavaPsiVariableUtil moved to codeserver.core
...
GitOrigin-RevId: d439121bd3795e5ffe13a43152c2a78973e24fcc
2025-02-18 09:36:18 +00:00
Tagir Valeev
e6691d9ea8
[java-highlighting] SwitchBlockHighlightingModel.checkSwitchBlockStatements migrated
...
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)
GitOrigin-RevId: 463b1549d45bf98586e6ae9dafb4bc4b330bbe52
2025-02-18 09:36:18 +00:00
Tagir Valeev
a0f777069b
[java-highlighting] move module-related warnings to JavaModuleDefinitionInspection
...
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)
GitOrigin-RevId: 66179a41da5e02b759f07f9d6638b87711181348
2025-02-17 12:04:21 +00:00
Aleksey Dobrynin
d657eec931
[java, jigsaw] fix: false positive "unused import" in module-info.java (IDEA-361284)
...
GitOrigin-RevId: 706bc26eb70221a059264973d8f2dc476266d705
2025-02-17 10:42:22 +00:00
Vladimir Krivosheev
a682257a55
fix LightClassReferenceBase visibility
...
GitOrigin-RevId: df2ecbeb1faed9f2c06c7ecd6c3a726cefdd27de
2025-02-16 10:08:11 +00:00
Vladimir Krivosheev
31126e7b20
fix PsiLoopStatementImpl visibility
...
GitOrigin-RevId: 3657b84b3c586292389d52ba933d243e5e00eebe
2025-02-16 10:08:11 +00:00
Vladimir Krivosheev
f97821a456
fix ThisPassedAsArgumentVisitor visibility
...
GitOrigin-RevId: 5e1484bb0362aa97cf1265f3eb4d2e9c6f9e3d0a
2025-02-15 13:27:50 +00:00
Vladimir Krivosheev
3deaff7cf6
fix CMakeVariableNameMixin visibility
...
GitOrigin-RevId: 94e8f2ee80ddf0098fbcc960bdf6b7aebde4cdc9
2025-02-15 13:27:50 +00:00
Max Medvedev
e2fba18524
IJPL-339 IDEA-367535 fix performance degradation
...
Inferring all classes from scratch is rather slow.
Returning the original behaviour for non-multiverse case.
Investigation of the proper cache is to be done.
GitOrigin-RevId: e6134ade61f36f458fc3214d1ae54180727bc2b2
2025-02-14 23:02:01 +00:00
Leonid Shalupov
244718d26b
housekeeping: remove java unused imports
...
IJ-MR-154242
GitOrigin-RevId: 8fec0cba7ae2368e51b21a8b9bfb2f445fdc0f68
2025-02-14 18:08:16 +00:00
Nikolay Chashnikov
2e152d37bf
[java] API cleanup: mark deprecated unused API for removal (IJPL-163936)
...
GitOrigin-RevId: dc2eb0f6251c889df4ae78d08c9633f4935cc844
2025-02-14 14:23:04 +00:00
Tagir Valeev
2350d69472
[java-highlighting] JavaCompilationErrorBundle.properties proofreading (DOC-34381)
...
GitOrigin-RevId: 05bdca159a63027ea0d1e3d767d4adb9b258f47e
2025-02-14 12:45:24 +00:00
Tagir Valeev
4408629488
[java-highlighting] JavaErrorBundle.properties: unused properties removed
...
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)
GitOrigin-RevId: 45cca1bddd32665c8db684aa6457d5b7dc594829
2025-02-14 12:45:24 +00:00
Aleksey Dobrynin
d31f2fb4f0
[java, jigsaw, index] fix module-info stub file version (IDEA-367346)
...
GitOrigin-RevId: 9b136ea30f2ef59052f3736356193c18a7e6affa
2025-02-14 10:31:59 +00:00
Max Medvedev
6f5402325c
IJPL-339 resolve for Java
...
GitOrigin-RevId: 7194b296f17b5318d0aae88b85c99631018ce90f
2025-02-13 19:25:07 +00:00
Tagir Valeev
65dbbd5a3a
[java-highlighting] refactor MultiReleaseUtil.kt; merge with JavaMultiReleaseUtil
...
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)
GitOrigin-RevId: 05487a43bb4277cef0d96ecf9f6fce789d292091
2025-02-13 16:25:21 +00:00
Tagir Valeev
61f7252105
[java-highlighting] same erasure problems migrated
...
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)
GitOrigin-RevId: 052d3bf8a26c376c7dfc5b1e370e583cf6236138
2025-02-12 20:34:11 +00:00
Tagir Valeev
4bff779350
[java-highlighting] ControlFlowUtil.isInitializedBeforeUsage: fix field handling
...
Fixes IDEA-367309 False-positive ‘might not have been initialized’ warning for final field in anonymous class initialized via static field
GitOrigin-RevId: aa2d951945ba497188cfdac343f1b9eb40720ee3
2025-02-11 15:54:30 +00:00
Tagir Valeev
5865ac9553
[java-psi] IDEA-367231 Incorrect use scope for public class inside non-public non-final containing class
...
GitOrigin-RevId: 9238a1c2cb5749f4a711815150c14324d8d7f64e
2025-02-11 15:54:30 +00:00
Tagir Valeev
3cc5f493dd
[java-highlighting] JavaErrorBundle.properties: unused properties removed
...
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)
GitOrigin-RevId: 426a4ad67359142cfc19259cc81e734b1b0e4031
2025-02-11 15:54:30 +00:00
Aleksey Dobrynin
76689f83c0
[java, jigsaw, index] fix module-info stub file version (IDEA-367346)
...
GitOrigin-RevId: 708f6ff199d8ac9f431589b481f6beed4c3e5191
2025-02-11 13:06:41 +00:00
Aleksey Dobrynin
c81ddecac8
[java, jigsaw] support JEP 11 class file attributes (IDEA-366117)
...
GitOrigin-RevId: 0e2bfa39e5a86fb5663e407d7c33bea177234ecc
2025-02-10 18:41:05 +00:00
Aleksey Dobrynin
15b3400588
[java, jigsaw] Refactor module stub building with a builder pattern
...
GitOrigin-RevId: aef7aa340bdb84a26ac9b4a13204f177d200012f
2025-02-10 18:41:05 +00:00
Tagir Valeev
af461cb996
[java-psi] AbstractLightClass: getPermitsList()
...
GitOrigin-RevId: 3bb57330befbb0dedf0236d9ae86b27d253a6aab
2025-02-10 14:02:54 +00:00
Tagir Valeev
0e57ef0ef0
[java-core] Extract JavaPsiModuleUtil with minimized dependencies; new module intellij.java.codeserver.core
...
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)
GitOrigin-RevId: 328779172e877b737a68624fa09ea88cf5fd1954
2025-02-07 16:16:32 +00:00
Tagir Valeev
9314a671b8
[java-highlighting] checkSwitchExpressionHasResult migrated
...
Also use ControlFlow instead of ig ControlFlowUtils to check normal completion. Otherwise, it thinks that System.exit() doesn't complete normally
Also fix (hopefully) yield in finally in ControlFlowUtil.canCompleteNormally
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)
GitOrigin-RevId: efa0cd4b8f478b98e904186005b7802e958507ae
2025-02-07 12:04:27 +00:00
Tagir Valeev
24109ba397
[java-highlighting] remove unused code
...
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)
GitOrigin-RevId: 75fe65ba5b62f9ba11c3f47a644f9533d86dd82a
2025-02-06 10:35:32 +00:00
Tagir Valeev
631e06c624
[java-highlighting] Variable already defined error migrated
...
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)
GitOrigin-RevId: 6a53142a596abe2615151b36e06c3686013ac4b3
2025-02-06 10:35:32 +00:00
Tagir Valeev
1cd294e40d
[java-highlighting] The rest of control-flow-related stuff (checkFinalVariableMightAlreadyHaveBeenAssignedTo) migrated
...
More utility methods inside ControlFlowUtil
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)
GitOrigin-RevId: d4c294ce18da2032a0686f66794a7f377549edd2
2025-02-06 10:35:32 +00:00
Tagir Valeev
cc643a5ae4
[java-highlighting] More control-flow-related stuff migrated
...
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)
GitOrigin-RevId: 3c292fdf4869e6d13c16fabbf42e2055ea54f724
2025-02-06 10:35:32 +00:00
Mikhail Pyltsin
0407452d3b
Revert "[java-import] IDEA-366850 Exception on adding auto-import of static member in completion"
...
This reverts commit 54a21262a9e2431acd61f772b73e76f7ead58b55.
GitOrigin-RevId: 47569e26683b6d8ffb996906fdec10ba63f09f4e
2025-02-05 15:17:18 +00:00
Tagir Valeev
913cade2a5
[java-highlighting] checkVariableMustBeFinal migrated
...
Also: intermediate refactoring inside HighlightControlFlowUtil related to init-before-use
Also: ErrorFixExtensionPoint now works for any kind (intermediate solution)
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)
GitOrigin-RevId: 7a712a841a52a99bac4faafaf1164921c1150a56
2025-02-05 12:41:14 +00:00