Commit Graph

585 Commits

Author SHA1 Message Date
Vladimir Krivosheev
cc667842f7 IJ-CR-146078 do not export intellij.platform.ide.impl
GitOrigin-RevId: 16a29b914bf81d4d5e3cdb43c64b088113a2fcd4
2024-12-30 10:16:07 +00:00
Vladimir Dolzhenko
f3a3129852 [kotlin] Show value of const default value in KDoc
#KTIJ-11114 Fixed

GitOrigin-RevId: af5e0ba55ad08b109f1d02df14b6227f6f109134
2024-12-28 16:53:02 +00:00
Vladimir Krivosheev
5649dd91d4 do not export kotlin.test-framework
GitOrigin-RevId: 1e1817357a7da35e9c5f43dca480e412b6be528c
2024-12-28 01:15:41 +00:00
Vladimir Krivosheev
2c56b99fd5 do not export intellij.platform.testFramework
GitOrigin-RevId: 4c2c86b3ba376268aba04487e363685656fea2e3
2024-12-26 22:08:08 +00:00
Vladimir Krivosheev
2b781b159a do not export deps blindly (part 5)
GitOrigin-RevId: 27b64867fac677b6b8a07ca82c6ab3cf7044db1e
2024-12-24 11:44:44 +00:00
Vladimir Dolzhenko
18551d3c17 [kotlin] Fix generating surround-with code block with non declaration last statement
#KTIJ-21951 Fixed

GitOrigin-RevId: ac2c0754e04935a41e2a7564fe61228ff7b60901
2024-12-23 19:49:26 +00:00
Alexey Kudravtsev
fc456982bf KTIJ-32568 K2 Mode: "Create function from usage" refactoring does not shorten standard types when names adjustment is cancelled
GitOrigin-RevId: fd390cf6e1b517a9f3728f57e25f3e58c4c62017
2024-12-23 16:58:03 +00:00
Alexey Kudravtsev
2a71164584 KTIJ-32570 K2 Mode: "Create class from usage" quickfix should not be proposed when unresolved reference starts from lowercase
GitOrigin-RevId: 37481ae59276cf86b55ab3ce54523d50df58210e
2024-12-23 15:58:15 +00:00
Vladimir Krivosheev
a522f96d66 do not export deps blindly (part 3)
GitOrigin-RevId: 7277ece9ded25f1111febc8dccaba9ac8cc75c21
2024-12-22 20:28:42 +00:00
Vladimir Dolzhenko
71c6a987ed [kotlin] Improve local declaration kdoc rendering
#KTIJ-31239

GitOrigin-RevId: 40c870a8e9e458fafbbf95f4543f7e7c79cacf31
2024-12-19 12:08:17 +00:00
Vladimir Dolzhenko
1636fcf413 [kotlin] Fix local modifier rendering in quick doc for local classes
#KTIJ-31239 Fixed

GitOrigin-RevId: c65997a00a6c04f4890b28877693a9460389197e
2024-12-18 22:59:19 +00:00
Anna Kozlova
ff9f61acfd [kotlin] k2: avoid search throw LC
it's better to search kotlin class inheritors directly

GitOrigin-RevId: 3bdf94f8874e20b2f9399c01f071418bfa00122e
2024-12-16 22:49:15 +00:00
Teodor Irkhin
45a0f0fa62 [kotlin] Enabled parameter names hints by default
Signed-off-by: Vladimir Dolzhenko <vladimir.dolzhenko@jetbrains.com>

#KTIJ-31009
#KTIJ-31962

GitOrigin-RevId: 1d3becce045898b0e3fcdac3f3cd07337960c4e5
2024-12-16 11:53:53 +00:00
Vladimir Krivosheev
98799639aa do not use _test as lib - test targets do not support this
GitOrigin-RevId: f2f49db4294b6a64040dbbd5f1d95e972cbd70a3
2024-12-15 18:32:30 +00:00
Vladimir Dolzhenko
29b6ff2ce4 [kotlin] Make surround-with available for any expressions
#KTIJ-32520 Fixed

GitOrigin-RevId: fe86497b9c53adc307013460e8658b52b816d212
2024-12-14 20:51:28 +00:00
Roman Golyshev
720edc8e20 KTIJ-32349 [kotlin] Rewrite computeImportableName to return CallableIds correctly
It's an almost exact copy of `KaSession.importableFqName`.

GitOrigin-RevId: c2361bd66f295e7a55a04a69c777777309d05375
2024-12-11 22:38:55 +00:00
Roman Golyshev
6f891caa59 KTIJ-32349 [kotlin] Clean-up SymbolInfo
GitOrigin-RevId: 27526729f3ffb142ff5765ac8c7256528f3357d3
2024-12-11 22:38:55 +00:00
Roman Golyshev
9ee01cc348 KTIJ-32349 [kotlin] Use original file analyze in OptimizedImportsBuilder to analyze original references
This is done to avoid
"The element cannot be analyzed in the context of the current session"
error (see KT-66783).

It happens in J2K because the file that comes into the import optimizer
is actually dangling.
And currently there is no way to analyze two dangling files
simultaneously (see KT-73836).

We used to do that to compare the resolve with old and new imports.

Now we use the original (potentially dangling file) to do the analysis
of the original reference, save the `SymbolInfo`s (which do not contain
`KaSymbol`s now), and compare them without relying on `KaSession` at all.

Add new test to the J2K suite, which triggered the exception before.

^KTIJ-32349 Fixed

GitOrigin-RevId: 665ba226638211612dd0c5ea1e48aa9dedc30bb4
2024-12-11 22:38:55 +00:00
Roman Golyshev
f18cac119f KTIJ-32349 [kotlin] Introduce resolveToSymbolInfo util to OptimizedImportsBuilder
GitOrigin-RevId: fcb2b1a5decd3c9af58d39dcb9d74b1458915462
2024-12-11 22:38:55 +00:00
Roman Golyshev
7e7f3e33b4 KTIJ-32349 [kotlin] Use SymbolInfo directly to compare resolve results in OptimizedImportsBuilder
Previously we relied on `ReferencedSymbol` - it should be enough
to just compare `SymbolInfo` instead

GitOrigin-RevId: 3685b7b829f524e182d4fe27cb2a86780d0fa7a1
2024-12-11 22:38:55 +00:00
Roman Golyshev
aa384c7e5e KTIJ-32349 [kotlin] SymbolInfo.computeImportableName -> SymbolInfo.importableName rename
It no longer needs `KaSession` to be called

GitOrigin-RevId: d9384916cf0448d5535895bdd09e31fecf1cb972
2024-12-11 22:38:55 +00:00
Roman Golyshev
21e95cb7a3 KTIJ-32349 [kotlin] Move containingClassSymbol to top level from SymbolInfo
GitOrigin-RevId: 538bd1ada4beb9817304d99e426ab84a91b25b55
2024-12-11 22:38:55 +00:00
Roman Golyshev
77acbfd122 KTIJ-32349 [kotlin] Get rid of redundant SymbolInfoPointer
Now there is no need to restore `SymbolInfo`, because
it is a simple class with simple data at this point

GitOrigin-RevId: e0f3a5f06ae107223221ad8d9fe4c21e3cf4211e
2024-12-11 22:38:55 +00:00
Roman Golyshev
470196cead KTIJ-32349 [kotlin] Do not store KaSymbols in SymbolInfo
This is done so that `SymbolInfo` can be operated with without
`analyze` calls.

GitOrigin-RevId: 614b155c7f204052076804f3aa2234715343b2dc
2024-12-11 22:38:55 +00:00
Anna Kozlova
7f1556a987 [kotlin] k2: name suggestions
^KTIJ-32475 fixed

GitOrigin-RevId: 1ff10615a2febdc7ad69dd99910178112fe819c9
2024-12-11 08:18:10 +00:00
Victoria.Petrakovich
22de3943f5 [kotlin] Make UnfoldReturnToIfIntention shared
Also extract `createReturnExpression()` as util to use it in UnfoldReturnToWhenIntention too

KTIJ-31983

GitOrigin-RevId: be9cb8fbb5663db8657b70d6bddfb36395ca8927
2024-12-10 19:40:37 +00:00
Patronus
c90824c9a8 Merge refs/patronus/safepush/722efb082d8a4ae58a76dd4ea3f957ba into master
GitOrigin-RevId: 8c843a1e50cb6a162db7e701ab3acd8b57b76eeb
2024-12-10 16:32:19 +00:00
Alexey Kudravtsev
4fba5ac500 mark naive recursive psi element visitors as such, to be able to catch more performance errors
GitOrigin-RevId: 3c28a6d1061d6d861dcc78e55b1786742c190d27
2024-12-10 13:19:29 +00:00
Anna Kozlova
1f1b6ccd9d Merge branch 'kt-master'
GitOrigin-RevId: bb2bd4d1bcff0e3e28db8f7de54eb1bd86d50942
2024-12-10 12:24:34 +01:00
Victoria.Petrakovich
06780c3ab1 [kotlin] Use KtExpression.expressionType for correct defining of expression type; add test case with branch with run
Also remove useless `analyze`, make `fun createReturnExpression()` private

KTIJ-31983

GitOrigin-RevId: f746dc9251d3d9ee9d16707180bdae7f7930a97d
2024-12-09 23:57:03 +00:00
Victoria.Petrakovich
e34275664a [kotlin] Port UnfoldReturnToIfIntention to K2
KTIJ-31983

GitOrigin-RevId: 1f84ff6c81a144e3daf5bccd32b74ec899b2a116
2024-12-05 23:58:56 +00:00
Alexey Kudravtsev
d317d3fd87 cleanup
GitOrigin-RevId: edded364e9d3f2e24cb944478f6a6b75d25f5ad3
2024-12-04 15:57:44 +00:00
Anna Kozlova
0158444eae [kotlin] k2: cascade if to when inspection
^KTIJ-22890 fixed

GitOrigin-RevId: 37aee0b758296b6316cfcbf4ea70542ccb7bcab3
2024-12-03 15:44:02 +00:00
Roman Golyshev
8b83d27240 KTIJ-25346 [kotlin] Do not use workaround for typealiased constructors in Import Optimizer after KT-73414 is fixed
Workaround remains only for SAM constructors for now,
until KT-73546 is fixed

GitOrigin-RevId: 87b2cb78d3d2a2ba1e1474f675670851eb43b577
2024-12-03 16:34:18 +01:00
Dmitrii Gridin
e05f7b5431 Merge branch 'kt-master'
GitOrigin-RevId: f1e9bbff7ec43a397c26b7696d30a9a4ae277391
2024-12-03 11:45:37 +01:00
Vladimir Krivosheev
8c77c9ed84 don't export ide.core.impl from lang-impl
GitOrigin-RevId: 029fef0995b0d8e6b684f463bdd856dd17021366
2024-12-02 11:32:59 +00:00
Vladimir Dolzhenko
7e4a7b0161 [kotlin] Clean up
#KTIJ-16537

GitOrigin-RevId: cd6ba9be4ee34d934e019fedc15f0bf6bbd947f9
2024-12-01 09:48:28 +00:00
Vladimir Dolzhenko
0116d91cdc [kotlin] Added test data
#KTIJ-16537

GitOrigin-RevId: c5c4f2f279417c3d06f2ea2f098e0bbb3d79d4ae
2024-12-01 09:48:28 +00:00
Anna Kozlova
78ab37d3d2 [kotlin] k2: create expect from actual
review feedback; rename for ExpectActualSupport to avoid confusion

KTIJ-32213

GitOrigin-RevId: e0fa9f3f7ffe3a1a500837e915ba9c079efe6fce
2024-11-29 21:20:08 +00:00
Roman Golyshev
bc17eec19c KTIJ-25346 [kotlin] Use constructedClass to locate SAM class from SAM constructor symbol
The `findSamClassFor` workaround is no longer needed after
KT-70301 has been fixed

GitOrigin-RevId: 7520bd8d497ffd3744be4b0305ffb3d289205595
2024-11-29 17:15:42 +01:00
Anna Kozlova
410cd8400a [kotlin] test data for type hierarchy starting in the library
^KTIJ-25790 fixed

GitOrigin-RevId: b87588284321845bf183896a817c5692f891419b
2024-11-27 22:15:36 +00:00
Oleg Makeev
09ce40737b [Analysis API] Add KaSymbolRelationProvider.getConstructedClass
Before that change, there was no convenient and fast way
to retrieve SAM class symbol from SAM constructor.

^KT-70301 fixed

GitOrigin-RevId: 8b625781579d375ee4a9027f2d1722d956075958
2024-11-27 15:55:24 +02:00
Vladimir Krivosheev
17916c90f8 libraries -> lib, resources, opt-in, test deps
GitOrigin-RevId: db66ee95dcb0f0553b40c9cc56cd6afed8634cdd
2024-11-27 13:53:42 +00:00
Patronus
20f250d17d Merge refs/patronus/safepush/b0dd10faf1124dd7b24f761c278cad7e into master
GitOrigin-RevId: 2aed091ace2584c32d49763478320bdb08ee6373
2024-11-27 12:20:22 +00:00
Vladimir Dolzhenko
44cf4a6b14 [kotlin] Handled suspended function type with receiver
#KTIJ-31804

GitOrigin-RevId: b6790218b0c615f183ad5e2390b911e114f401dd
2024-11-27 12:16:05 +00:00
Vladimir Dolzhenko
d3faa0c40d [kotlin] Fixed inlay hints for suspend function types
#KTIJ-31804 Fixed

GitOrigin-RevId: 8137e725e8ede5b6f0b19ceb39c2c54125a8e760
2024-11-27 08:40:05 +00:00
Vladimir Dolzhenko
4d8f67c14a [kotlin] Do not duplicate parameter info type annotation
#KTIJ-31759 Fixed

GitOrigin-RevId: 599c7f06a4e0a18d3daa930d7b199142d63108af
2024-11-26 10:51:16 +00:00
Pavel Kirpichenkov
b83fe958ed Merge commit '6f867ac51bb454937c7d507c767e11820a3e61be'
kt-master merge for a kotlinc version: 2.1.20-dev-4972
master@kotlin.git: fee5da60fd97c6994c1846fae1e4e7f5ae93ffb6

GitOrigin-RevId: 1180ba2e6112c2c55e5c120a7ebd40b26f252716
2024-11-26 10:56:53 +02:00
Marco Pennekamp
a3a27a7c65 [kotlin] KotlinReferenceRestoringHelper.isAccessible: Build import directives in the target reference's context
^KTIJ-32275 fixed

GitOrigin-RevId: 6f867ac51bb454937c7d507c767e11820a3e61be
2024-11-25 17:37:44 +00:00
Alexey Belkov
ab498edd6d [kotlin] K2 KotlinCopyPasteReferenceProcessor: add KDoc with a test link
KTIJ-28714

GitOrigin-RevId: e0046edcabf07a90d8eb79bda4c165d516c40862
2024-11-21 23:07:33 +00:00