File tree Expand file tree Collapse file tree 5 files changed +13
-10
lines changed
main/kotlin/org/javacs/kt
test/kotlin/org/javacs/kt Expand file tree Collapse file tree 5 files changed +13
-10
lines changed Original file line number Diff line number Diff line change 1
1
projectVersion =1.3.2
2
- kotlinVersion =1.6 .10
2
+ kotlinVersion =1.8 .10
3
3
exposedVersion =0.37.3
4
4
lsp4jVersion =0.15.0
5
5
javaVersion =11
Original file line number Diff line number Diff line change
1
+ @file:OptIn(ExperimentalCompilerApi ::class )
2
+ @file:Suppress(" DEPRECATION" )
3
+
1
4
package org.javacs.kt.compiler
2
5
3
6
import com.intellij.lang.Language
@@ -67,6 +70,8 @@ import org.jetbrains.kotlin.cli.jvm.compiler.CliBindingTrace
67
70
import org.jetbrains.kotlin.cli.jvm.compiler.EnvironmentConfigFiles
68
71
import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment
69
72
import org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM
73
+ import org.jetbrains.kotlin.cli.jvm.config.configureJdkClasspathRoots
74
+ import org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi
70
75
import org.jetbrains.kotlin.config.*
71
76
import org.jetbrains.kotlin.resolve.scopes.LexicalScope
72
77
import org.jetbrains.kotlin.samWithReceiver.CliSamWithReceiverComponentContributor
@@ -111,6 +116,9 @@ private class CompilationEnvironment(
111
116
add(ComponentRegistrar .PLUGIN_COMPONENT_REGISTRARS , ScriptingCompilerConfigurationComponentRegistrar ())
112
117
put(JVMConfigurationKeys .USE_PSI_CLASS_FILES_READING , true )
113
118
119
+ // configure jvm runtime classpaths
120
+ configureJdkClasspathRoots()
121
+
114
122
addJvmClasspathRoots(classPath.map { it.toFile() })
115
123
addJavaSourceRoots(javaSourcePath.map { it.toFile() })
116
124
Original file line number Diff line number Diff line change @@ -9,20 +9,13 @@ import org.jetbrains.kotlin.builtins.isFunctionType
9
9
import org.jetbrains.kotlin.renderer.ClassifierNamePolicy
10
10
import org.jetbrains.kotlin.renderer.DescriptorRenderer
11
11
import org.jetbrains.kotlin.renderer.ParameterNameRenderingPolicy
12
- import org.jetbrains.kotlin.types.ErrorUtils
13
- import org.jetbrains.kotlin.types.UnresolvedType
14
12
15
13
val DECL_RENDERER = DescriptorRenderer .withOptions {
16
14
withDefinedIn = false
17
15
modifiers = emptySet()
18
16
classifierNamePolicy = ClassifierNamePolicy .SHORT
19
17
parameterNameRenderingPolicy = ParameterNameRenderingPolicy .ONLY_NON_SYNTHESIZED
20
- typeNormalizer = {
21
- when (it) {
22
- is UnresolvedType -> ErrorUtils .createErrorTypeWithCustomDebugName(it.presentableName)
23
- else -> it
24
- }
25
- }
18
+ typeNormalizer = { it -> it }
26
19
}
27
20
28
21
private val GOOD_IDENTIFIER = Regex (" [a-zA-Z]\\ w*" )
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ import org.javacs.kt.completion.DECL_RENDERER
20
20
import org.javacs.kt.position.position
21
21
import org.javacs.kt.util.findParent
22
22
import org.javacs.kt.signaturehelp.getDocString
23
+ import org.jetbrains.kotlin.utils.IDEAPluginsCompatibilityAPI
23
24
24
25
fun hoverAt (file : CompiledFile , cursor : Int ): Hover ? {
25
26
val (ref, target) = file.referenceAtPoint(cursor) ? : return typeHoverAt(file, cursor)
@@ -67,6 +68,7 @@ private fun renderJavaDoc(text: String): String {
67
68
}.joinToString(" \n " )
68
69
}
69
70
71
+ @OptIn(IDEAPluginsCompatibilityAPI ::class )
70
72
private fun renderTypeOf (element : KtExpression , bindingContext : BindingContext ): String? {
71
73
if (element is KtCallableDeclaration ) {
72
74
val descriptor = bindingContext[BindingContext .DECLARATION_TO_DESCRIPTOR , element]
Original file line number Diff line number Diff line change @@ -19,8 +19,8 @@ import org.jetbrains.kotlin.psi.KtPsiFactory
19
19
import org.jetbrains.kotlin.resolve.BindingTraceContext
20
20
import org.jetbrains.kotlin.resolve.LazyTopDownAnalyzer
21
21
import org.jetbrains.kotlin.resolve.TopDownAnalysisMode
22
- import org.jetbrains.kotlin.resolve.calls.callUtil.getParentResolvedCall
23
22
import org.jetbrains.kotlin.resolve.calls.smartcasts.DataFlowInfoFactory
23
+ import org.jetbrains.kotlin.resolve.calls.util.getParentResolvedCall
24
24
import org.junit.Test
25
25
import org.openjdk.jmh.annotations.*
26
26
import org.openjdk.jmh.runner.Runner
You can’t perform that action at this time.
0 commit comments