Switch to 202 platform
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
201
|
||||
202
|
||||
203_202
|
||||
193
|
||||
as40_193
|
||||
as41
|
||||
as42_202
|
||||
201
|
||||
193_201
|
||||
as40_193_201
|
||||
as41_201
|
||||
as42
|
||||
+1
-1
@@ -8,4 +8,4 @@ package org.jetbrains.kotlin.codegen.optimization.common
|
||||
import org.jetbrains.org.objectweb.asm.tree.analysis.BasicValue
|
||||
import org.jetbrains.org.objectweb.asm.tree.analysis.Frame
|
||||
|
||||
typealias TypeAnnotatedFrames = Array<Frame<BasicValue>?>
|
||||
typealias TypeAnnotatedFrames = Array<Frame<BasicValue>>
|
||||
+1
-1
@@ -8,4 +8,4 @@ package org.jetbrains.kotlin.codegen.optimization.common
|
||||
import org.jetbrains.org.objectweb.asm.tree.analysis.BasicValue
|
||||
import org.jetbrains.org.objectweb.asm.tree.analysis.Frame
|
||||
|
||||
typealias TypeAnnotatedFrames = Array<Frame<BasicValue>>
|
||||
typealias TypeAnnotatedFrames = Array<Frame<BasicValue>?>
|
||||
@@ -5,4 +5,4 @@
|
||||
|
||||
package org.jetbrains.kotlin.codegen.state
|
||||
|
||||
typealias JvmMethodExceptionTypes = Array<out String>?
|
||||
typealias JvmMethodExceptionTypes = Array<out String?>?
|
||||
+1
-1
@@ -5,4 +5,4 @@
|
||||
|
||||
package org.jetbrains.kotlin.codegen.state
|
||||
|
||||
typealias JvmMethodExceptionTypes = Array<out String?>?
|
||||
typealias JvmMethodExceptionTypes = Array<out String>?
|
||||
+1
-1
@@ -31,6 +31,6 @@ interface MessageCollectorBasedReporter : DiagnosticMessageReporter {
|
||||
override fun report(diagnostic: Diagnostic, file: PsiFile, render: String) = messageCollector.report(
|
||||
AnalyzerWithCompilerReport.convertSeverity(diagnostic.severity),
|
||||
render,
|
||||
MessageUtil.psiFileToMessageLocation(file, file.name, DiagnosticUtils.getLineAndColumnRange(diagnostic))
|
||||
MessageUtil.psiFileToMessageLocation(file, file.name, DiagnosticUtils.getLineAndColumn(diagnostic))
|
||||
)
|
||||
}
|
||||
|
||||
+1
-1
@@ -31,6 +31,6 @@ interface MessageCollectorBasedReporter : DiagnosticMessageReporter {
|
||||
override fun report(diagnostic: Diagnostic, file: PsiFile, render: String) = messageCollector.report(
|
||||
AnalyzerWithCompilerReport.convertSeverity(diagnostic.severity),
|
||||
render,
|
||||
MessageUtil.psiFileToMessageLocation(file, file.name, DiagnosticUtils.getLineAndColumn(diagnostic))
|
||||
MessageUtil.psiFileToMessageLocation(file, file.name, DiagnosticUtils.getLineAndColumnRange(diagnostic))
|
||||
)
|
||||
}
|
||||
@@ -17,8 +17,6 @@
|
||||
package org.jetbrains.kotlin.cli.common.messages;
|
||||
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.vfs.impl.jar.CoreJarVirtualFile;
|
||||
import com.intellij.openapi.vfs.local.CoreLocalVirtualFile;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -32,31 +30,25 @@ public class MessageUtil {
|
||||
private MessageUtil() {}
|
||||
|
||||
@Nullable
|
||||
public static CompilerMessageSourceLocation psiElementToMessageLocation(@Nullable PsiElement element) {
|
||||
public static CompilerMessageLocation psiElementToMessageLocation(@Nullable PsiElement element) {
|
||||
if (element == null) return null;
|
||||
PsiFile file = element.getContainingFile();
|
||||
return psiFileToMessageLocation(file, "<no path>", DiagnosticUtils.getLineAndColumnRangeInPsiFile(file, element.getTextRange()));
|
||||
return psiFileToMessageLocation(file, "<no path>", DiagnosticUtils.getLineAndColumnInPsiFile(file, element.getTextRange()));
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static CompilerMessageSourceLocation psiFileToMessageLocation(
|
||||
public static CompilerMessageLocation psiFileToMessageLocation(
|
||||
@NotNull PsiFile file,
|
||||
@Nullable String defaultValue,
|
||||
@NotNull PsiDiagnosticUtils.LineAndColumnRange range
|
||||
@NotNull PsiDiagnosticUtils.LineAndColumn lineAndColumn
|
||||
) {
|
||||
VirtualFile virtualFile = file.getVirtualFile();
|
||||
String path = virtualFile != null ? virtualFileToPath(virtualFile) : defaultValue;
|
||||
PsiDiagnosticUtils.LineAndColumn start = range.getStart();
|
||||
PsiDiagnosticUtils.LineAndColumn end = range.getEnd();
|
||||
return CompilerMessageLocationWithRange.create(path, start.getLine(), start.getColumn(), end.getLine(), end.getColumn(), start.getLineContent());
|
||||
return CompilerMessageLocation.create(path, lineAndColumn.getLine(), lineAndColumn.getColumn(), lineAndColumn.getLineContent());
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static String virtualFileToPath(@NotNull VirtualFile virtualFile) {
|
||||
// Convert path to platform-dependent format when virtualFile is local file.
|
||||
if (virtualFile instanceof CoreLocalVirtualFile || virtualFile instanceof CoreJarVirtualFile) {
|
||||
return toSystemDependentName(virtualFile.getPath());
|
||||
}
|
||||
return virtualFile.getPath();
|
||||
return toSystemDependentName(virtualFile.getPath());
|
||||
}
|
||||
}
|
||||
|
||||
+14
-6
@@ -17,6 +17,8 @@
|
||||
package org.jetbrains.kotlin.cli.common.messages;
|
||||
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.vfs.impl.jar.CoreJarVirtualFile;
|
||||
import com.intellij.openapi.vfs.local.CoreLocalVirtualFile;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -30,25 +32,31 @@ public class MessageUtil {
|
||||
private MessageUtil() {}
|
||||
|
||||
@Nullable
|
||||
public static CompilerMessageLocation psiElementToMessageLocation(@Nullable PsiElement element) {
|
||||
public static CompilerMessageSourceLocation psiElementToMessageLocation(@Nullable PsiElement element) {
|
||||
if (element == null) return null;
|
||||
PsiFile file = element.getContainingFile();
|
||||
return psiFileToMessageLocation(file, "<no path>", DiagnosticUtils.getLineAndColumnInPsiFile(file, element.getTextRange()));
|
||||
return psiFileToMessageLocation(file, "<no path>", DiagnosticUtils.getLineAndColumnRangeInPsiFile(file, element.getTextRange()));
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static CompilerMessageLocation psiFileToMessageLocation(
|
||||
public static CompilerMessageSourceLocation psiFileToMessageLocation(
|
||||
@NotNull PsiFile file,
|
||||
@Nullable String defaultValue,
|
||||
@NotNull PsiDiagnosticUtils.LineAndColumn lineAndColumn
|
||||
@NotNull PsiDiagnosticUtils.LineAndColumnRange range
|
||||
) {
|
||||
VirtualFile virtualFile = file.getVirtualFile();
|
||||
String path = virtualFile != null ? virtualFileToPath(virtualFile) : defaultValue;
|
||||
return CompilerMessageLocation.create(path, lineAndColumn.getLine(), lineAndColumn.getColumn(), lineAndColumn.getLineContent());
|
||||
PsiDiagnosticUtils.LineAndColumn start = range.getStart();
|
||||
PsiDiagnosticUtils.LineAndColumn end = range.getEnd();
|
||||
return CompilerMessageLocationWithRange.create(path, start.getLine(), start.getColumn(), end.getLine(), end.getColumn(), start.getLineContent());
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static String virtualFileToPath(@NotNull VirtualFile virtualFile) {
|
||||
return toSystemDependentName(virtualFile.getPath());
|
||||
// Convert path to platform-dependent format when virtualFile is local file.
|
||||
if (virtualFile instanceof CoreLocalVirtualFile || virtualFile instanceof CoreJarVirtualFile) {
|
||||
return toSystemDependentName(virtualFile.getPath());
|
||||
}
|
||||
return virtualFile.getPath();
|
||||
}
|
||||
}
|
||||
@@ -12,4 +12,6 @@ fun setupIdeaStandaloneExecution() {
|
||||
System.getProperties().setProperty("psi.incremental.reparse.depth.limit", "1000")
|
||||
System.getProperties().setProperty("ide.hide.excluded.files", "false")
|
||||
System.getProperties().setProperty("ast.loading.filter", "false")
|
||||
System.getProperties().setProperty("idea.ignore.disabled.plugins", "true")
|
||||
System.getProperties().setProperty("idea.home.path", System.getProperty("java.io.tmpdir"))
|
||||
}
|
||||
-2
@@ -12,6 +12,4 @@ fun setupIdeaStandaloneExecution() {
|
||||
System.getProperties().setProperty("psi.incremental.reparse.depth.limit", "1000")
|
||||
System.getProperties().setProperty("ide.hide.excluded.files", "false")
|
||||
System.getProperties().setProperty("ast.loading.filter", "false")
|
||||
System.getProperties().setProperty("idea.ignore.disabled.plugins", "true")
|
||||
System.getProperties().setProperty("idea.home.path", System.getProperty("java.io.tmpdir"))
|
||||
}
|
||||
@@ -14,9 +14,9 @@ sdax = {
|
||||
compiler/testData/multiplatform/regressions/kt28385/jvm.kt:5:8: error: expecting a top level declaration
|
||||
sdax = {
|
||||
^
|
||||
compiler/testData/multiplatform/regressions/kt28385/jvm.kt:3:1: error: property must be initialized
|
||||
val dasda
|
||||
^
|
||||
compiler/testData/multiplatform/regressions/kt28385/jvm.kt:5:8: error: function declaration must have a name
|
||||
sdax = {
|
||||
^
|
||||
compiler/testData/multiplatform/regressions/kt28385/jvm.kt:3:1: error: property must be initialized
|
||||
val dasda
|
||||
^
|
||||
|
||||
+3
-3
@@ -12,11 +12,11 @@ compiler/testData/multiplatform/regressions/kt28385/jvm.kt:5:6: error: expecting
|
||||
sdax = {
|
||||
^
|
||||
compiler/testData/multiplatform/regressions/kt28385/jvm.kt:5:8: error: expecting a top level declaration
|
||||
sdax = {
|
||||
^
|
||||
compiler/testData/multiplatform/regressions/kt28385/jvm.kt:5:8: error: function declaration must have a name
|
||||
sdax = {
|
||||
^
|
||||
compiler/testData/multiplatform/regressions/kt28385/jvm.kt:3:1: error: property must be initialized
|
||||
val dasda
|
||||
^
|
||||
compiler/testData/multiplatform/regressions/kt28385/jvm.kt:5:8: error: function declaration must have a name
|
||||
sdax = {
|
||||
^
|
||||
-1
@@ -140,7 +140,6 @@ public abstract class KtParsingTestCase extends KtPlatformLiteFixture {
|
||||
// That's for reparse routines
|
||||
final PomModelImpl pomModel = new PomModelImpl(myProject);
|
||||
myProject.registerService(PomModel.class, pomModel);
|
||||
new TreeAspect(pomModel);
|
||||
}
|
||||
|
||||
public void configureFromParserDefinition(ParserDefinition definition, String extension) {
|
||||
|
||||
+1
@@ -140,6 +140,7 @@ public abstract class KtParsingTestCase extends KtPlatformLiteFixture {
|
||||
// That's for reparse routines
|
||||
final PomModelImpl pomModel = new PomModelImpl(myProject);
|
||||
myProject.registerService(PomModel.class, pomModel);
|
||||
new TreeAspect(pomModel);
|
||||
}
|
||||
|
||||
public void configureFromParserDefinition(ParserDefinition definition, String extension) {
|
||||
+5
-3
@@ -82,6 +82,9 @@ import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* @author peter
|
||||
*/
|
||||
@SuppressWarnings("ALL")
|
||||
public abstract class KtUsefulTestCase extends TestCase {
|
||||
public static final boolean IS_UNDER_TEAMCITY = System.getenv("TEAMCITY_VERSION") != null;
|
||||
@@ -1081,8 +1084,7 @@ public abstract class KtUsefulTestCase extends TestCase {
|
||||
|
||||
if (shouldOccur) {
|
||||
wasThrown = true;
|
||||
final String errorMessage = exceptionCase.getAssertionErrorMessage();
|
||||
assertEquals(errorMessage, exceptionCase.getExpectedExceptionClass(), cause.getClass());
|
||||
assertInstanceOf(cause, exceptionCase.getExpectedExceptionClass());
|
||||
if (expectedErrorMsgPart != null) {
|
||||
assertTrue(cause.getMessage(), cause.getMessage().contains(expectedErrorMsgPart));
|
||||
}
|
||||
@@ -1103,7 +1105,7 @@ public abstract class KtUsefulTestCase extends TestCase {
|
||||
}
|
||||
finally {
|
||||
if (shouldOccur && !wasThrown) {
|
||||
fail(exceptionCase.getAssertionErrorMessage());
|
||||
fail(exceptionCase.getExpectedExceptionClass().getName() + " must be thrown.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-5
@@ -82,9 +82,6 @@ import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* @author peter
|
||||
*/
|
||||
@SuppressWarnings("ALL")
|
||||
public abstract class KtUsefulTestCase extends TestCase {
|
||||
public static final boolean IS_UNDER_TEAMCITY = System.getenv("TEAMCITY_VERSION") != null;
|
||||
@@ -1084,7 +1081,8 @@ public abstract class KtUsefulTestCase extends TestCase {
|
||||
|
||||
if (shouldOccur) {
|
||||
wasThrown = true;
|
||||
assertInstanceOf(cause, exceptionCase.getExpectedExceptionClass());
|
||||
final String errorMessage = exceptionCase.getAssertionErrorMessage();
|
||||
assertEquals(errorMessage, exceptionCase.getExpectedExceptionClass(), cause.getClass());
|
||||
if (expectedErrorMsgPart != null) {
|
||||
assertTrue(cause.getMessage(), cause.getMessage().contains(expectedErrorMsgPart));
|
||||
}
|
||||
@@ -1105,7 +1103,7 @@ public abstract class KtUsefulTestCase extends TestCase {
|
||||
}
|
||||
finally {
|
||||
if (shouldOccur && !wasThrown) {
|
||||
fail(exceptionCase.getExpectedExceptionClass().getName() + " must be thrown.");
|
||||
fail(exceptionCase.getAssertionErrorMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
versions.intellijSdk=201.7223.91
|
||||
versions.intellijSdk=202.5103-EAP-CANDIDATE-SNAPSHOT
|
||||
versions.androidBuildTools=r23.0.1
|
||||
versions.idea.NodeJS=193.6494.7
|
||||
versions.jar.asm-all=7.0.1
|
||||
versions.jar.guava=28.2-jre
|
||||
versions.jar.groovy-all=2.4.17
|
||||
versions.jar.asm-all=8.0.1
|
||||
versions.jar.guava=29.0-jre
|
||||
versions.jar.groovy=2.5.11
|
||||
versions.jar.lombok-ast=0.2.3
|
||||
versions.jar.swingx-core=1.6.2-2
|
||||
versions.jar.kxml2=2.3.0
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
versions.intellijSdk=202.5103-EAP-CANDIDATE-SNAPSHOT
|
||||
versions.intellijSdk=201.7223.91
|
||||
versions.androidBuildTools=r23.0.1
|
||||
versions.idea.NodeJS=193.6494.7
|
||||
versions.jar.asm-all=8.0.1
|
||||
versions.jar.guava=29.0-jre
|
||||
versions.jar.groovy=2.5.11
|
||||
versions.jar.asm-all=7.0.1
|
||||
versions.jar.guava=28.2-jre
|
||||
versions.jar.groovy-all=2.4.17
|
||||
versions.jar.lombok-ast=0.2.3
|
||||
versions.jar.swingx-core=1.6.2-2
|
||||
versions.jar.kxml2=2.3.0
|
||||
Vendored
+4
-4
@@ -6,8 +6,8 @@ fun test() {
|
||||
message("<caret>")
|
||||
}
|
||||
|
||||
// EXIST: { lookupString: "foo.bar", itemText: "foo.bar", tailText: "1", typeText: "PropertyKeysEmptyString" }
|
||||
// EXIST: { lookupString: "bar.baz", itemText: "bar.baz", tailText: "2", typeText: "PropertyKeysEmptyString" }
|
||||
// EXIST: { lookupString: "foo.bar.baz", itemText: "foo.bar.baz", tailText: "3", typeText: "PropertyKeysEmptyString" }
|
||||
// EXIST: { lookupString: "foo.test", itemText: "foo.test", tailText: "4", typeText: "PropertyKeysEmptyString" }
|
||||
// EXIST: { lookupString: "foo.bar", itemText: "foo.bar", tailText: "=1", typeText: "PropertyKeysEmptyString" }
|
||||
// EXIST: { lookupString: "bar.baz", itemText: "bar.baz", tailText: "=2", typeText: "PropertyKeysEmptyString" }
|
||||
// EXIST: { lookupString: "foo.bar.baz", itemText: "foo.bar.baz", tailText: "=3", typeText: "PropertyKeysEmptyString" }
|
||||
// EXIST: { lookupString: "foo.test", itemText: "foo.test", tailText: "=4", typeText: "PropertyKeysEmptyString" }
|
||||
// NOTHING_ELSE
|
||||
+4
-4
@@ -6,8 +6,8 @@ fun test() {
|
||||
message("<caret>")
|
||||
}
|
||||
|
||||
// EXIST: { lookupString: "foo.bar", itemText: "foo.bar", tailText: "=1", typeText: "PropertyKeysEmptyString" }
|
||||
// EXIST: { lookupString: "bar.baz", itemText: "bar.baz", tailText: "=2", typeText: "PropertyKeysEmptyString" }
|
||||
// EXIST: { lookupString: "foo.bar.baz", itemText: "foo.bar.baz", tailText: "=3", typeText: "PropertyKeysEmptyString" }
|
||||
// EXIST: { lookupString: "foo.test", itemText: "foo.test", tailText: "=4", typeText: "PropertyKeysEmptyString" }
|
||||
// EXIST: { lookupString: "foo.bar", itemText: "foo.bar", tailText: "1", typeText: "PropertyKeysEmptyString" }
|
||||
// EXIST: { lookupString: "bar.baz", itemText: "bar.baz", tailText: "2", typeText: "PropertyKeysEmptyString" }
|
||||
// EXIST: { lookupString: "foo.bar.baz", itemText: "foo.bar.baz", tailText: "3", typeText: "PropertyKeysEmptyString" }
|
||||
// EXIST: { lookupString: "foo.test", itemText: "foo.test", tailText: "4", typeText: "PropertyKeysEmptyString" }
|
||||
// NOTHING_ELSE
|
||||
+4
-4
@@ -6,8 +6,8 @@ fun test() {
|
||||
message("<caret>foo")
|
||||
}
|
||||
|
||||
// EXIST: { lookupString: "foo.bar", itemText: "foo.bar", tailText: "1", typeText: "PropertyKeysNoPrefix" }
|
||||
// EXIST: { lookupString: "bar.baz", itemText: "bar.baz", tailText: "2", typeText: "PropertyKeysNoPrefix" }
|
||||
// EXIST: { lookupString: "foo.bar.baz", itemText: "foo.bar.baz", tailText: "3", typeText: "PropertyKeysNoPrefix" }
|
||||
// EXIST: { lookupString: "foo.test", itemText: "foo.test", tailText: "4", typeText: "PropertyKeysNoPrefix" }
|
||||
// EXIST: { lookupString: "foo.bar", itemText: "foo.bar", tailText: "=1", typeText: "PropertyKeysNoPrefix" }
|
||||
// EXIST: { lookupString: "bar.baz", itemText: "bar.baz", tailText: "=2", typeText: "PropertyKeysNoPrefix" }
|
||||
// EXIST: { lookupString: "foo.bar.baz", itemText: "foo.bar.baz", tailText: "=3", typeText: "PropertyKeysNoPrefix" }
|
||||
// EXIST: { lookupString: "foo.test", itemText: "foo.test", tailText: "=4", typeText: "PropertyKeysNoPrefix" }
|
||||
// NOTHING_ELSE
|
||||
+4
-4
@@ -6,8 +6,8 @@ fun test() {
|
||||
message("<caret>foo")
|
||||
}
|
||||
|
||||
// EXIST: { lookupString: "foo.bar", itemText: "foo.bar", tailText: "=1", typeText: "PropertyKeysNoPrefix" }
|
||||
// EXIST: { lookupString: "bar.baz", itemText: "bar.baz", tailText: "=2", typeText: "PropertyKeysNoPrefix" }
|
||||
// EXIST: { lookupString: "foo.bar.baz", itemText: "foo.bar.baz", tailText: "=3", typeText: "PropertyKeysNoPrefix" }
|
||||
// EXIST: { lookupString: "foo.test", itemText: "foo.test", tailText: "=4", typeText: "PropertyKeysNoPrefix" }
|
||||
// EXIST: { lookupString: "foo.bar", itemText: "foo.bar", tailText: "1", typeText: "PropertyKeysNoPrefix" }
|
||||
// EXIST: { lookupString: "bar.baz", itemText: "bar.baz", tailText: "2", typeText: "PropertyKeysNoPrefix" }
|
||||
// EXIST: { lookupString: "foo.bar.baz", itemText: "foo.bar.baz", tailText: "3", typeText: "PropertyKeysNoPrefix" }
|
||||
// EXIST: { lookupString: "foo.test", itemText: "foo.test", tailText: "4", typeText: "PropertyKeysNoPrefix" }
|
||||
// NOTHING_ELSE
|
||||
Vendored
+3
-3
@@ -6,7 +6,7 @@ fun test() {
|
||||
message("foo.<caret>")
|
||||
}
|
||||
|
||||
// EXIST: { lookupString: "foo.bar", itemText: "foo.bar", tailText: "1", typeText: "PropertyKeysWithPrefix" }
|
||||
// EXIST: { lookupString: "foo.bar.baz", itemText: "foo.bar.baz", tailText: "3", typeText: "PropertyKeysWithPrefix" }
|
||||
// EXIST: { lookupString: "foo.test", itemText: "foo.test", tailText: "4", typeText: "PropertyKeysWithPrefix" }
|
||||
// EXIST: { lookupString: "foo.bar", itemText: "foo.bar", tailText: "=1", typeText: "PropertyKeysWithPrefix" }
|
||||
// EXIST: { lookupString: "foo.bar.baz", itemText: "foo.bar.baz", tailText: "=3", typeText: "PropertyKeysWithPrefix" }
|
||||
// EXIST: { lookupString: "foo.test", itemText: "foo.test", tailText: "=4", typeText: "PropertyKeysWithPrefix" }
|
||||
// NOTHING_ELSE
|
||||
+3
-3
@@ -6,7 +6,7 @@ fun test() {
|
||||
message("foo.<caret>")
|
||||
}
|
||||
|
||||
// EXIST: { lookupString: "foo.bar", itemText: "foo.bar", tailText: "=1", typeText: "PropertyKeysWithPrefix" }
|
||||
// EXIST: { lookupString: "foo.bar.baz", itemText: "foo.bar.baz", tailText: "=3", typeText: "PropertyKeysWithPrefix" }
|
||||
// EXIST: { lookupString: "foo.test", itemText: "foo.test", tailText: "=4", typeText: "PropertyKeysWithPrefix" }
|
||||
// EXIST: { lookupString: "foo.bar", itemText: "foo.bar", tailText: "1", typeText: "PropertyKeysWithPrefix" }
|
||||
// EXIST: { lookupString: "foo.bar.baz", itemText: "foo.bar.baz", tailText: "3", typeText: "PropertyKeysWithPrefix" }
|
||||
// EXIST: { lookupString: "foo.test", itemText: "foo.test", tailText: "4", typeText: "PropertyKeysWithPrefix" }
|
||||
// NOTHING_ELSE
|
||||
@@ -23,11 +23,11 @@ class DaemonCodeAnalyzerStatusService(project: Project) : Disposable {
|
||||
init {
|
||||
val messageBusConnection = project.messageBus.connect(this)
|
||||
messageBusConnection.subscribe(DaemonCodeAnalyzer.DAEMON_EVENT_TOPIC, object : DaemonCodeAnalyzer.DaemonListener {
|
||||
override fun daemonStarting(fileEditors: MutableCollection<FileEditor>) {
|
||||
override fun daemonStarting(fileEditors: MutableCollection<out FileEditor>) {
|
||||
daemonRunning = true
|
||||
}
|
||||
|
||||
override fun daemonFinished(fileEditors: MutableCollection<FileEditor>) {
|
||||
override fun daemonFinished(fileEditors: MutableCollection<out FileEditor>) {
|
||||
daemonRunning = false
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -23,11 +23,11 @@ class DaemonCodeAnalyzerStatusService(project: Project) : Disposable {
|
||||
init {
|
||||
val messageBusConnection = project.messageBus.connect(this)
|
||||
messageBusConnection.subscribe(DaemonCodeAnalyzer.DAEMON_EVENT_TOPIC, object : DaemonCodeAnalyzer.DaemonListener {
|
||||
override fun daemonStarting(fileEditors: MutableCollection<out FileEditor>) {
|
||||
override fun daemonStarting(fileEditors: MutableCollection<FileEditor>) {
|
||||
daemonRunning = true
|
||||
}
|
||||
|
||||
override fun daemonFinished(fileEditors: MutableCollection<out FileEditor>) {
|
||||
override fun daemonFinished(fileEditors: MutableCollection<FileEditor>) {
|
||||
daemonRunning = false
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ class ShowKotlinGradleDslLogs : IntentionAction, AnAction(), DumbAware {
|
||||
RevealFileAction.openDirectory(logsDir)
|
||||
} else {
|
||||
val parent = WindowManager.getInstance().getStatusBar(project)?.component
|
||||
?: WindowManager.getInstance().findVisibleFrame().rootPane
|
||||
?: WindowManager.getInstance().findVisibleFrame()?.rootPane
|
||||
JBPopupFactory.getInstance()
|
||||
.createHtmlTextBalloonBuilder(
|
||||
KotlinIdeaGradleBundle.message(
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ class ShowKotlinGradleDslLogs : IntentionAction, AnAction(), DumbAware {
|
||||
RevealFileAction.openDirectory(logsDir)
|
||||
} else {
|
||||
val parent = WindowManager.getInstance().getStatusBar(project)?.component
|
||||
?: WindowManager.getInstance().findVisibleFrame()?.rootPane
|
||||
?: WindowManager.getInstance().findVisibleFrame().rootPane
|
||||
JBPopupFactory.getInstance()
|
||||
.createHtmlTextBalloonBuilder(
|
||||
KotlinIdeaGradleBundle.message(
|
||||
+2
-1
@@ -25,6 +25,7 @@ import com.intellij.openapi.projectRoots.impl.JavaSdkImpl;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.newvfs.impl.VfsRootAccess;
|
||||
import com.intellij.testFramework.IdeaTestUtil;
|
||||
import kotlin.jvm.functions.Function0;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.TestOnly;
|
||||
@@ -49,7 +50,7 @@ public class PluginTestCaseBase {
|
||||
@NotNull
|
||||
@TestOnly
|
||||
private static Sdk createMockJdk(@NotNull String name, String path) {
|
||||
return ((JavaSdkImpl)JavaSdk.getInstance()).createMockJdk(name, path, false);
|
||||
return IdeaTestUtil.createMockJdk(name, path, false);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
+1
-2
@@ -25,7 +25,6 @@ import com.intellij.openapi.projectRoots.impl.JavaSdkImpl;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.newvfs.impl.VfsRootAccess;
|
||||
import com.intellij.testFramework.IdeaTestUtil;
|
||||
import kotlin.jvm.functions.Function0;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.TestOnly;
|
||||
@@ -50,7 +49,7 @@ public class PluginTestCaseBase {
|
||||
@NotNull
|
||||
@TestOnly
|
||||
private static Sdk createMockJdk(@NotNull String name, String path) {
|
||||
return IdeaTestUtil.createMockJdk(name, path, false);
|
||||
return ((JavaSdkImpl)JavaSdk.getInstance()).createMockJdk(name, path, false);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@@ -5,11 +5,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.idea.test
|
||||
|
||||
import com.intellij.ide.startup.impl.StartupManagerImpl
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.openapi.startup.StartupManager
|
||||
|
||||
// FIX ME WHEN BUNCH 201 REMOVED
|
||||
fun runPostStartupActivitiesOnce(project: Project) {
|
||||
(StartupManager.getInstance(project) as StartupManagerImpl).runPostStartupActivitiesRegisteredDynamically()
|
||||
}
|
||||
}
|
||||
|
||||
+5
-1
@@ -5,7 +5,11 @@
|
||||
|
||||
package org.jetbrains.kotlin.idea.test
|
||||
|
||||
import com.intellij.ide.startup.impl.StartupManagerImpl
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.openapi.startup.StartupManager
|
||||
|
||||
// FIX ME WHEN BUNCH 201 REMOVED
|
||||
fun runPostStartupActivitiesOnce(project: Project) {
|
||||
}
|
||||
(StartupManager.getInstance(project) as StartupManagerImpl).runPostStartupActivitiesRegisteredDynamically()
|
||||
}
|
||||
+4
-3
@@ -63,9 +63,10 @@ class KotlinClassWithDelegatedPropertyRenderer : ClassRenderer() {
|
||||
): String? {
|
||||
val toStringRenderer = rendererSettings.toStringRenderer
|
||||
if (toStringRenderer.isEnabled && DebuggerManagerEx.getInstanceEx(evaluationContext.project).context.canRunEvaluation) {
|
||||
if (toStringRenderer.isApplicable(descriptor.type)) {
|
||||
return toStringRenderer.calcLabel(descriptor, evaluationContext, listener)
|
||||
}
|
||||
val label = toStringRenderer.isApplicableAsync(descriptor.type).thenApply { applicable: Boolean ->
|
||||
if (applicable) toStringRenderer.calcLabel(descriptor, evaluationContext, listener) else null
|
||||
}.get()
|
||||
return label
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
+3
-4
@@ -63,10 +63,9 @@ class KotlinClassWithDelegatedPropertyRenderer : ClassRenderer() {
|
||||
): String? {
|
||||
val toStringRenderer = rendererSettings.toStringRenderer
|
||||
if (toStringRenderer.isEnabled && DebuggerManagerEx.getInstanceEx(evaluationContext.project).context.canRunEvaluation) {
|
||||
val label = toStringRenderer.isApplicableAsync(descriptor.type).thenApply { applicable: Boolean ->
|
||||
if (applicable) toStringRenderer.calcLabel(descriptor, evaluationContext, listener) else null
|
||||
}.get()
|
||||
return label
|
||||
if (toStringRenderer.isApplicable(descriptor.type)) {
|
||||
return toStringRenderer.calcLabel(descriptor, evaluationContext, listener)
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
+4
-3
@@ -13,11 +13,13 @@ import com.intellij.openapi.externalSystem.util.ExternalSystemUtil
|
||||
import com.intellij.openapi.project.DumbService
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.openapi.roots.ProjectRootManager
|
||||
import org.gradle.util.GradleVersion
|
||||
import org.jetbrains.plugins.gradle.service.project.open.setupGradleSettings
|
||||
import org.jetbrains.plugins.gradle.settings.GradleProjectSettings
|
||||
import org.jetbrains.plugins.gradle.settings.GradleSettings
|
||||
import org.jetbrains.plugins.gradle.util.GradleConstants
|
||||
import org.jetbrains.plugins.gradle.util.GradleLog
|
||||
import org.jetbrains.plugins.gradle.util.suggestGradleVersion
|
||||
import java.io.File
|
||||
import kotlin.test.assertNotNull
|
||||
|
||||
@@ -34,14 +36,13 @@ const val GRADLE_JDK_NAME = "Gradle JDK"
|
||||
*/
|
||||
private fun _importProject(projectPath: String, project: Project) {
|
||||
GradleLog.LOG.info("Import project at $projectPath")
|
||||
val projectSdk = ProjectRootManager.getInstance(project).projectSdk
|
||||
assertNotNull(projectSdk, "project SDK not found for ${project.name} at $projectPath")
|
||||
val gradleProjectSettings = GradleProjectSettings()
|
||||
val gradleVersion = suggestGradleVersion(project) ?: GradleVersion.current()
|
||||
|
||||
GradleSettings.getInstance(project).gradleVmOptions =
|
||||
"-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=${System.getProperty("user.dir")}"
|
||||
|
||||
setupGradleSettings(gradleProjectSettings, projectPath, project, projectSdk)
|
||||
setupGradleSettings(project, gradleProjectSettings, projectPath, gradleVersion)
|
||||
gradleProjectSettings.gradleJvm = GRADLE_JDK_NAME
|
||||
|
||||
GradleSettings.getInstance(project).getLinkedProjectSettings(projectPath)?.let { linkedProjectSettings ->
|
||||
|
||||
+3
-4
@@ -13,13 +13,11 @@ import com.intellij.openapi.externalSystem.util.ExternalSystemUtil
|
||||
import com.intellij.openapi.project.DumbService
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.openapi.roots.ProjectRootManager
|
||||
import org.gradle.util.GradleVersion
|
||||
import org.jetbrains.plugins.gradle.service.project.open.setupGradleSettings
|
||||
import org.jetbrains.plugins.gradle.settings.GradleProjectSettings
|
||||
import org.jetbrains.plugins.gradle.settings.GradleSettings
|
||||
import org.jetbrains.plugins.gradle.util.GradleConstants
|
||||
import org.jetbrains.plugins.gradle.util.GradleLog
|
||||
import org.jetbrains.plugins.gradle.util.suggestGradleVersion
|
||||
import java.io.File
|
||||
import kotlin.test.assertNotNull
|
||||
|
||||
@@ -36,13 +34,14 @@ const val GRADLE_JDK_NAME = "Gradle JDK"
|
||||
*/
|
||||
private fun _importProject(projectPath: String, project: Project) {
|
||||
GradleLog.LOG.info("Import project at $projectPath")
|
||||
val projectSdk = ProjectRootManager.getInstance(project).projectSdk
|
||||
assertNotNull(projectSdk, "project SDK not found for ${project.name} at $projectPath")
|
||||
val gradleProjectSettings = GradleProjectSettings()
|
||||
val gradleVersion = suggestGradleVersion(project) ?: GradleVersion.current()
|
||||
|
||||
GradleSettings.getInstance(project).gradleVmOptions =
|
||||
"-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=${System.getProperty("user.dir")}"
|
||||
|
||||
setupGradleSettings(project, gradleProjectSettings, projectPath, gradleVersion)
|
||||
setupGradleSettings(gradleProjectSettings, projectPath, project, projectSdk)
|
||||
gradleProjectSettings.gradleJvm = GRADLE_JDK_NAME
|
||||
|
||||
GradleSettings.getInstance(project).getLinkedProjectSettings(projectPath)?.let { linkedProjectSettings ->
|
||||
+4
-7
@@ -8,6 +8,7 @@ package org.jetbrains.kotlin.idea.testFramework
|
||||
import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer
|
||||
import com.intellij.codeInsight.daemon.DaemonCodeAnalyzerSettings
|
||||
import com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerImpl
|
||||
import com.intellij.ide.impl.OpenProjectTask
|
||||
import com.intellij.ide.startup.impl.StartupManagerImpl
|
||||
import com.intellij.lang.LanguageAnnotators
|
||||
import com.intellij.lang.LanguageExtensionPoint
|
||||
@@ -20,6 +21,7 @@ import com.intellij.openapi.fileEditor.FileDocumentManager
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.openapi.project.ex.ProjectManagerEx
|
||||
import com.intellij.openapi.startup.StartupManager
|
||||
import com.intellij.platform.PlatformProjectOpenProcessor
|
||||
import com.intellij.psi.PsiDocumentManager
|
||||
import com.intellij.psi.impl.PsiDocumentManagerBase
|
||||
import com.intellij.testFramework.ExtensionTestUtil
|
||||
@@ -27,7 +29,6 @@ import com.intellij.testFramework.TestApplicationManager
|
||||
import com.intellij.testFramework.runInEdtAndWait
|
||||
import com.intellij.util.ui.UIUtil
|
||||
import org.jetbrains.kotlin.idea.perf.util.logMessage
|
||||
import org.jetbrains.kotlin.idea.test.runPostStartupActivitiesOnce
|
||||
import java.nio.file.Paths
|
||||
|
||||
fun commitAllDocuments() {
|
||||
@@ -69,7 +70,7 @@ fun dispatchAllInvocationEvents() {
|
||||
}
|
||||
|
||||
fun loadProjectWithName(path: String, name: String): Project? =
|
||||
ProjectManagerEx.getInstanceEx().loadProject(Paths.get(path), name)
|
||||
PlatformProjectOpenProcessor.openExistingProject(Paths.get(path), Paths.get(path), OpenProjectTask(projectName = name))
|
||||
|
||||
fun TestApplicationManager.closeProject(project: Project) {
|
||||
val name = project.name
|
||||
@@ -90,11 +91,7 @@ fun TestApplicationManager.closeProject(project: Project) {
|
||||
}
|
||||
|
||||
fun runStartupActivities(project: Project) {
|
||||
with(StartupManager.getInstance(project) as StartupManagerImpl) {
|
||||
//scheduleInitialVfsRefresh()
|
||||
runStartupActivities()
|
||||
}
|
||||
runPostStartupActivitiesOnce(project)
|
||||
// obsolete
|
||||
}
|
||||
|
||||
fun waitForAllEditorsFinallyLoaded(project: Project) {
|
||||
|
||||
+7
-4
@@ -8,7 +8,6 @@ package org.jetbrains.kotlin.idea.testFramework
|
||||
import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer
|
||||
import com.intellij.codeInsight.daemon.DaemonCodeAnalyzerSettings
|
||||
import com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerImpl
|
||||
import com.intellij.ide.impl.OpenProjectTask
|
||||
import com.intellij.ide.startup.impl.StartupManagerImpl
|
||||
import com.intellij.lang.LanguageAnnotators
|
||||
import com.intellij.lang.LanguageExtensionPoint
|
||||
@@ -21,7 +20,6 @@ import com.intellij.openapi.fileEditor.FileDocumentManager
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.openapi.project.ex.ProjectManagerEx
|
||||
import com.intellij.openapi.startup.StartupManager
|
||||
import com.intellij.platform.PlatformProjectOpenProcessor
|
||||
import com.intellij.psi.PsiDocumentManager
|
||||
import com.intellij.psi.impl.PsiDocumentManagerBase
|
||||
import com.intellij.testFramework.ExtensionTestUtil
|
||||
@@ -29,6 +27,7 @@ import com.intellij.testFramework.TestApplicationManager
|
||||
import com.intellij.testFramework.runInEdtAndWait
|
||||
import com.intellij.util.ui.UIUtil
|
||||
import org.jetbrains.kotlin.idea.perf.util.logMessage
|
||||
import org.jetbrains.kotlin.idea.test.runPostStartupActivitiesOnce
|
||||
import java.nio.file.Paths
|
||||
|
||||
fun commitAllDocuments() {
|
||||
@@ -70,7 +69,7 @@ fun dispatchAllInvocationEvents() {
|
||||
}
|
||||
|
||||
fun loadProjectWithName(path: String, name: String): Project? =
|
||||
PlatformProjectOpenProcessor.openExistingProject(Paths.get(path), Paths.get(path), OpenProjectTask(projectName = name))
|
||||
ProjectManagerEx.getInstanceEx().loadProject(Paths.get(path), name)
|
||||
|
||||
fun TestApplicationManager.closeProject(project: Project) {
|
||||
val name = project.name
|
||||
@@ -91,7 +90,11 @@ fun TestApplicationManager.closeProject(project: Project) {
|
||||
}
|
||||
|
||||
fun runStartupActivities(project: Project) {
|
||||
// obsolete
|
||||
with(StartupManager.getInstance(project) as StartupManagerImpl) {
|
||||
//scheduleInitialVfsRefresh()
|
||||
runStartupActivities()
|
||||
}
|
||||
runPostStartupActivitiesOnce(project)
|
||||
}
|
||||
|
||||
fun waitForAllEditorsFinallyLoaded(project: Project) {
|
||||
@@ -13,7 +13,7 @@ The Kotlin plugin provides language support in IntelliJ IDEA and Android Studio.
|
||||
<version>@snapshot@</version>
|
||||
<vendor url="http://www.jetbrains.com">JetBrains</vendor>
|
||||
|
||||
<idea-version since-build="201.7223.91" until-build="201.*"/>
|
||||
<idea-version since-build="202.1" until-build="202.*"/>
|
||||
|
||||
<change-notes><![CDATA[
|
||||
<h3>1.4.20</h3>
|
||||
@@ -69,7 +69,7 @@ The Kotlin plugin provides language support in IntelliJ IDEA and Android Studio.
|
||||
<!-- ULTIMATE-PLUGIN-PLACEHOLDER -->
|
||||
|
||||
<!-- CIDR-PLUGIN-PLACEHOLDER-START -->
|
||||
<depends>com.intellij.modules.idea</depends>
|
||||
<incompatible-with>com.intellij.modules.androidstudio</incompatible-with>
|
||||
<depends>com.intellij.modules.java</depends>
|
||||
<depends optional="true" config-file="javaScriptDebug.xml">JavaScriptDebugger</depends>
|
||||
<depends optional="true" config-file="kotlin-copyright.xml">com.intellij.copyright</depends>
|
||||
@@ -110,7 +110,7 @@ The Kotlin plugin provides language support in IntelliJ IDEA and Android Studio.
|
||||
|
||||
<extensions defaultExtensionNs="com.intellij">
|
||||
<pathMacroContributor implementation="org.jetbrains.kotlin.idea.KotlinPluginMacros"/>
|
||||
<applicationService serviceImplementation="org.jetbrains.kotlin.idea.PluginStartupApplicationService"/>
|
||||
<applicationService serviceImplementation="org.jetbrains.kotlin.idea.PluginStartupApplicationService" />
|
||||
|
||||
<postStartupActivity implementation="org.jetbrains.kotlin.idea.PluginStartupActivity"/>
|
||||
<projectService serviceImplementation="org.jetbrains.kotlin.idea.PluginStartupService"/>
|
||||
@@ -145,14 +145,11 @@ The Kotlin plugin provides language support in IntelliJ IDEA and Android Studio.
|
||||
<statistics.projectUsagesCollector implementation="org.jetbrains.kotlin.idea.formatter.KotlinFormatterUsageCollector"/>
|
||||
<statistics.projectUsagesCollector implementation="org.jetbrains.kotlin.idea.statistics.ProjectConfigurationCollector"/>
|
||||
|
||||
<fileTypeUsageSchemaDescriptor schema="Gradle Script"
|
||||
implementationClass="org.jetbrains.kotlin.idea.core.script.KotlinGradleScriptFileTypeSchemaDetector"/>
|
||||
<fileTypeUsageSchemaDescriptor schema="Gradle Script" implementationClass="org.jetbrains.kotlin.idea.core.script.KotlinGradleScriptFileTypeSchemaDetector"/>
|
||||
|
||||
<completion.ml.model implementation="org.jetbrains.kotlin.idea.completion.ml.KotlinMLRankingProvider"/>
|
||||
<completion.ml.contextFeatures language="kotlin"
|
||||
implementationClass="org.jetbrains.kotlin.idea.completion.ml.KotlinContextFeatureProvider"/>
|
||||
<suggestedRefactoringSupport language="kotlin"
|
||||
implementationClass="org.jetbrains.kotlin.idea.refactoring.suggested.KotlinSuggestedRefactoringSupport"/>
|
||||
<completion.ml.contextFeatures language="kotlin" implementationClass="org.jetbrains.kotlin.idea.completion.ml.KotlinContextFeatureProvider"/>
|
||||
<suggestedRefactoringSupport language="kotlin" implementationClass="org.jetbrains.kotlin.idea.refactoring.suggested.KotlinSuggestedRefactoringSupport"/>
|
||||
|
||||
<refactoring.moveInnerHandler language="kotlin"
|
||||
implementationClass="org.jetbrains.kotlin.idea.refactoring.move.MoveKotlinInnerHandler"/>
|
||||
|
||||
+9
-6
@@ -13,7 +13,7 @@ The Kotlin plugin provides language support in IntelliJ IDEA and Android Studio.
|
||||
<version>@snapshot@</version>
|
||||
<vendor url="http://www.jetbrains.com">JetBrains</vendor>
|
||||
|
||||
<idea-version since-build="202.1" until-build="202.*"/>
|
||||
<idea-version since-build="201.7223.91" until-build="201.*"/>
|
||||
|
||||
<change-notes><![CDATA[
|
||||
<h3>1.4.20</h3>
|
||||
@@ -69,7 +69,7 @@ The Kotlin plugin provides language support in IntelliJ IDEA and Android Studio.
|
||||
<!-- ULTIMATE-PLUGIN-PLACEHOLDER -->
|
||||
|
||||
<!-- CIDR-PLUGIN-PLACEHOLDER-START -->
|
||||
<incompatible-with>com.intellij.modules.androidstudio</incompatible-with>
|
||||
<depends>com.intellij.modules.idea</depends>
|
||||
<depends>com.intellij.modules.java</depends>
|
||||
<depends optional="true" config-file="javaScriptDebug.xml">JavaScriptDebugger</depends>
|
||||
<depends optional="true" config-file="kotlin-copyright.xml">com.intellij.copyright</depends>
|
||||
@@ -110,7 +110,7 @@ The Kotlin plugin provides language support in IntelliJ IDEA and Android Studio.
|
||||
|
||||
<extensions defaultExtensionNs="com.intellij">
|
||||
<pathMacroContributor implementation="org.jetbrains.kotlin.idea.KotlinPluginMacros"/>
|
||||
<applicationService serviceImplementation="org.jetbrains.kotlin.idea.PluginStartupApplicationService" />
|
||||
<applicationService serviceImplementation="org.jetbrains.kotlin.idea.PluginStartupApplicationService"/>
|
||||
|
||||
<postStartupActivity implementation="org.jetbrains.kotlin.idea.PluginStartupActivity"/>
|
||||
<projectService serviceImplementation="org.jetbrains.kotlin.idea.PluginStartupService"/>
|
||||
@@ -145,11 +145,14 @@ The Kotlin plugin provides language support in IntelliJ IDEA and Android Studio.
|
||||
<statistics.projectUsagesCollector implementation="org.jetbrains.kotlin.idea.formatter.KotlinFormatterUsageCollector"/>
|
||||
<statistics.projectUsagesCollector implementation="org.jetbrains.kotlin.idea.statistics.ProjectConfigurationCollector"/>
|
||||
|
||||
<fileTypeUsageSchemaDescriptor schema="Gradle Script" implementationClass="org.jetbrains.kotlin.idea.core.script.KotlinGradleScriptFileTypeSchemaDetector"/>
|
||||
<fileTypeUsageSchemaDescriptor schema="Gradle Script"
|
||||
implementationClass="org.jetbrains.kotlin.idea.core.script.KotlinGradleScriptFileTypeSchemaDetector"/>
|
||||
|
||||
<completion.ml.model implementation="org.jetbrains.kotlin.idea.completion.ml.KotlinMLRankingProvider"/>
|
||||
<completion.ml.contextFeatures language="kotlin" implementationClass="org.jetbrains.kotlin.idea.completion.ml.KotlinContextFeatureProvider"/>
|
||||
<suggestedRefactoringSupport language="kotlin" implementationClass="org.jetbrains.kotlin.idea.refactoring.suggested.KotlinSuggestedRefactoringSupport"/>
|
||||
<completion.ml.contextFeatures language="kotlin"
|
||||
implementationClass="org.jetbrains.kotlin.idea.completion.ml.KotlinContextFeatureProvider"/>
|
||||
<suggestedRefactoringSupport language="kotlin"
|
||||
implementationClass="org.jetbrains.kotlin.idea.refactoring.suggested.KotlinSuggestedRefactoringSupport"/>
|
||||
|
||||
<refactoring.moveInnerHandler language="kotlin"
|
||||
implementationClass="org.jetbrains.kotlin.idea.refactoring.move.MoveKotlinInnerHandler"/>
|
||||
+2
-2
@@ -46,7 +46,7 @@ abstract class AbstractScratchLineMarkersTest : FileEditorManagerTestCase() {
|
||||
val project = myFixture.project
|
||||
val document = myFixture.editor.document
|
||||
|
||||
val data = ExpectedHighlightingData(document, false, false, false, myFixture.file)
|
||||
val data = ExpectedHighlightingData(document, false, false, false)
|
||||
data.init()
|
||||
|
||||
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
||||
@@ -69,7 +69,7 @@ abstract class AbstractScratchLineMarkersTest : FileEditorManagerTestCase() {
|
||||
): List<LineMarkerInfo<*>> {
|
||||
myFixture.doHighlighting()
|
||||
|
||||
return AbstractLineMarkersTest.checkHighlighting(myFixture.project, documentToAnalyze, expectedHighlighting, expectedFile)
|
||||
return AbstractLineMarkersTest.checkHighlighting(myFixture.file, documentToAnalyze, expectedHighlighting, expectedFile)
|
||||
}
|
||||
|
||||
}
|
||||
+2
-2
@@ -46,7 +46,7 @@ abstract class AbstractScratchLineMarkersTest : FileEditorManagerTestCase() {
|
||||
val project = myFixture.project
|
||||
val document = myFixture.editor.document
|
||||
|
||||
val data = ExpectedHighlightingData(document, false, false, false)
|
||||
val data = ExpectedHighlightingData(document, false, false, false, myFixture.file)
|
||||
data.init()
|
||||
|
||||
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
||||
@@ -69,7 +69,7 @@ abstract class AbstractScratchLineMarkersTest : FileEditorManagerTestCase() {
|
||||
): List<LineMarkerInfo<*>> {
|
||||
myFixture.doHighlighting()
|
||||
|
||||
return AbstractLineMarkersTest.checkHighlighting(myFixture.file, documentToAnalyze, expectedHighlighting, expectedFile)
|
||||
return AbstractLineMarkersTest.checkHighlighting(myFixture.project, documentToAnalyze, expectedHighlighting, expectedFile)
|
||||
}
|
||||
|
||||
}
|
||||
+2
-2
@@ -78,11 +78,11 @@ class KotlinHighlightExitPointsHandlerFactory : HighlightUsagesHandlerFactoryBas
|
||||
|
||||
override fun getTargets() = listOf(target)
|
||||
|
||||
override fun selectTargets(targets: MutableList<PsiElement>, selectionConsumer: Consumer<MutableList<PsiElement>>) {
|
||||
override fun selectTargets(targets: MutableList<out PsiElement>, selectionConsumer: Consumer<in MutableList<out PsiElement>>) {
|
||||
selectionConsumer.consume(targets)
|
||||
}
|
||||
|
||||
override fun computeUsages(targets: MutableList<PsiElement>?) {
|
||||
override fun computeUsages(targets: MutableList<out PsiElement>) {
|
||||
val relevantFunction: KtDeclarationWithBody? =
|
||||
if (target is KtFunctionLiteral) {
|
||||
target
|
||||
|
||||
+2
-2
@@ -78,11 +78,11 @@ class KotlinHighlightExitPointsHandlerFactory : HighlightUsagesHandlerFactoryBas
|
||||
|
||||
override fun getTargets() = listOf(target)
|
||||
|
||||
override fun selectTargets(targets: MutableList<out PsiElement>, selectionConsumer: Consumer<in MutableList<out PsiElement>>) {
|
||||
override fun selectTargets(targets: MutableList<PsiElement>, selectionConsumer: Consumer<MutableList<PsiElement>>) {
|
||||
selectionConsumer.consume(targets)
|
||||
}
|
||||
|
||||
override fun computeUsages(targets: MutableList<out PsiElement>) {
|
||||
override fun computeUsages(targets: MutableList<PsiElement>?) {
|
||||
val relevantFunction: KtDeclarationWithBody? =
|
||||
if (target is KtFunctionLiteral) {
|
||||
target
|
||||
+3
-3
@@ -38,11 +38,11 @@ class KotlinHighlightImplicitItHandlerFactory : HighlightUsagesHandlerFactoryBas
|
||||
override fun getTargets() = listOf(refExpr)
|
||||
|
||||
override fun selectTargets(
|
||||
targets: MutableList<KtNameReferenceExpression>,
|
||||
selectionConsumer: Consumer<MutableList<KtNameReferenceExpression>>
|
||||
targets: MutableList<out KtNameReferenceExpression>,
|
||||
selectionConsumer: Consumer<in MutableList<out KtNameReferenceExpression>>
|
||||
) = selectionConsumer.consume(targets)
|
||||
|
||||
override fun computeUsages(targets: MutableList<KtNameReferenceExpression>?) {
|
||||
override fun computeUsages(targets: MutableList<out KtNameReferenceExpression>) {
|
||||
lambda.accept(
|
||||
object : KtTreeVisitorVoid() {
|
||||
override fun visitSimpleNameExpression(expression: KtSimpleNameExpression) {
|
||||
|
||||
+3
-3
@@ -38,11 +38,11 @@ class KotlinHighlightImplicitItHandlerFactory : HighlightUsagesHandlerFactoryBas
|
||||
override fun getTargets() = listOf(refExpr)
|
||||
|
||||
override fun selectTargets(
|
||||
targets: MutableList<out KtNameReferenceExpression>,
|
||||
selectionConsumer: Consumer<in MutableList<out KtNameReferenceExpression>>
|
||||
targets: MutableList<KtNameReferenceExpression>,
|
||||
selectionConsumer: Consumer<MutableList<KtNameReferenceExpression>>
|
||||
) = selectionConsumer.consume(targets)
|
||||
|
||||
override fun computeUsages(targets: MutableList<out KtNameReferenceExpression>) {
|
||||
override fun computeUsages(targets: MutableList<KtNameReferenceExpression>?) {
|
||||
lambda.accept(
|
||||
object : KtTreeVisitorVoid() {
|
||||
override fun visitSimpleNameExpression(expression: KtSimpleNameExpression) {
|
||||
+1
-1
@@ -46,7 +46,7 @@ import java.util.*
|
||||
class KotlinRecursiveCallLineMarkerProvider : LineMarkerProvider {
|
||||
override fun getLineMarkerInfo(element: PsiElement) = null
|
||||
|
||||
override fun collectSlowLineMarkers(elements: MutableList<PsiElement>, result: LineMarkerInfos) {
|
||||
override fun collectSlowLineMarkers(elements: MutableList<out PsiElement>, result: LineMarkerInfos) {
|
||||
val markedLineNumbers = HashSet<Int>()
|
||||
|
||||
for (element in elements) {
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ import java.util.*
|
||||
class KotlinRecursiveCallLineMarkerProvider : LineMarkerProvider {
|
||||
override fun getLineMarkerInfo(element: PsiElement) = null
|
||||
|
||||
override fun collectSlowLineMarkers(elements: MutableList<out PsiElement>, result: LineMarkerInfos) {
|
||||
override fun collectSlowLineMarkers(elements: MutableList<PsiElement>, result: LineMarkerInfos) {
|
||||
val markedLineNumbers = HashSet<Int>()
|
||||
|
||||
for (element in elements) {
|
||||
+1
-1
@@ -48,7 +48,7 @@ class KotlinSuspendCallLineMarkerProvider : LineMarkerProvider {
|
||||
override fun getLineMarkerInfo(element: PsiElement): LineMarkerInfo<*>? = null
|
||||
|
||||
override fun collectSlowLineMarkers(
|
||||
elements: MutableList<PsiElement>,
|
||||
elements: MutableList<out PsiElement>,
|
||||
result: LineMarkerInfos
|
||||
) {
|
||||
val markedLineNumbers = HashSet<Int>()
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@ class KotlinSuspendCallLineMarkerProvider : LineMarkerProvider {
|
||||
override fun getLineMarkerInfo(element: PsiElement): LineMarkerInfo<*>? = null
|
||||
|
||||
override fun collectSlowLineMarkers(
|
||||
elements: MutableList<out PsiElement>,
|
||||
elements: MutableList<PsiElement>,
|
||||
result: LineMarkerInfos
|
||||
) {
|
||||
val markedLineNumbers = HashSet<Int>()
|
||||
@@ -7,4 +7,4 @@ package org.jetbrains.kotlin.idea.highlighter.markers
|
||||
|
||||
import com.intellij.codeInsight.daemon.LineMarkerInfo
|
||||
|
||||
typealias LineMarkerInfos = MutableCollection<LineMarkerInfo<*>>
|
||||
typealias LineMarkerInfos = MutableCollection<in LineMarkerInfo<*>>
|
||||
+1
-1
@@ -7,4 +7,4 @@ package org.jetbrains.kotlin.idea.highlighter.markers
|
||||
|
||||
import com.intellij.codeInsight.daemon.LineMarkerInfo
|
||||
|
||||
typealias LineMarkerInfos = MutableCollection<in LineMarkerInfo<*>>
|
||||
typealias LineMarkerInfos = MutableCollection<LineMarkerInfo<*>>
|
||||
@@ -161,9 +161,9 @@ class TrailingCommaInspection(
|
||||
val settings = CodeStyle.getSettings(project).clone()
|
||||
settings.kotlinCustomSettings.ALLOW_TRAILING_COMMA = true
|
||||
settings.kotlinCustomSettings.ALLOW_TRAILING_COMMA_ON_CALL_SITE = true
|
||||
CodeStyle.doWithTemporarySettings(project, settings) {
|
||||
CodeStyle.doWithTemporarySettings(project, settings, Runnable {
|
||||
CodeStyleManager.getInstance(project).reformatRange(element, range.startOffset, range.endOffset)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -161,9 +161,9 @@ class TrailingCommaInspection(
|
||||
val settings = CodeStyle.getSettings(project).clone()
|
||||
settings.kotlinCustomSettings.ALLOW_TRAILING_COMMA = true
|
||||
settings.kotlinCustomSettings.ALLOW_TRAILING_COMMA_ON_CALL_SITE = true
|
||||
CodeStyle.doWithTemporarySettings(project, settings, Runnable {
|
||||
CodeStyle.doWithTemporarySettings(project, settings) {
|
||||
CodeStyleManager.getInstance(project).reformatRange(element, range.startOffset, range.endOffset)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -101,7 +101,7 @@ class KotlinTargetElementEvaluator : TargetElementEvaluatorEx, TargetElementUtil
|
||||
return null
|
||||
}
|
||||
|
||||
override fun isIdentifierPart(file: PsiFile, text: CharSequence?, offset: Int): Boolean {
|
||||
override fun isIdentifierPart(file: PsiFile, text: CharSequence, offset: Int): Boolean {
|
||||
val elementAtCaret = file.findElementAt(offset)
|
||||
|
||||
if (elementAtCaret?.node?.elementType == KtTokens.IDENTIFIER) return true
|
||||
|
||||
+1
-1
@@ -101,7 +101,7 @@ class KotlinTargetElementEvaluator : TargetElementEvaluatorEx, TargetElementUtil
|
||||
return null
|
||||
}
|
||||
|
||||
override fun isIdentifierPart(file: PsiFile, text: CharSequence, offset: Int): Boolean {
|
||||
override fun isIdentifierPart(file: PsiFile, text: CharSequence?, offset: Int): Boolean {
|
||||
val elementAtCaret = file.findElementAt(offset)
|
||||
|
||||
if (elementAtCaret?.node?.elementType == KtTokens.IDENTIFIER) return true
|
||||
@@ -73,7 +73,7 @@ class KotlinSliceProvider : SliceLanguageSupportProvider, SliceUsageTransformer
|
||||
|
||||
override fun transform(usage: SliceUsage): Collection<SliceUsage>? {
|
||||
if (usage is KotlinSliceUsage) return null
|
||||
return listOf(KotlinSliceUsage(usage.element, usage.parent, KotlinSliceAnalysisMode.Default, false))
|
||||
return listOf(KotlinSliceUsage(usage.element ?: return null, usage.parent, KotlinSliceAnalysisMode.Default, false))
|
||||
}
|
||||
|
||||
override fun getExpressionAtCaret(atCaret: PsiElement, dataFlowToThis: Boolean): KtElement? {
|
||||
|
||||
+1
-1
@@ -73,7 +73,7 @@ class KotlinSliceProvider : SliceLanguageSupportProvider, SliceUsageTransformer
|
||||
|
||||
override fun transform(usage: SliceUsage): Collection<SliceUsage>? {
|
||||
if (usage is KotlinSliceUsage) return null
|
||||
return listOf(KotlinSliceUsage(usage.element ?: return null, usage.parent, KotlinSliceAnalysisMode.Default, false))
|
||||
return listOf(KotlinSliceUsage(usage.element, usage.parent, KotlinSliceAnalysisMode.Default, false))
|
||||
}
|
||||
|
||||
override fun getExpressionAtCaret(atCaret: PsiElement, dataFlowToThis: Boolean): KtElement? {
|
||||
@@ -12,6 +12,7 @@ import com.intellij.openapi.editor.Document
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.openapi.util.io.FileUtil
|
||||
import com.intellij.psi.PsiDocumentManager
|
||||
import com.intellij.psi.PsiFile
|
||||
import com.intellij.rt.execution.junit.FileComparisonFailure
|
||||
import com.intellij.testFramework.ExpectedHighlightingData
|
||||
import com.intellij.testFramework.LightProjectDescriptor
|
||||
@@ -40,14 +41,14 @@ abstract class AbstractLineMarkersTest : KotlinLightCodeInsightFixtureTestCase()
|
||||
fun doTest(path: String) = doTest(path) {}
|
||||
|
||||
protected fun doAndCheckHighlighting(
|
||||
project: Project,
|
||||
psiFile: PsiFile,
|
||||
documentToAnalyze: Document,
|
||||
expectedHighlighting: ExpectedHighlightingData,
|
||||
expectedFile: File
|
||||
): List<LineMarkerInfo<*>> {
|
||||
myFixture.doHighlighting()
|
||||
|
||||
return checkHighlighting(project, documentToAnalyze, expectedHighlighting, expectedFile)
|
||||
return checkHighlighting(psiFile, documentToAnalyze, expectedHighlighting, expectedFile)
|
||||
}
|
||||
|
||||
fun doTest(path: String, additionalCheck: () -> Unit) {
|
||||
@@ -62,12 +63,12 @@ abstract class AbstractLineMarkersTest : KotlinLightCodeInsightFixtureTestCase()
|
||||
val project = myFixture.project
|
||||
val document = myFixture.editor.document
|
||||
|
||||
val data = ExpectedHighlightingData(document, false, false, false, myFixture.file)
|
||||
val data = ExpectedHighlightingData(document, false, false, false)
|
||||
data.init()
|
||||
|
||||
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
||||
|
||||
val markers = doAndCheckHighlighting(myFixture.project, document, data, testDataFile())
|
||||
val markers = doAndCheckHighlighting(myFixture.file, document, data, testDataFile())
|
||||
|
||||
assertNavigationElements(myFixture.project, myFixture.file as KtFile, markers)
|
||||
additionalCheck()
|
||||
@@ -150,15 +151,15 @@ abstract class AbstractLineMarkersTest : KotlinLightCodeInsightFixtureTestCase()
|
||||
}
|
||||
|
||||
fun checkHighlighting(
|
||||
project: Project,
|
||||
psiFile: PsiFile,
|
||||
documentToAnalyze: Document,
|
||||
expectedHighlighting: ExpectedHighlightingData,
|
||||
expectedFile: File
|
||||
): MutableList<LineMarkerInfo<*>> {
|
||||
val markers = DaemonCodeAnalyzerImpl.getLineMarkers(documentToAnalyze, project)
|
||||
val markers = DaemonCodeAnalyzerImpl.getLineMarkers(documentToAnalyze, psiFile.project)
|
||||
|
||||
try {
|
||||
expectedHighlighting.checkLineMarkers(markers, documentToAnalyze.text)
|
||||
expectedHighlighting.checkLineMarkers(psiFile, markers, documentToAnalyze.text)
|
||||
|
||||
// This is a workaround for sad bug in ExpectedHighlightingData:
|
||||
// the latter doesn't throw assertion error when some line markers are expected, but none are present.
|
||||
|
||||
+7
-8
@@ -12,7 +12,6 @@ import com.intellij.openapi.editor.Document
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.openapi.util.io.FileUtil
|
||||
import com.intellij.psi.PsiDocumentManager
|
||||
import com.intellij.psi.PsiFile
|
||||
import com.intellij.rt.execution.junit.FileComparisonFailure
|
||||
import com.intellij.testFramework.ExpectedHighlightingData
|
||||
import com.intellij.testFramework.LightProjectDescriptor
|
||||
@@ -41,14 +40,14 @@ abstract class AbstractLineMarkersTest : KotlinLightCodeInsightFixtureTestCase()
|
||||
fun doTest(path: String) = doTest(path) {}
|
||||
|
||||
protected fun doAndCheckHighlighting(
|
||||
psiFile: PsiFile,
|
||||
project: Project,
|
||||
documentToAnalyze: Document,
|
||||
expectedHighlighting: ExpectedHighlightingData,
|
||||
expectedFile: File
|
||||
): List<LineMarkerInfo<*>> {
|
||||
myFixture.doHighlighting()
|
||||
|
||||
return checkHighlighting(psiFile, documentToAnalyze, expectedHighlighting, expectedFile)
|
||||
return checkHighlighting(project, documentToAnalyze, expectedHighlighting, expectedFile)
|
||||
}
|
||||
|
||||
fun doTest(path: String, additionalCheck: () -> Unit) {
|
||||
@@ -63,12 +62,12 @@ abstract class AbstractLineMarkersTest : KotlinLightCodeInsightFixtureTestCase()
|
||||
val project = myFixture.project
|
||||
val document = myFixture.editor.document
|
||||
|
||||
val data = ExpectedHighlightingData(document, false, false, false)
|
||||
val data = ExpectedHighlightingData(document, false, false, false, myFixture.file)
|
||||
data.init()
|
||||
|
||||
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
||||
|
||||
val markers = doAndCheckHighlighting(myFixture.file, document, data, testDataFile())
|
||||
val markers = doAndCheckHighlighting(myFixture.project, document, data, testDataFile())
|
||||
|
||||
assertNavigationElements(myFixture.project, myFixture.file as KtFile, markers)
|
||||
additionalCheck()
|
||||
@@ -151,15 +150,15 @@ abstract class AbstractLineMarkersTest : KotlinLightCodeInsightFixtureTestCase()
|
||||
}
|
||||
|
||||
fun checkHighlighting(
|
||||
psiFile: PsiFile,
|
||||
project: Project,
|
||||
documentToAnalyze: Document,
|
||||
expectedHighlighting: ExpectedHighlightingData,
|
||||
expectedFile: File
|
||||
): MutableList<LineMarkerInfo<*>> {
|
||||
val markers = DaemonCodeAnalyzerImpl.getLineMarkers(documentToAnalyze, psiFile.project)
|
||||
val markers = DaemonCodeAnalyzerImpl.getLineMarkers(documentToAnalyze, project)
|
||||
|
||||
try {
|
||||
expectedHighlighting.checkLineMarkers(psiFile, markers, documentToAnalyze.text)
|
||||
expectedHighlighting.checkLineMarkers(markers, documentToAnalyze.text)
|
||||
|
||||
// This is a workaround for sad bug in ExpectedHighlightingData:
|
||||
// the latter doesn't throw assertion error when some line markers are expected, but none are present.
|
||||
+2
-4
@@ -65,9 +65,7 @@ abstract class AbstractLineMarkersTestInLibrarySources : AbstractLineMarkersTest
|
||||
val project = myFixture.project
|
||||
for (file in libraryOriginal.walkTopDown().filter { !it.isDirectory }) {
|
||||
myFixture.openFileInEditor(fileSystem.findFileByPath(file.absolutePath)!!)
|
||||
val data = ExpectedHighlightingData(
|
||||
myFixture.editor.document, false, false, false, myFixture.file
|
||||
)
|
||||
val data = ExpectedHighlightingData(myFixture.editor.document, false, false, false)
|
||||
data.init()
|
||||
|
||||
val librarySourceFile = libraryClean!!.resolve(file.relativeTo(libraryOriginal).path)
|
||||
@@ -79,7 +77,7 @@ abstract class AbstractLineMarkersTestInLibrarySources : AbstractLineMarkersTest
|
||||
throw AssertionError("File ${myFixture.file.virtualFile.path} should be in library sources!")
|
||||
}
|
||||
|
||||
doAndCheckHighlighting(myFixture.project, document, data, file)
|
||||
doAndCheckHighlighting(myFixture.file, document, data, file)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+4
-2
@@ -65,7 +65,9 @@ abstract class AbstractLineMarkersTestInLibrarySources : AbstractLineMarkersTest
|
||||
val project = myFixture.project
|
||||
for (file in libraryOriginal.walkTopDown().filter { !it.isDirectory }) {
|
||||
myFixture.openFileInEditor(fileSystem.findFileByPath(file.absolutePath)!!)
|
||||
val data = ExpectedHighlightingData(myFixture.editor.document, false, false, false)
|
||||
val data = ExpectedHighlightingData(
|
||||
myFixture.editor.document, false, false, false, myFixture.file
|
||||
)
|
||||
data.init()
|
||||
|
||||
val librarySourceFile = libraryClean!!.resolve(file.relativeTo(libraryOriginal).path)
|
||||
@@ -77,7 +79,7 @@ abstract class AbstractLineMarkersTestInLibrarySources : AbstractLineMarkersTest
|
||||
throw AssertionError("File ${myFixture.file.virtualFile.path} should be in library sources!")
|
||||
}
|
||||
|
||||
doAndCheckHighlighting(myFixture.file, document, data, file)
|
||||
doAndCheckHighlighting(myFixture.project, document, data, file)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -24,7 +24,7 @@ abstract class AbstractUsageHighlightingTest : KotlinLightCodeInsightFixtureTest
|
||||
protected fun doTest(unused: String) {
|
||||
myFixture.configureByFile(fileName())
|
||||
val document = myFixture.editor.document
|
||||
val data = ExpectedHighlightingData(document, false, false, true, false, myFixture.file)
|
||||
val data = ExpectedHighlightingData(document, false, false, true, false)
|
||||
data.init()
|
||||
|
||||
val caret = document.extractMarkerOffset(project, CARET_TAG)
|
||||
@@ -48,7 +48,7 @@ abstract class AbstractUsageHighlightingTest : KotlinLightCodeInsightFixtureTest
|
||||
.create()
|
||||
}
|
||||
|
||||
data.checkResult(infos, StringBuilder(document.text).insert(caret, CARET_TAG).toString())
|
||||
data.checkResult(myFixture.file, infos, StringBuilder(document.text).insert(caret, CARET_TAG).toString())
|
||||
}
|
||||
|
||||
private fun isUsageHighlighting(info: RangeHighlighter): Boolean {
|
||||
|
||||
+2
-2
@@ -24,7 +24,7 @@ abstract class AbstractUsageHighlightingTest : KotlinLightCodeInsightFixtureTest
|
||||
protected fun doTest(unused: String) {
|
||||
myFixture.configureByFile(fileName())
|
||||
val document = myFixture.editor.document
|
||||
val data = ExpectedHighlightingData(document, false, false, true, false)
|
||||
val data = ExpectedHighlightingData(document, false, false, true, false, myFixture.file)
|
||||
data.init()
|
||||
|
||||
val caret = document.extractMarkerOffset(project, CARET_TAG)
|
||||
@@ -48,7 +48,7 @@ abstract class AbstractUsageHighlightingTest : KotlinLightCodeInsightFixtureTest
|
||||
.create()
|
||||
}
|
||||
|
||||
data.checkResult(myFixture.file, infos, StringBuilder(document.text).insert(caret, CARET_TAG).toString())
|
||||
data.checkResult(infos, StringBuilder(document.text).insert(caret, CARET_TAG).toString())
|
||||
}
|
||||
|
||||
private fun isUsageHighlighting(info: RangeHighlighter): Boolean {
|
||||
@@ -53,7 +53,7 @@ class InspectionDescriptionTest : LightPlatformTestCase() {
|
||||
private fun loadKotlinInspections(): List<InspectionToolWrapper<InspectionProfileEntry, InspectionEP>> {
|
||||
return InspectionToolRegistrar.getInstance().createTools().filter {
|
||||
it.extension.pluginDescriptor.pluginId == KotlinPluginUtil.KOTLIN_PLUGIN_ID
|
||||
}
|
||||
} as List<InspectionToolWrapper<InspectionProfileEntry, InspectionEP>>
|
||||
}
|
||||
|
||||
private fun loadKotlinInspectionExtensions() =
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ class InspectionDescriptionTest : LightPlatformTestCase() {
|
||||
private fun loadKotlinInspections(): List<InspectionToolWrapper<InspectionProfileEntry, InspectionEP>> {
|
||||
return InspectionToolRegistrar.getInstance().createTools().filter {
|
||||
it.extension.pluginDescriptor.pluginId == KotlinPluginUtil.KOTLIN_PLUGIN_ID
|
||||
} as List<InspectionToolWrapper<InspectionProfileEntry, InspectionEP>>
|
||||
}
|
||||
}
|
||||
|
||||
private fun loadKotlinInspectionExtensions() =
|
||||
@@ -7,6 +7,7 @@ package org.jetbrains.kotlin.idea.intentions
|
||||
|
||||
import com.intellij.codeInsight.intention.IntentionActionBean
|
||||
import com.intellij.codeInsight.intention.IntentionManager
|
||||
import com.intellij.codeInsight.intention.impl.config.IntentionManagerImpl
|
||||
import com.intellij.openapi.extensions.Extensions
|
||||
import com.intellij.testFramework.LightPlatformTestCase
|
||||
import com.intellij.testFramework.UsefulTestCase
|
||||
@@ -56,7 +57,7 @@ class IntentionDescriptionTest : LightPlatformTestCase() {
|
||||
private fun String.isXmlIntentionName() = startsWith("Add") && endsWith("ToManifest")
|
||||
|
||||
private fun loadKotlinIntentions(): List<IntentionActionBean> {
|
||||
val extensionPoint = Extensions.getRootArea().getExtensionPoint(IntentionManager.EP_INTENTION_ACTIONS)
|
||||
val extensionPoint = Extensions.getRootArea().getExtensionPoint(IntentionManagerImpl.EP_INTENTION_ACTIONS)
|
||||
return extensionPoint.extensions.toList().filter {
|
||||
it.pluginDescriptor.pluginId == KotlinPluginUtil.KOTLIN_PLUGIN_ID
|
||||
}
|
||||
|
||||
+1
-2
@@ -7,7 +7,6 @@ package org.jetbrains.kotlin.idea.intentions
|
||||
|
||||
import com.intellij.codeInsight.intention.IntentionActionBean
|
||||
import com.intellij.codeInsight.intention.IntentionManager
|
||||
import com.intellij.codeInsight.intention.impl.config.IntentionManagerImpl
|
||||
import com.intellij.openapi.extensions.Extensions
|
||||
import com.intellij.testFramework.LightPlatformTestCase
|
||||
import com.intellij.testFramework.UsefulTestCase
|
||||
@@ -57,7 +56,7 @@ class IntentionDescriptionTest : LightPlatformTestCase() {
|
||||
private fun String.isXmlIntentionName() = startsWith("Add") && endsWith("ToManifest")
|
||||
|
||||
private fun loadKotlinIntentions(): List<IntentionActionBean> {
|
||||
val extensionPoint = Extensions.getRootArea().getExtensionPoint(IntentionManagerImpl.EP_INTENTION_ACTIONS)
|
||||
val extensionPoint = Extensions.getRootArea().getExtensionPoint(IntentionManager.EP_INTENTION_ACTIONS)
|
||||
return extensionPoint.extensions.toList().filter {
|
||||
it.pluginDescriptor.pluginId == KotlinPluginUtil.KOTLIN_PLUGIN_ID
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
package org.jetbrains.kotlin.idea.navigation
|
||||
|
||||
import com.intellij.ide.util.gotoByName.FilteringGotoByModel
|
||||
import com.intellij.lang.Language
|
||||
import com.intellij.ide.util.gotoByName.LanguageRef
|
||||
import com.intellij.openapi.editor.Editor
|
||||
import com.intellij.psi.PsiElement
|
||||
import com.intellij.testFramework.UsefulTestCase
|
||||
@@ -20,7 +20,7 @@ object GotoCheck {
|
||||
@JvmStatic
|
||||
@JvmOverloads
|
||||
fun checkGotoDirectives(
|
||||
model: FilteringGotoByModel<Language>,
|
||||
model: FilteringGotoByModel<LanguageRef>,
|
||||
editor: Editor,
|
||||
nonProjectSymbols: Boolean = false,
|
||||
checkNavigation: Boolean = false
|
||||
|
||||
+2
-2
@@ -6,7 +6,7 @@
|
||||
package org.jetbrains.kotlin.idea.navigation
|
||||
|
||||
import com.intellij.ide.util.gotoByName.FilteringGotoByModel
|
||||
import com.intellij.ide.util.gotoByName.LanguageRef
|
||||
import com.intellij.lang.Language
|
||||
import com.intellij.openapi.editor.Editor
|
||||
import com.intellij.psi.PsiElement
|
||||
import com.intellij.testFramework.UsefulTestCase
|
||||
@@ -20,7 +20,7 @@ object GotoCheck {
|
||||
@JvmStatic
|
||||
@JvmOverloads
|
||||
fun checkGotoDirectives(
|
||||
model: FilteringGotoByModel<LanguageRef>,
|
||||
model: FilteringGotoByModel<Language>,
|
||||
editor: Editor,
|
||||
nonProjectSymbols: Boolean = false,
|
||||
checkNavigation: Boolean = false
|
||||
+3
-5
@@ -23,17 +23,15 @@ import org.jetbrains.kotlin.resolve.BindingContext
|
||||
import org.jetbrains.kotlin.resolve.TargetEnvironment
|
||||
import org.jetbrains.kotlin.resolve.lazy.BodyResolveMode
|
||||
import org.jetbrains.kotlin.resolve.lazy.ResolveSession
|
||||
import org.picocontainer.MutablePicoContainer
|
||||
|
||||
abstract class AbstractAdditionalResolveDescriptorRendererTest : AbstractDescriptorRendererTest() {
|
||||
override fun setUp() {
|
||||
super.setUp()
|
||||
|
||||
val pomModelImpl = PomModelImpl(project)
|
||||
val treeAspect = TreeAspect(pomModelImpl)
|
||||
|
||||
val mockProject = project as MockProject
|
||||
createAndRegisterKotlinCodeBlockModificationListener(mockProject, pomModelImpl, treeAspect)
|
||||
mockProject.registerService(TreeAspect::class.java, TreeAspect())
|
||||
mockProject.registerService(PomModel::class.java, PomModelImpl(project))
|
||||
mockProject.registerService(KotlinCodeBlockModificationListener::class.java, KotlinCodeBlockModificationListener(mockProject))
|
||||
}
|
||||
|
||||
override fun tearDown() {
|
||||
|
||||
+5
-3
@@ -23,15 +23,17 @@ import org.jetbrains.kotlin.resolve.BindingContext
|
||||
import org.jetbrains.kotlin.resolve.TargetEnvironment
|
||||
import org.jetbrains.kotlin.resolve.lazy.BodyResolveMode
|
||||
import org.jetbrains.kotlin.resolve.lazy.ResolveSession
|
||||
import org.picocontainer.MutablePicoContainer
|
||||
|
||||
abstract class AbstractAdditionalResolveDescriptorRendererTest : AbstractDescriptorRendererTest() {
|
||||
override fun setUp() {
|
||||
super.setUp()
|
||||
|
||||
val pomModelImpl = PomModelImpl(project)
|
||||
val treeAspect = TreeAspect(pomModelImpl)
|
||||
|
||||
val mockProject = project as MockProject
|
||||
mockProject.registerService(TreeAspect::class.java, TreeAspect())
|
||||
mockProject.registerService(PomModel::class.java, PomModelImpl(project))
|
||||
mockProject.registerService(KotlinCodeBlockModificationListener::class.java, KotlinCodeBlockModificationListener(mockProject))
|
||||
createAndRegisterKotlinCodeBlockModificationListener(mockProject, pomModelImpl, treeAspect)
|
||||
}
|
||||
|
||||
override fun tearDown() {
|
||||
@@ -9,6 +9,7 @@ import com.intellij.analysis.AnalysisScope
|
||||
import com.intellij.ide.projectView.TreeStructureProvider
|
||||
import com.intellij.ide.util.treeView.AbstractTreeStructureBase
|
||||
import com.intellij.psi.search.GlobalSearchScope
|
||||
import com.intellij.psi.search.PsiSearchScopeUtil
|
||||
import com.intellij.slicer.DuplicateMap
|
||||
import com.intellij.slicer.SliceAnalysisParams
|
||||
import com.intellij.slicer.SliceNode
|
||||
@@ -63,7 +64,7 @@ internal fun buildTreeRepresentation(rootNode: SliceNode): String {
|
||||
|
||||
else -> {
|
||||
val chunks = usage.text
|
||||
if (!projectScope.contains(usage.element)) {
|
||||
if (!PsiSearchScopeUtil.isInScope(projectScope, usage.element!!)) {
|
||||
append("LIB ")
|
||||
} else {
|
||||
append(chunks.first().render() + " ")
|
||||
|
||||
+1
-2
@@ -9,7 +9,6 @@ import com.intellij.analysis.AnalysisScope
|
||||
import com.intellij.ide.projectView.TreeStructureProvider
|
||||
import com.intellij.ide.util.treeView.AbstractTreeStructureBase
|
||||
import com.intellij.psi.search.GlobalSearchScope
|
||||
import com.intellij.psi.search.PsiSearchScopeUtil
|
||||
import com.intellij.slicer.DuplicateMap
|
||||
import com.intellij.slicer.SliceAnalysisParams
|
||||
import com.intellij.slicer.SliceNode
|
||||
@@ -64,7 +63,7 @@ internal fun buildTreeRepresentation(rootNode: SliceNode): String {
|
||||
|
||||
else -> {
|
||||
val chunks = usage.text
|
||||
if (!PsiSearchScopeUtil.isInScope(projectScope, usage.element!!)) {
|
||||
if (!projectScope.contains(usage.element)) {
|
||||
append("LIB ")
|
||||
} else {
|
||||
append(chunks.first().render() + " ")
|
||||
@@ -40,10 +40,10 @@ abstract class AbstractMultiHighlightingTest : AbstractMultiModuleTest() {
|
||||
|
||||
val text = myEditor.document.text
|
||||
if (shouldCheckLineMarkers) {
|
||||
data.checkLineMarkers(DaemonCodeAnalyzerImpl.getLineMarkers(getDocument(file), project), text)
|
||||
data.checkLineMarkers(myFile, DaemonCodeAnalyzerImpl.getLineMarkers(getDocument(file), project), text)
|
||||
}
|
||||
if (shouldCheckResult) {
|
||||
data.checkResult(infos, text)
|
||||
data.checkResult(myFile, infos, text)
|
||||
}
|
||||
return infos
|
||||
}
|
||||
|
||||
+2
-2
@@ -40,10 +40,10 @@ abstract class AbstractMultiHighlightingTest : AbstractMultiModuleTest() {
|
||||
|
||||
val text = myEditor.document.text
|
||||
if (shouldCheckLineMarkers) {
|
||||
data.checkLineMarkers(myFile, DaemonCodeAnalyzerImpl.getLineMarkers(getDocument(file), project), text)
|
||||
data.checkLineMarkers(DaemonCodeAnalyzerImpl.getLineMarkers(getDocument(file), project), text)
|
||||
}
|
||||
if (shouldCheckResult) {
|
||||
data.checkResult(myFile, infos, text)
|
||||
data.checkResult(infos, text)
|
||||
}
|
||||
return infos
|
||||
}
|
||||
@@ -172,7 +172,6 @@ abstract class AbstractIncrementalJpsTest(
|
||||
BuilderRegistry.getInstance(),
|
||||
myBuildParams,
|
||||
CanceledStatus.NULL,
|
||||
mockConstantSearch,
|
||||
true
|
||||
)
|
||||
val buildResult = BuildResult()
|
||||
|
||||
+1
@@ -172,6 +172,7 @@ abstract class AbstractIncrementalJpsTest(
|
||||
BuilderRegistry.getInstance(),
|
||||
myBuildParams,
|
||||
CanceledStatus.NULL,
|
||||
mockConstantSearch,
|
||||
true
|
||||
)
|
||||
val buildResult = BuildResult()
|
||||
@@ -1009,7 +1009,7 @@ open class KotlinJpsBuildTest : KotlinJpsBuildTestBase() {
|
||||
descriptor.setupProject()
|
||||
|
||||
try {
|
||||
val builder = IncProjectBuilder(descriptor, BuilderRegistry.getInstance(), this.myBuildParams, canceledStatus, null, true)
|
||||
val builder = IncProjectBuilder(descriptor, BuilderRegistry.getInstance(), this.myBuildParams, canceledStatus, true)
|
||||
builder.addMessageHandler(buildResult)
|
||||
builder.build(scopeBuilder.build(), false)
|
||||
}
|
||||
|
||||
+1
-1
@@ -1009,7 +1009,7 @@ open class KotlinJpsBuildTest : KotlinJpsBuildTestBase() {
|
||||
descriptor.setupProject()
|
||||
|
||||
try {
|
||||
val builder = IncProjectBuilder(descriptor, BuilderRegistry.getInstance(), this.myBuildParams, canceledStatus, true)
|
||||
val builder = IncProjectBuilder(descriptor, BuilderRegistry.getInstance(), this.myBuildParams, canceledStatus, null, true)
|
||||
builder.addMessageHandler(buildResult)
|
||||
builder.build(scopeBuilder.build(), false)
|
||||
}
|
||||
+23
-23
@@ -149,7 +149,7 @@ class KotlinUastElementFactory(project: Project) : UastElementFactory {
|
||||
return KotlinStringULiteralExpression(psiFactory.createExpression(StringUtil.wrapWithDoubleQuote(text)), null)
|
||||
}
|
||||
|
||||
/*override*/ fun createNullLiteral(context: PsiElement?): ULiteralExpression {
|
||||
override fun createNullLiteral(context: PsiElement?): ULiteralExpression {
|
||||
return psiFactory.createExpression("null").toUElementOfType<ULiteralExpression>()!!
|
||||
}
|
||||
|
||||
@@ -167,12 +167,12 @@ class KotlinUastElementFactory(project: Project) : UastElementFactory {
|
||||
}
|
||||
|
||||
@Deprecated("use version with context parameter")
|
||||
override fun createIfExpression(condition: UExpression, thenBranch: UExpression, elseBranch: UExpression?): UIfExpression? {
|
||||
fun createIfExpression(condition: UExpression, thenBranch: UExpression, elseBranch: UExpression?): UIfExpression? {
|
||||
logger<KotlinUastElementFactory>().error("Please switch caller to the version with a context parameter")
|
||||
return createIfExpression(condition, thenBranch, elseBranch, null)
|
||||
}
|
||||
|
||||
/*override*/ fun createIfExpression(
|
||||
override fun createIfExpression(
|
||||
condition: UExpression,
|
||||
thenBranch: UExpression,
|
||||
elseBranch: UExpression?,
|
||||
@@ -186,44 +186,44 @@ class KotlinUastElementFactory(project: Project) : UastElementFactory {
|
||||
}
|
||||
|
||||
@Deprecated("use version with context parameter")
|
||||
override fun createParenthesizedExpression(expression: UExpression): UParenthesizedExpression? {
|
||||
fun createParenthesizedExpression(expression: UExpression): UParenthesizedExpression? {
|
||||
logger<KotlinUastElementFactory>().error("Please switch caller to the version with a context parameter")
|
||||
return createParenthesizedExpression(expression, null)
|
||||
}
|
||||
|
||||
/*override*/ fun createParenthesizedExpression(expression: UExpression, context: PsiElement?): UParenthesizedExpression? {
|
||||
override fun createParenthesizedExpression(expression: UExpression, context: PsiElement?): UParenthesizedExpression? {
|
||||
val source = expression.sourcePsi ?: return null
|
||||
val parenthesized = psiFactory.createExpression("(${source.text})") as? KtParenthesizedExpression ?: return null
|
||||
return KotlinUParenthesizedExpression(parenthesized, null)
|
||||
}
|
||||
|
||||
@Deprecated("use version with context parameter")
|
||||
override fun createSimpleReference(name: String): USimpleNameReferenceExpression? {
|
||||
fun createSimpleReference(name: String): USimpleNameReferenceExpression? {
|
||||
logger<KotlinUastElementFactory>().error("Please switch caller to the version with a context parameter")
|
||||
return createSimpleReference(name, null)
|
||||
}
|
||||
|
||||
/*override*/ fun createSimpleReference(name: String, context: PsiElement?): USimpleNameReferenceExpression? {
|
||||
override fun createSimpleReference(name: String, context: PsiElement?): USimpleNameReferenceExpression? {
|
||||
return KotlinUSimpleReferenceExpression(psiFactory.createSimpleName(name), null)
|
||||
}
|
||||
|
||||
@Deprecated("use version with context parameter")
|
||||
override fun createSimpleReference(variable: UVariable): USimpleNameReferenceExpression? {
|
||||
fun createSimpleReference(variable: UVariable): USimpleNameReferenceExpression? {
|
||||
logger<KotlinUastElementFactory>().error("Please switch caller to the version with a context parameter")
|
||||
return createSimpleReference(variable, null)
|
||||
}
|
||||
|
||||
/*override*/ fun createSimpleReference(variable: UVariable, context: PsiElement?): USimpleNameReferenceExpression? {
|
||||
override fun createSimpleReference(variable: UVariable, context: PsiElement?): USimpleNameReferenceExpression? {
|
||||
return createSimpleReference(variable.name ?: return null, context)
|
||||
}
|
||||
|
||||
@Deprecated("use version with context parameter")
|
||||
override fun createReturnExpresion(expression: UExpression?, inLambda: Boolean): UReturnExpression? {
|
||||
fun createReturnExpresion(expression: UExpression?, inLambda: Boolean): UReturnExpression? {
|
||||
logger<KotlinUastElementFactory>().error("Please switch caller to the version with a context parameter")
|
||||
return createReturnExpresion(expression, inLambda, null)
|
||||
}
|
||||
|
||||
/*override*/ fun createReturnExpresion(expression: UExpression?, inLambda: Boolean, context: PsiElement?): UReturnExpression? {
|
||||
override fun createReturnExpresion(expression: UExpression?, inLambda: Boolean, context: PsiElement?): UReturnExpression? {
|
||||
val label = if (inLambda && context != null) getParentLambdaLabelName(context)?.let { "@$it" } ?: "" else ""
|
||||
val returnExpression = psiFactory.createExpression("return$label 1") as KtReturnExpression
|
||||
val sourcePsi = expression?.sourcePsi
|
||||
@@ -246,7 +246,7 @@ class KotlinUastElementFactory(project: Project) : UastElementFactory {
|
||||
}
|
||||
|
||||
@Deprecated("use version with context parameter")
|
||||
override fun createBinaryExpression(
|
||||
fun createBinaryExpression(
|
||||
leftOperand: UExpression,
|
||||
rightOperand: UExpression,
|
||||
operator: UastBinaryOperator
|
||||
@@ -255,7 +255,7 @@ class KotlinUastElementFactory(project: Project) : UastElementFactory {
|
||||
return createBinaryExpression(leftOperand, rightOperand, operator, null)
|
||||
}
|
||||
|
||||
/*override*/ fun createBinaryExpression(
|
||||
override fun createBinaryExpression(
|
||||
leftOperand: UExpression,
|
||||
rightOperand: UExpression,
|
||||
operator: UastBinaryOperator,
|
||||
@@ -280,7 +280,7 @@ class KotlinUastElementFactory(project: Project) : UastElementFactory {
|
||||
}
|
||||
|
||||
@Deprecated("use version with context parameter")
|
||||
override fun createFlatBinaryExpression(
|
||||
fun createFlatBinaryExpression(
|
||||
leftOperand: UExpression,
|
||||
rightOperand: UExpression,
|
||||
operator: UastBinaryOperator
|
||||
@@ -289,7 +289,7 @@ class KotlinUastElementFactory(project: Project) : UastElementFactory {
|
||||
return createFlatBinaryExpression(leftOperand, rightOperand, operator, null)
|
||||
}
|
||||
|
||||
/*override*/ fun createFlatBinaryExpression(
|
||||
override fun createFlatBinaryExpression(
|
||||
leftOperand: UExpression,
|
||||
rightOperand: UExpression,
|
||||
operator: UastBinaryOperator,
|
||||
@@ -310,12 +310,12 @@ class KotlinUastElementFactory(project: Project) : UastElementFactory {
|
||||
}
|
||||
|
||||
@Deprecated("use version with context parameter")
|
||||
override fun createBlockExpression(expressions: List<UExpression>): UBlockExpression? {
|
||||
fun createBlockExpression(expressions: List<UExpression>): UBlockExpression? {
|
||||
logger<KotlinUastElementFactory>().error("Please switch caller to the version with a context parameter")
|
||||
return createBlockExpression(expressions, null)
|
||||
}
|
||||
|
||||
/*override*/ fun createBlockExpression(expressions: List<UExpression>, context: PsiElement?): UBlockExpression? {
|
||||
override fun createBlockExpression(expressions: List<UExpression>, context: PsiElement?): UBlockExpression? {
|
||||
val sourceExpressions = expressions.flatMap { it.toSourcePsiFakeAware() }
|
||||
val block = psiFactory.createBlock(
|
||||
sourceExpressions.joinToString(separator = "\n") { "println()" }
|
||||
@@ -327,19 +327,19 @@ class KotlinUastElementFactory(project: Project) : UastElementFactory {
|
||||
}
|
||||
|
||||
@Deprecated("use version with context parameter")
|
||||
override fun createDeclarationExpression(declarations: List<UDeclaration>): UDeclarationsExpression? {
|
||||
fun createDeclarationExpression(declarations: List<UDeclaration>): UDeclarationsExpression? {
|
||||
logger<KotlinUastElementFactory>().error("Please switch caller to the version with a context parameter")
|
||||
return createDeclarationExpression(declarations, null)
|
||||
}
|
||||
|
||||
/*override*/ fun createDeclarationExpression(declarations: List<UDeclaration>, context: PsiElement?): UDeclarationsExpression? {
|
||||
override fun createDeclarationExpression(declarations: List<UDeclaration>, context: PsiElement?): UDeclarationsExpression? {
|
||||
return object : KotlinUDeclarationsExpression(null), KotlinFakeUElement {
|
||||
override var declarations: List<UDeclaration> = declarations
|
||||
override fun unwrapToSourcePsi(): List<PsiElement> = declarations.flatMap { it.toSourcePsiFakeAware() }
|
||||
}
|
||||
}
|
||||
|
||||
/*override*/ fun createLambdaExpression(
|
||||
override fun createLambdaExpression(
|
||||
parameters: List<UParameterInfo>,
|
||||
body: UExpression,
|
||||
context: PsiElement?
|
||||
@@ -377,12 +377,12 @@ class KotlinUastElementFactory(project: Project) : UastElementFactory {
|
||||
}
|
||||
|
||||
@Deprecated("use version with context parameter")
|
||||
override fun createLambdaExpression(parameters: List<UParameterInfo>, body: UExpression): ULambdaExpression? {
|
||||
fun createLambdaExpression(parameters: List<UParameterInfo>, body: UExpression): ULambdaExpression? {
|
||||
logger<KotlinUastElementFactory>().error("Please switch caller to the version with a context parameter")
|
||||
return createLambdaExpression(parameters, body, null)
|
||||
}
|
||||
|
||||
/*override*/ fun createLocalVariable(
|
||||
override fun createLocalVariable(
|
||||
suggestedName: String?,
|
||||
type: PsiType?,
|
||||
initializer: UExpression,
|
||||
@@ -412,7 +412,7 @@ class KotlinUastElementFactory(project: Project) : UastElementFactory {
|
||||
}
|
||||
|
||||
@Deprecated("use version with context parameter")
|
||||
override fun createLocalVariable(
|
||||
fun createLocalVariable(
|
||||
suggestedName: String?,
|
||||
type: PsiType?,
|
||||
initializer: UExpression,
|
||||
|
||||
+23
-23
@@ -149,7 +149,7 @@ class KotlinUastElementFactory(project: Project) : UastElementFactory {
|
||||
return KotlinStringULiteralExpression(psiFactory.createExpression(StringUtil.wrapWithDoubleQuote(text)), null)
|
||||
}
|
||||
|
||||
override fun createNullLiteral(context: PsiElement?): ULiteralExpression {
|
||||
/*override*/ fun createNullLiteral(context: PsiElement?): ULiteralExpression {
|
||||
return psiFactory.createExpression("null").toUElementOfType<ULiteralExpression>()!!
|
||||
}
|
||||
|
||||
@@ -167,12 +167,12 @@ class KotlinUastElementFactory(project: Project) : UastElementFactory {
|
||||
}
|
||||
|
||||
@Deprecated("use version with context parameter")
|
||||
fun createIfExpression(condition: UExpression, thenBranch: UExpression, elseBranch: UExpression?): UIfExpression? {
|
||||
override fun createIfExpression(condition: UExpression, thenBranch: UExpression, elseBranch: UExpression?): UIfExpression? {
|
||||
logger<KotlinUastElementFactory>().error("Please switch caller to the version with a context parameter")
|
||||
return createIfExpression(condition, thenBranch, elseBranch, null)
|
||||
}
|
||||
|
||||
override fun createIfExpression(
|
||||
/*override*/ fun createIfExpression(
|
||||
condition: UExpression,
|
||||
thenBranch: UExpression,
|
||||
elseBranch: UExpression?,
|
||||
@@ -186,44 +186,44 @@ class KotlinUastElementFactory(project: Project) : UastElementFactory {
|
||||
}
|
||||
|
||||
@Deprecated("use version with context parameter")
|
||||
fun createParenthesizedExpression(expression: UExpression): UParenthesizedExpression? {
|
||||
override fun createParenthesizedExpression(expression: UExpression): UParenthesizedExpression? {
|
||||
logger<KotlinUastElementFactory>().error("Please switch caller to the version with a context parameter")
|
||||
return createParenthesizedExpression(expression, null)
|
||||
}
|
||||
|
||||
override fun createParenthesizedExpression(expression: UExpression, context: PsiElement?): UParenthesizedExpression? {
|
||||
/*override*/ fun createParenthesizedExpression(expression: UExpression, context: PsiElement?): UParenthesizedExpression? {
|
||||
val source = expression.sourcePsi ?: return null
|
||||
val parenthesized = psiFactory.createExpression("(${source.text})") as? KtParenthesizedExpression ?: return null
|
||||
return KotlinUParenthesizedExpression(parenthesized, null)
|
||||
}
|
||||
|
||||
@Deprecated("use version with context parameter")
|
||||
fun createSimpleReference(name: String): USimpleNameReferenceExpression? {
|
||||
override fun createSimpleReference(name: String): USimpleNameReferenceExpression? {
|
||||
logger<KotlinUastElementFactory>().error("Please switch caller to the version with a context parameter")
|
||||
return createSimpleReference(name, null)
|
||||
}
|
||||
|
||||
override fun createSimpleReference(name: String, context: PsiElement?): USimpleNameReferenceExpression? {
|
||||
/*override*/ fun createSimpleReference(name: String, context: PsiElement?): USimpleNameReferenceExpression? {
|
||||
return KotlinUSimpleReferenceExpression(psiFactory.createSimpleName(name), null)
|
||||
}
|
||||
|
||||
@Deprecated("use version with context parameter")
|
||||
fun createSimpleReference(variable: UVariable): USimpleNameReferenceExpression? {
|
||||
override fun createSimpleReference(variable: UVariable): USimpleNameReferenceExpression? {
|
||||
logger<KotlinUastElementFactory>().error("Please switch caller to the version with a context parameter")
|
||||
return createSimpleReference(variable, null)
|
||||
}
|
||||
|
||||
override fun createSimpleReference(variable: UVariable, context: PsiElement?): USimpleNameReferenceExpression? {
|
||||
/*override*/ fun createSimpleReference(variable: UVariable, context: PsiElement?): USimpleNameReferenceExpression? {
|
||||
return createSimpleReference(variable.name ?: return null, context)
|
||||
}
|
||||
|
||||
@Deprecated("use version with context parameter")
|
||||
fun createReturnExpresion(expression: UExpression?, inLambda: Boolean): UReturnExpression? {
|
||||
override fun createReturnExpresion(expression: UExpression?, inLambda: Boolean): UReturnExpression? {
|
||||
logger<KotlinUastElementFactory>().error("Please switch caller to the version with a context parameter")
|
||||
return createReturnExpresion(expression, inLambda, null)
|
||||
}
|
||||
|
||||
override fun createReturnExpresion(expression: UExpression?, inLambda: Boolean, context: PsiElement?): UReturnExpression? {
|
||||
/*override*/ fun createReturnExpresion(expression: UExpression?, inLambda: Boolean, context: PsiElement?): UReturnExpression? {
|
||||
val label = if (inLambda && context != null) getParentLambdaLabelName(context)?.let { "@$it" } ?: "" else ""
|
||||
val returnExpression = psiFactory.createExpression("return$label 1") as KtReturnExpression
|
||||
val sourcePsi = expression?.sourcePsi
|
||||
@@ -246,7 +246,7 @@ class KotlinUastElementFactory(project: Project) : UastElementFactory {
|
||||
}
|
||||
|
||||
@Deprecated("use version with context parameter")
|
||||
fun createBinaryExpression(
|
||||
override fun createBinaryExpression(
|
||||
leftOperand: UExpression,
|
||||
rightOperand: UExpression,
|
||||
operator: UastBinaryOperator
|
||||
@@ -255,7 +255,7 @@ class KotlinUastElementFactory(project: Project) : UastElementFactory {
|
||||
return createBinaryExpression(leftOperand, rightOperand, operator, null)
|
||||
}
|
||||
|
||||
override fun createBinaryExpression(
|
||||
/*override*/ fun createBinaryExpression(
|
||||
leftOperand: UExpression,
|
||||
rightOperand: UExpression,
|
||||
operator: UastBinaryOperator,
|
||||
@@ -280,7 +280,7 @@ class KotlinUastElementFactory(project: Project) : UastElementFactory {
|
||||
}
|
||||
|
||||
@Deprecated("use version with context parameter")
|
||||
fun createFlatBinaryExpression(
|
||||
override fun createFlatBinaryExpression(
|
||||
leftOperand: UExpression,
|
||||
rightOperand: UExpression,
|
||||
operator: UastBinaryOperator
|
||||
@@ -289,7 +289,7 @@ class KotlinUastElementFactory(project: Project) : UastElementFactory {
|
||||
return createFlatBinaryExpression(leftOperand, rightOperand, operator, null)
|
||||
}
|
||||
|
||||
override fun createFlatBinaryExpression(
|
||||
/*override*/ fun createFlatBinaryExpression(
|
||||
leftOperand: UExpression,
|
||||
rightOperand: UExpression,
|
||||
operator: UastBinaryOperator,
|
||||
@@ -310,12 +310,12 @@ class KotlinUastElementFactory(project: Project) : UastElementFactory {
|
||||
}
|
||||
|
||||
@Deprecated("use version with context parameter")
|
||||
fun createBlockExpression(expressions: List<UExpression>): UBlockExpression? {
|
||||
override fun createBlockExpression(expressions: List<UExpression>): UBlockExpression? {
|
||||
logger<KotlinUastElementFactory>().error("Please switch caller to the version with a context parameter")
|
||||
return createBlockExpression(expressions, null)
|
||||
}
|
||||
|
||||
override fun createBlockExpression(expressions: List<UExpression>, context: PsiElement?): UBlockExpression? {
|
||||
/*override*/ fun createBlockExpression(expressions: List<UExpression>, context: PsiElement?): UBlockExpression? {
|
||||
val sourceExpressions = expressions.flatMap { it.toSourcePsiFakeAware() }
|
||||
val block = psiFactory.createBlock(
|
||||
sourceExpressions.joinToString(separator = "\n") { "println()" }
|
||||
@@ -327,19 +327,19 @@ class KotlinUastElementFactory(project: Project) : UastElementFactory {
|
||||
}
|
||||
|
||||
@Deprecated("use version with context parameter")
|
||||
fun createDeclarationExpression(declarations: List<UDeclaration>): UDeclarationsExpression? {
|
||||
override fun createDeclarationExpression(declarations: List<UDeclaration>): UDeclarationsExpression? {
|
||||
logger<KotlinUastElementFactory>().error("Please switch caller to the version with a context parameter")
|
||||
return createDeclarationExpression(declarations, null)
|
||||
}
|
||||
|
||||
override fun createDeclarationExpression(declarations: List<UDeclaration>, context: PsiElement?): UDeclarationsExpression? {
|
||||
/*override*/ fun createDeclarationExpression(declarations: List<UDeclaration>, context: PsiElement?): UDeclarationsExpression? {
|
||||
return object : KotlinUDeclarationsExpression(null), KotlinFakeUElement {
|
||||
override var declarations: List<UDeclaration> = declarations
|
||||
override fun unwrapToSourcePsi(): List<PsiElement> = declarations.flatMap { it.toSourcePsiFakeAware() }
|
||||
}
|
||||
}
|
||||
|
||||
override fun createLambdaExpression(
|
||||
/*override*/ fun createLambdaExpression(
|
||||
parameters: List<UParameterInfo>,
|
||||
body: UExpression,
|
||||
context: PsiElement?
|
||||
@@ -377,12 +377,12 @@ class KotlinUastElementFactory(project: Project) : UastElementFactory {
|
||||
}
|
||||
|
||||
@Deprecated("use version with context parameter")
|
||||
fun createLambdaExpression(parameters: List<UParameterInfo>, body: UExpression): ULambdaExpression? {
|
||||
override fun createLambdaExpression(parameters: List<UParameterInfo>, body: UExpression): ULambdaExpression? {
|
||||
logger<KotlinUastElementFactory>().error("Please switch caller to the version with a context parameter")
|
||||
return createLambdaExpression(parameters, body, null)
|
||||
}
|
||||
|
||||
override fun createLocalVariable(
|
||||
/*override*/ fun createLocalVariable(
|
||||
suggestedName: String?,
|
||||
type: PsiType?,
|
||||
initializer: UExpression,
|
||||
@@ -412,7 +412,7 @@ class KotlinUastElementFactory(project: Project) : UastElementFactory {
|
||||
}
|
||||
|
||||
@Deprecated("use version with context parameter")
|
||||
fun createLocalVariable(
|
||||
override fun createLocalVariable(
|
||||
suggestedName: String?,
|
||||
type: PsiType?,
|
||||
initializer: UExpression,
|
||||
@@ -6,7 +6,6 @@ org.jetbrains.kotlin.gradle.MultiplatformProjectImportingTest.testJsTestOutputFi
|
||||
org.jetbrains.kotlin.gradle.MultiplatformProjectImportingTest.testTransitiveImplementWithAndroid, KT-35225,,
|
||||
org.jetbrains.kotlin.gradle.MultiplatformProjectImportingTest.testTransitiveImplementWithNonDefaultConfig, Gradle Tests in 201,,
|
||||
org.jetbrains.kotlin.gradle.MultiplatformProjectImportingTest.testTransitiveImplement, Gradle Tests in 201,,
|
||||
"org.jetbrains.kotlin.gradle.NewMultiplatformProjectImportingTest.testDetectAndroidSources", Gradle Import Tests,,
|
||||
"org.jetbrains.kotlin.gradle.NewMultiplatformProjectImportingTest.testAndroidDependencyOnMPP", Gradle Import Tests,,
|
||||
"org.jetbrains.kotlin.gradle.NewMultiplatformProjectImportingTest.testDependencyOnRoot", Gradle Tests in 201,,
|
||||
"org.jetbrains.kotlin.gradle.NewMultiplatformProjectImportingTest.testImportBeforeBuild", Gradle Tests in 201,,
|
||||
@@ -16,7 +15,6 @@ org.jetbrains.kotlin.gradle.MultiplatformProjectImportingTest.testTransitiveImpl
|
||||
"org.jetbrains.kotlin.gradle.NewMultiplatformProjectImportingTest.testProjectDependency", Gradle Tests in 201,,
|
||||
org.jetbrains.kotlin.idea.caches.resolve.MultiModuleLineMarkerTestGenerated.testKotlinTestAnnotations, No line markers for test run,,
|
||||
org.jetbrains.kotlin.idea.codeInsight.InspectionTestGenerated.Inspections.testAndroidIllegalIdentifiers_inspectionData_Inspections_test, Unprocessed,,
|
||||
org.jetbrains.kotlin.idea.codeInsight.gradle.GradleFacetImportTest.testAndroidGradleJsDetection, NPE during import,,
|
||||
org.jetbrains.kotlin.idea.codeInsight.surroundWith.SurroundWithTestGenerated.If.MoveDeclarationsOut.Order.testTwoClasses,,, FLAKY
|
||||
org.jetbrains.kotlin.idea.codeInsight.surroundWith.SurroundWithTestGenerated.If.MoveDeclarationsOut.Order.testValAndClass,,, FLAKY
|
||||
org.jetbrains.kotlin.idea.codeInsight.surroundWith.SurroundWithTestGenerated.If.MoveDeclarationsOut.Order.testValOrder,,, FLAKY
|
||||
@@ -115,6 +113,7 @@ org.jetbrains.kotlin.idea.refactoring.pullUp.PullUpTestGenerated.K2K.testAcciden
|
||||
org.jetbrains.kotlin.idea.refactoring.move.MoveTestGenerated.testKotlin_moveTopLevelDeclarations_moveFunctionToPackage_MoveFunctionToPackage, fail on TeamCity but works well locally,, FLAKY
|
||||
org.jetbrains.kotlin.idea.intentions.IntentionTestGenerated.ConvertSealedClassToEnum.testInstancesOnly, Generated entries reordered,, FLAKY
|
||||
org.jetbrains.kotlin.idea.intentions.IntentionTestGenerated.ConvertSealedClassToEnum.testInstancesAndMembers, Enum reorder,, FLAKY
|
||||
org.jetbrains.kotlin.idea.navigation.GotoDeclarationTestGenerated.testImportAliasMultiDeclarations, showInBestPositionFor doesn't work in headless in 202,,
|
||||
org.jetbrains.kotlin.idea.scripting.gradle.GradleScriptListenerTest.testChangeInsideNonKtsFileInvalidatesOtherFiles, Unprocessed,,
|
||||
org.jetbrains.kotlin.idea.scripting.gradle.GradleScriptListenerTest.testTwoFilesChanged, Unprocessed,,
|
||||
org.jetbrains.kotlin.idea.scripting.gradle.GradleScriptListenerTest.testLoadedConfigurationWhenExternalFileChanged, Unprocessed,,
|
||||
|
@@ -6,6 +6,7 @@ org.jetbrains.kotlin.gradle.MultiplatformProjectImportingTest.testJsTestOutputFi
|
||||
org.jetbrains.kotlin.gradle.MultiplatformProjectImportingTest.testTransitiveImplementWithAndroid, KT-35225,,
|
||||
org.jetbrains.kotlin.gradle.MultiplatformProjectImportingTest.testTransitiveImplementWithNonDefaultConfig, Gradle Tests in 201,,
|
||||
org.jetbrains.kotlin.gradle.MultiplatformProjectImportingTest.testTransitiveImplement, Gradle Tests in 201,,
|
||||
"org.jetbrains.kotlin.gradle.NewMultiplatformProjectImportingTest.testDetectAndroidSources", Gradle Import Tests,,
|
||||
"org.jetbrains.kotlin.gradle.NewMultiplatformProjectImportingTest.testAndroidDependencyOnMPP", Gradle Import Tests,,
|
||||
"org.jetbrains.kotlin.gradle.NewMultiplatformProjectImportingTest.testDependencyOnRoot", Gradle Tests in 201,,
|
||||
"org.jetbrains.kotlin.gradle.NewMultiplatformProjectImportingTest.testImportBeforeBuild", Gradle Tests in 201,,
|
||||
@@ -15,6 +16,7 @@ org.jetbrains.kotlin.gradle.MultiplatformProjectImportingTest.testTransitiveImpl
|
||||
"org.jetbrains.kotlin.gradle.NewMultiplatformProjectImportingTest.testProjectDependency", Gradle Tests in 201,,
|
||||
org.jetbrains.kotlin.idea.caches.resolve.MultiModuleLineMarkerTestGenerated.testKotlinTestAnnotations, No line markers for test run,,
|
||||
org.jetbrains.kotlin.idea.codeInsight.InspectionTestGenerated.Inspections.testAndroidIllegalIdentifiers_inspectionData_Inspections_test, Unprocessed,,
|
||||
org.jetbrains.kotlin.idea.codeInsight.gradle.GradleFacetImportTest.testAndroidGradleJsDetection, NPE during import,,
|
||||
org.jetbrains.kotlin.idea.codeInsight.surroundWith.SurroundWithTestGenerated.If.MoveDeclarationsOut.Order.testTwoClasses,,, FLAKY
|
||||
org.jetbrains.kotlin.idea.codeInsight.surroundWith.SurroundWithTestGenerated.If.MoveDeclarationsOut.Order.testValAndClass,,, FLAKY
|
||||
org.jetbrains.kotlin.idea.codeInsight.surroundWith.SurroundWithTestGenerated.If.MoveDeclarationsOut.Order.testValOrder,,, FLAKY
|
||||
@@ -113,7 +115,6 @@ org.jetbrains.kotlin.idea.refactoring.pullUp.PullUpTestGenerated.K2K.testAcciden
|
||||
org.jetbrains.kotlin.idea.refactoring.move.MoveTestGenerated.testKotlin_moveTopLevelDeclarations_moveFunctionToPackage_MoveFunctionToPackage, fail on TeamCity but works well locally,, FLAKY
|
||||
org.jetbrains.kotlin.idea.intentions.IntentionTestGenerated.ConvertSealedClassToEnum.testInstancesOnly, Generated entries reordered,, FLAKY
|
||||
org.jetbrains.kotlin.idea.intentions.IntentionTestGenerated.ConvertSealedClassToEnum.testInstancesAndMembers, Enum reorder,, FLAKY
|
||||
org.jetbrains.kotlin.idea.navigation.GotoDeclarationTestGenerated.testImportAliasMultiDeclarations, showInBestPositionFor doesn't work in headless in 202,,
|
||||
org.jetbrains.kotlin.idea.scripting.gradle.GradleScriptListenerTest.testChangeInsideNonKtsFileInvalidatesOtherFiles, Unprocessed,,
|
||||
org.jetbrains.kotlin.idea.scripting.gradle.GradleScriptListenerTest.testTwoFilesChanged, Unprocessed,,
|
||||
org.jetbrains.kotlin.idea.scripting.gradle.GradleScriptListenerTest.testLoadedConfigurationWhenExternalFileChanged, Unprocessed,,
|
||||
Reference in New Issue
Block a user