1421 Commits

Author SHA1 Message Date
Ian Lynagh
b841d5f923 Merge pull request #14622 from igfoo/igfoo/JavaBinarySourceElement
Kotlin: Add support for JavaBinarySourceElement sources
2023-10-31 10:33:48 +00:00
Ian Lynagh
e2ef0dc71d Merge pull request #14621 from igfoo/igfoo/getFileClassFqName_IrField
Kotlin: Fix getFileClassFqName for IrField
2023-10-30 13:54:08 +00:00
Ian Lynagh
d46442245b Merge pull request #14518 from igfoo/igfoo/trap_files
Kotlin: Log when we start and finish writing to TRAP files
2023-10-30 13:53:04 +00:00
Ian Lynagh
55df481e5c Kotlin: Add support for JavaBinarySourceElement sources 2023-10-30 11:43:36 +00:00
Ian Lynagh
e25c0498d4 Kotlin: Fix getFileClassFqName for IrField 2023-10-27 18:00:33 +01:00
Ian Lynagh
ab891465a4 Kotlin: Don't convert back and forth between ClassId and FqName
This showed up as a bug in Kotlin 2 mode:

We were starting with the Class Id "java/util/Map.Entry", which we then
converted to the FqName "java.util.Map.Entry", and then back to a
Class Id with ClassId.topLevel. This gave us a Class Id that
referenceClass wasn't able to resolve.

Now we just stick with the Class Id that we started with, and the class
can be resolved by Kotlin 2.
2023-10-17 17:01:53 +01:00
Ian Lynagh
0a0ce1f202 Kotlin: Log when we start and finish writing to TRAP files 2023-10-16 16:14:23 +01:00
Ian Lynagh
adb47399c7 Kotlin: Improve support for TRAP compression options
While you could control compression with
    CODEQL_EXTRACTOR_JAVA_OPTION_TRAP_COMPRESSION
before, most TRAP files used gzip regardless for compatibility with the
Java extractor. Now Java understands the option too we can use it for
shared TRAP files.
2023-10-12 18:13:06 +01:00
Ian Lynagh
d34b85cf03 Kotlin: Remove 1.4 compatibility
We now only build with >= 1.5
2023-10-06 15:17:32 +01:00
Ian Lynagh
e124a70380 Merge pull request #14378 from igfoo/igfoo/compr
Kotlin: Some compression simplification
2023-10-05 13:16:00 +01:00
Ian Lynagh
4d3863461e Kotlin: Determine our compression method later
This way, we already have a logger at the point that we want to log a
warning.
2023-10-04 18:32:12 +01:00
Ian Lynagh
cc63bb55c2 Kotlin: Change how we handle not supporting Brotli
This removes the potential for impossible cases.
2023-10-04 18:32:11 +01:00
Ian Lynagh
ec3f08037c Kotlin: Remove some unused code 2023-10-04 11:15:47 +01:00
Ian Lynagh
513a39f0b4 Kotlin: Specify language versino when compiling for old compilers
Otherwise builds with Kotlin 2 won't work with older compilers.
2023-10-02 18:14:01 +01:00
Ian Lynagh
f3c5c01ec5 Kotlin: Drop support for 1.4.32
We never claimed to support anything < 1.5.0, and compiling with
-language-version 1.4 fails as it's not meant to support sealed classes.

If we build 1.4.32 with -language-version 1.5 using a 2.0 compiler,
then the resulting plugin also fails.
2023-10-02 17:29:10 +01:00
Ian Lynagh
30d7f0cf0a Merge pull request #14334 from igfoo/igfoo/ext-frag
Kotlin: Handle IrExternalPackageFragment properly for more external entities
2023-09-28 20:01:52 +01:00
Ian Lynagh
e9482fb096 Kotlin: Differentiate 2 error messages 2023-09-28 14:59:21 +01:00
Ian Lynagh
5db283e86a Kotlin: Fix comment 2023-09-28 14:26:02 +01:00
Ian Lynagh
261ae4ea4d Kotlin: Handle IrExternalPackageFragment properly for more external entities 2023-09-28 12:12:18 +01:00
Ian Lynagh
497d48bd63 Kotlin: Claim to support Kotlin 2
We don't fully support it yet, but if we don't claim to support it then
Kotlin fails early.
2023-09-26 17:24:11 +01:00
Ian Lynagh
56b9fa8e9c Kotlin: Avoid using a possibly-throwing method 2023-09-22 18:15:28 +01:00
Ian Lynagh
52d924924b Kotlin: Extract LighterAST comments as well as PSI comments 2023-09-14 14:24:52 +01:00
Ian Lynagh
4908188060 Kotlin: Add 1.9.20 support 2023-09-12 18:28:33 +01:00
Ian Lynagh
4d1ceff7df Kotlin: Fix build 2023-09-12 18:28:33 +01:00
Ian Lynagh
5ea4c44701 Kotlin: Give some more informative errors messages 2023-09-05 12:33:49 +01:00
Ian Lynagh
a2659eecfb Merge pull request #14018 from igfoo/igfoo/extractor_information_kotlin1
Kotlin: Write usesK2 ("uses Kotlin 2") information to the database
2023-09-04 13:38:23 +01:00
Ian Lynagh
181594badb Kotlin: Add packageFqName and IrSymbolInternals compatibility
In master, we need to switch to these, but for building for older
versions we need to add our own support.

Currently the v_1_9_255 files are nto used, but we will need them (in a
differently-named directory) for a future release.
2023-09-01 11:20:58 +01:00
Ian Lynagh
72e08a9277 Kotlin: Tweak the build system
You can now make a versions/* directory that the build system doesn't
know about. This can be used to add support for not-yet-supported
versions.
2023-09-01 11:08:54 +01:00
Ian Lynagh
eb59bc04cd Kotlin: Add missing imports 2023-08-31 19:28:05 +01:00
Ian Lynagh
3009f40814 Kotlin: Opt in to org.jetbrains.kotlin.ir.symbols.IrSymbolInternals
Needed for upstream master.
2023-08-31 19:28:05 +01:00
Ian Lynagh
1ec29bffbb Kotlin: Don't use deprecated createBlockBody
The function that takes a list of statements is hidden in upstream
master.
2023-08-31 19:28:05 +01:00
Ian Lynagh
d511d46cde Kotlin: Use packageFqName rather than fqName
Upstream master says:
   error: using 'fqName: FqName' is an error. Please use `packageFqName` instead
2023-08-31 19:28:05 +01:00
Ian Lynagh
c67cc23e07 Kotlin: Write usesK2 information to the database 2023-08-22 12:37:01 +01:00
Ian Lynagh
3b9bd16097 Kotlin: Mark some functions as private 2023-08-15 12:38:47 +01:00
Ian Lynagh
a8b69e5b55 Kotlin: Fix build on old versions 2023-08-15 11:30:23 +01:00
Ian Lynagh
eb27428514 Kotlin: Handle IrExternalPackageFragment when dealing with external decls 2023-08-14 17:37:48 +01:00
Ian Lynagh
72af8ac1e2 Kotlin: Switch to useDeclarationParentOf
This lets us handle Kotlin 2 declarations whose parent is an
IrExternalPackageFragment, indicating that they are in a (multi)file
class.
2023-08-14 17:02:49 +01:00
Ian Lynagh
4f336820de Kotlin: Start handling IrExternalPackageFragment parents 2023-08-14 17:02:48 +01:00
Ian Lynagh
77451de9a3 Kotlin: Fix isExternalDeclaration for Kotlin 2 2023-08-14 15:01:13 +01:00
Ian Lynagh
58da62e244 Kotlin: Handle null parent IDs in getFunctionLabel correctly 2023-08-10 18:49:10 +01:00
Ian Lynagh
0eb6d1c76e Kotlin: useFunction might return null 2023-08-09 13:45:15 +01:00
Ian Lynagh
3e86c4c39e Kotlin: Allow extractNewExpr to return null 2023-08-07 18:59:51 +01:00
Ian Lynagh
0d97c1c54a Merge pull request #13837 from igfoo/igfoo/nullFunLabel
Kotlin: Pass on a parentId and remove some redundant braces
2023-08-07 12:19:22 +01:00
Ian Lynagh
01a512b677 Kotlin: Pass on a parentId 2023-07-28 17:46:05 +01:00
Ian Lynagh
e8f4aee1cf Kotlin: Remove some redundant braces 2023-07-28 17:02:24 +01:00
Ian Lynagh
499bd970d3 Merge pull request #13412 from igfoo/igfoo/json_escape
Kotlin: Tweak our JSON escaping
2023-07-28 11:13:51 +01:00
Ian Lynagh
fe24cc1900 Merge pull request #13718 from igfoo/igfoo/file_classes
Kotlin: Improve file class support
2023-07-12 15:42:16 +01:00
Ian Lynagh
6dedd9286c Kotlin: Record "file class" info from the compiler
We were making file classes when the parent was a file, but not when it
was a class marked as one.
2023-07-11 15:58:42 +01:00
Ian Lynagh
a603f21ce1 Kotlin: Use 1.9.0 for CI 2023-07-11 14:10:48 +01:00
Ian Lynagh
fcf003ceb5 Revert "Kotlin: Remove a use of ObsoleteDescriptorBasedAPI"
This reverts commit a50d804ad7.
2023-06-30 19:32:37 +01:00