Commit Graph

19877 Commits

Author SHA1 Message Date
Dmitry Batkovich
d8ff36703b do not test default charset IDEA-327365 (check JEP 400: UTF-8 by Default)
GitOrigin-RevId: a4926b6bbfc3028cd84c818a9d05784cdf28425f
2023-08-23 07:50:03 +00:00
Alexey Kudravtsev
283552d658 Fix "EntireFileHighlighted" calculation, create test for IDEA-330232 Daemon finished events aren't reported while file editing
GitOrigin-RevId: 883ace73fc1f1ef59d4508f46ef083d026d75881
2023-08-22 11:28:28 +00:00
Andrei.Kuznetsov
ddb58bd9e5 IJPL-158: Migrate (trivial) "community" tests to runInDumbMode/computeInDumbMode/runInDumbModeSynchronously
This commit removes usages of deprecated `DumbServiceImpl.setDumbMode` and replaces them with modern API.

GitOrigin-RevId: d3fa0e8eec04d7b10a0b98ff46c2f4bb5a8197b9
2023-08-21 21:51:19 +00:00
Andrei.Kuznetsov
a0cf94f7e6 IJPL-158: Deprecate DumbService.setDumbMode and suggest alternative API (runInDumbMode)
New API is currently `@TestOnly`. The plan is that `DumbService.runInDumbMode` will become a recommended production API.
`{run/compute}InDumbModeSynchronously` will remain as `@TestOnly`, and (likely) will be moved to DumbModeTestUtils later.

GitOrigin-RevId: c9f35ed8162b5ea53caa0abb859193d2918376fe
2023-08-21 21:51:03 +00:00
Andrei.Kuznetsov
dd39f1be13 IJPL-158: Rename DumbServiceImpl#{runInDumbMode>runInDumbModeSynchronously} (better name)
GitOrigin-RevId: 4576b95552595a04accb447097fd56f577ada7f3
2023-08-21 21:51:02 +00:00
Tagir Valeev
79b66e1879 [java-inspection] IDEA-324051 Inspections to migrate to sequenced collections (Java 21)
GitOrigin-RevId: bd008786ab983b8e8f3966d182da3be1ca9dcb55
2023-08-18 19:11:48 +00:00
Tagir Valeev
0f07763950 [java-dfa] IDEA-329980 "Constant values" false positive for Thread.currentThread
GitOrigin-RevId: ae59b89b689fbb2a756869fe5f4c916b1934ab06
2023-08-18 19:00:12 +00:00
Nikolay Chashnikov
93ebf714a7 [intellij project configuration] rename intellij.idea.community.resources module to intellij.idea.community.customization
We need to add sources to this module (for IJPL-204), so its name won't be correct.

GitOrigin-RevId: ab377fb890531656679a95f5f4afc6de26776acb
2023-08-18 17:45:09 +00:00
Bas Leijdekkers
428f94e656 Java: fix replacing unicode escaped tab char replacement and quick-fix text (IDEA-329685)
GitOrigin-RevId: c8a1201c2c4355175c53a0844a1e7b998134b7b9
2023-08-18 15:30:04 +00:00
Bas Leijdekkers
a19b0e5b51 Java: allow dollar signs in class name when Navigating to Symbol (IDEA-326383)
GitOrigin-RevId: 566a20418c4d15902ba9233fae32f7823ea9d89a
2023-08-18 15:30:01 +00:00
Bas Leijdekkers
6ea57e3225 Java: fix string template lexing problem (IDEA-321503)
GitOrigin-RevId: 35a5febd644d16b741e161ce4d985cea09910172
2023-08-18 15:29:55 +00:00
Tagir Valeev
c6a9526921 [java-intentions] IDEA-330175 'Move switch branch' doesn't work if should be moved within the same switch label
GitOrigin-RevId: 6b2f8926573791d7ed0ae44f3269803ca3ca18ea
2023-08-18 13:19:19 +00:00
Tagir Valeev
3dd5f3d6f0 [java-highlighting] Fixes for unnamed patterns in switch (IDEA-326939)
1. More uniform messages
2. Better anchor when var is defined in multiple patterns
3. Separate error messages for Java 20 and Java 21

GitOrigin-RevId: d7c6ab5b4445b7929bdcf200ac0838fc5431e803
2023-08-18 11:33:05 +00:00
Tagir Valeev
dbccf5f59b [java-inspections] Delete switch branch when guard is false
Part of IDEA-326939 Support multi-pattern switch labels that define no variables

GitOrigin-RevId: 6d089c7e9f705a28f29376f1208ed39d4c8aa881
2023-08-18 08:18:08 +00:00
Tagir Valeev
efbff7c99c [java-highlighting] Move guard expression to switch label
Part of IDEA-326939 Support multi-pattern switch labels that define no variables

GitOrigin-RevId: c236438af58e1c74a2bf12a5985b33cedadb9cbb
2023-08-18 08:18:06 +00:00
Elena Shaverdova
aaeb54e5b2 Switch IndexDiagnosticTest.kt to new diagnostic
GitOrigin-RevId: 731418670924333541fa2a5c849a8150948f95c2
2023-08-18 01:20:33 +00:00
Tagir Valeev
5618627fa4 [java-highlighting] IDEA-326939 Support multi-pattern switch labels that define no variables
GitOrigin-RevId: fb0360f00314417c17566637db6bbda4c21e6faa
2023-08-16 08:59:25 +00:00
Alexey Kudravtsev
bd44401a7f convert loadFirstAndClose to more structural VfsCore.loadNBytes
GitOrigin-RevId: 200673f5516632ea59affe06ef4fa9ffef1caccd
2023-08-14 12:56:06 +00:00
Mikhail Pyltsin
c83b6fd069 [java-highlighting] IDEA-304893 allow array init before super
GitOrigin-RevId: 9a20ede1944cfc2d9511753ba9490c5beb94b21e
2023-08-11 21:40:38 +00:00
Mikhail Pyltsin
4fb2e28c3e [java-intentions] IDEA-314730 Not propose to convert to factory for records
- there is no point as its constructor is always public

GitOrigin-RevId: fc071e9902ec9aff12874eb99a7aa5ca53b1b1be
2023-08-11 21:40:36 +00:00
EgorKulikov
a68f022ea8 Merge branch 'master' of ssh://git.jetbrains.team/ij/intellij
GitOrigin-RevId: 17760d33b233893cb38ef1242a980f79e75bdd34
2023-08-11 18:22:31 +00:00
Mikhail Pyltsin
df7f634b4c [java-inspections] IDEA-326230 EnhancedSwitchBackwardMigrationInspection supports comments more accurately
- move tests

GitOrigin-RevId: da493b12e29b8bf5849c10a2410ca2e71a7a4a69
2023-08-11 17:50:27 +00:00
Mikhail Pyltsin
a16d27ed41 [java-inspections] IDEA-326230 EnhancedSwitchBackwardMigrationInspection supports comments more accurately
- added support comments right before rules
- preserve comments in code blocks

GitOrigin-RevId: 5f5123f5d51a0b72cb4ff29c50fbc667fd00e450
2023-08-11 17:50:09 +00:00
Mikhail Pyltsin
fc59d971af [java-inspections] IDEA-327488 skip switch expressions with throw statements if it returns constant value
GitOrigin-RevId: c876dd08fe42b936673bc40802bbca320672266e
2023-08-11 17:50:04 +00:00
EgorKulikov
00613b9767 [kotlin] merge kt-master to master
GitOrigin-RevId: ee9a781cd33d36d8479b20d1e7181e916f7f9cfa
2023-08-11 17:14:41 +00:00
Izmar Verhage
06190372c4 Deprecate AbstractStubIndex::get and migrate usages
In this commit we implement a logical implication of the fact
that StubIndex::get is deprecated, combined with the fact that
AbstractStubIndex::get is not deprecated but calls
StubIndex::get with the exact same arguments it received. The
absence of deprecation of AbstractStubIndex::get obfuscates
the fact that we want to phase out StubIndex::get calls.

Apart from deprecating said method, we add some convenience
methods in AbstractStubIndex inheritors that ensure a few things:
- The not-deprecated and preferred StubIndex::getElements is
  called with appropriate arguments, including a properly
  specialised requiredClass argument.
- Shorter syntax and DRY: only 3 arguments are required to pass
  into the convenience method, whereas getElements requires 2
  more. These 2 arguments are fields of the AbstractStubIndex
  inheritor, so it makes little sense to get them from there
  and pass them into StubIndex::getElements everywhere.

Wherever we can, these convenience methods are now used.

If you have access to JetBrains internal resources, also see:
https://jetbrains.team/p/ij/reviews/112930/timeline
https://jetbrains.slack.com/archives/CMDBCUBGE/p1691509451975689

GitOrigin-RevId: c51ef4de44aa85841799640b1ece9d291208dc69
2023-08-11 16:14:17 +00:00
Louis Vignier
d70b833129 [java-analysis] Don't report unnecessary semicolons between import statements
IJ-CR-110702

GitOrigin-RevId: 1b5ac3b03577fc02be9ab5f0af05455539d52416
2023-08-11 14:51:57 +00:00
Louis Vignier
e668728d78 [java-highlighting] Test extra semicolons highlighting in JDK 21
IJ-CR-110702

GitOrigin-RevId: c477953def6dd7c26f0b46755afabe98161e08dc
2023-08-11 14:51:54 +00:00
Louis Vignier
89cfc1c9fc [java-highlighting] Report only semicolons between import statements
IJ-CR-110702

GitOrigin-RevId: d30e7021a979e4fc1b0ad5ce5078c5a8d805858a
2023-08-11 14:51:50 +00:00
Louis Vignier
fef81252d6 [java-highlighting] Update redundant semicolon warnings
IJ-CR-110702

GitOrigin-RevId: 12ecc516040a1caa05609ffce0c6bbd9d13c116c
2023-08-11 14:51:47 +00:00
Mikhail Pyltsin
584d755d71 [java-intentions] IDEA-327634 CreateSealedClassMissingSwitchBranchesFix support generics
- try to calculate generics for generic sealed classes using a selector type

GitOrigin-RevId: 80fafc8f359a8841814f0e13f87f67d4e81039cb
2023-08-11 13:54:34 +00:00
Nikolay Chashnikov
deb876e39d [platform] fix "Copy Path from Content Root" action for files under source roots (IDEA-328055)
WorkspaceFileIndex.getContentFileSetRoot returns the path from the source root (since source roots are registered as files set of the 'content' type), so we should try ProjectFileIndex.getContentRootForFile first.

GitOrigin-RevId: d34907441f343c525286c3067e310b9acd9316c1
2023-08-11 13:18:59 +00:00
Mikhail Pyltsin
58873c2fd2 [java-completion] IJ-CR-112205 IDEA-324073 Complete static methods with the first argument as qualifier.
- rewritten caches to use static for java
- added tests
- not qualified if there is static important
- smart completion
- more accurate compare types
- take into account SPACE_AFTER_COMMA
- check cancel more often

GitOrigin-RevId: 17a3f093dfd7930f0b827f9cdbc1ef8c95cf86cb
2023-08-10 15:40:11 +00:00
Sergei Tachenov
7107f56bfd Fix select in project view tests
Now that select in operations are async,
we actually need to wait in tests until they're finished.

GitOrigin-RevId: da254ad9d5fa10d866b6bdc474abeeae3ba3204e
2023-08-09 22:51:04 +00:00
Nikos Kokolakis
15634fc284 [go] Extract util class for testing AutoPopup ParameterInfo (GO-9078)
GitOrigin-RevId: d0c181469694ae038fdfc62f7c7e63895dfef658
2023-08-09 20:06:14 +00:00
Anna Kozlova
e2d7214918 [kotlin] ensure that UastCallableReferenceExpression preserves receiver expression
- uast based visitor in unused declaration should analyse receivers which might contain references to variables/functions/etc

- Currently simple references in receivers are not processed and thus test has false positive

^ KTIJ-23958

- KotlinJavaApiUsageInspectionTest.`test reference in callable reference` doesn't test actual problem because UastVisitorAdapter is used: meaning that psi hierarchy is traversed and converted to uast one-by-one.

GitOrigin-RevId: 01b2c31fe42181c428b2c8767dc18db73bdfd659
2023-08-08 07:37:39 +00:00
Picowchew
fb9a20325f Fix typos in 'variable' and 'initial'
GitOrigin-RevId: a0ebc0930bea4dcfa9386adddee5e872e05c0a8e
2023-08-07 15:44:22 +00:00
Bas Leijdekkers
06764c5161 Java: update "Trailing whitespace in text block" for string templates (IDEA-326944)
GitOrigin-RevId: e45eb0c40c9a07715a37063b237314611cc2e012
2023-08-06 17:26:04 +00:00
Mikhail Pyltsin
2ba4582735 [java-highlighting] [java-inspections] IDEA-327632
Conversion to enhanced switch produces incorrect code.

- Added checks that branches don't have a fast exit

GitOrigin-RevId: 33c6cffa421a3b0c3c5b9f9f1ea29127c7a99d29
2023-08-05 21:41:20 +00:00
Bas Leijdekkers
edfa8f41a5 Java: update "Non-terminal use of '\\s' escape sequence" now that PsiTemplate is not an expression anymore (IDEA-326944)
GitOrigin-RevId: cea018045f87fad01824bf68ebf10ecdb798e39d
2023-08-04 19:58:18 +00:00
Bas Leijdekkers
599fb6bf19 Java: update "Unnecessarily escaped character" inspection for string literals (IDEA-326944)
GitOrigin-RevId: 49792b6510b8deaf20e49c509c948ba51f508de1
2023-08-04 19:58:12 +00:00
Ruslan Cheremin
f906b88acf [core] (cleanup) remove outdated VirtualFileGistImpl impl
+ VirtualFileGistImpl is an old impl, replaced with VirtualFileGistOverGistStorage long ago. Removed it from the codebase

GitOrigin-RevId: d766f66ae41fba870b6e33c3fc719eed7f6f6b9c
2023-08-04 19:30:28 +00:00
Roman Shevchenko
386eee00be [project] replacing custom Path extensions with stdlib/JRE calls
GitOrigin-RevId: 521524062de528211d495d08b32afcd2132d7ebd
2023-08-04 17:11:22 +00:00
Tagir Valeev
1cbc0a84b0 [java] Avoid resolve of unnamed variable with any processor (IDEA-321474)
GitOrigin-RevId: 0635129e3c2d7ced84209d22a769d209d7d9491b
2023-08-04 16:55:54 +00:00
Tagir Valeev
3204f9d239 [java-completion] NormalCompletionTest: use Java 21; also fix case label completion with colon char
GitOrigin-RevId: 84169987b62cb0a1d8bac137f0044ff89e51a7d9
2023-08-04 16:44:05 +00:00
Tagir Valeev
13cf92eb7f [java-inspections] ConstantExpressionInspection: minor fixes
1. Disable for literals
2. Checkbox description moved to the form

GitOrigin-RevId: 48303e0c704ef9db5e09f64f34d3ee32d2743194
2023-08-04 15:20:12 +00:00
Tagir Valeev
70dc1b43b7 [java-intentions] HexToDec3.java: update test to produce the same result on JDK 17 and JDK 21
Behavior of Float.toString() was slightly changed since JDK 19, see JDK-6664028

GitOrigin-RevId: b61938174483e34627fa369624e5993cb58cbd2f
2023-08-04 15:20:09 +00:00
Tagir Valeev
093e60cd34 [java-dfa] testDoubleCast(): update test to produce the same result on JDK 17 and JDK 21
Behavior of Double.toString() was slightly changed since JDK 19, see JDK-4511638

GitOrigin-RevId: ed0c37289d1f08402c35bd2697a86a4c7a2b8543
2023-08-04 15:20:06 +00:00
Tagir Valeev
6495c1370c [java-dfa] IDEA-327154 String templates support in data flow inspection
GitOrigin-RevId: da9176e33611213fa6ab49ef1aba03d8550c2c12
2023-08-04 15:20:03 +00:00
Tagir Valeev
eafaa0e48b [java-dfa] IDEA-327531 Improve string concatenation handling in data flow analysis
GitOrigin-RevId: 353a1632dbb588f7c4f95cde16deec03764bceb2
2023-08-04 15:19:59 +00:00