~~~~ switch 203 ~~~~
This commit is contained in:
@@ -1,17 +1,6 @@
|
||||
/*
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.psi;
|
||||
@@ -70,15 +59,7 @@ public class KtElementImplStub<T extends StubElement<?>> extends StubBasedPsiEle
|
||||
PsiFile file = getContainingFile();
|
||||
if (!(file instanceof KtFile)) {
|
||||
// KtElementImpl.copy() might be the reason for this exception
|
||||
String fileString = "";
|
||||
if (file.isValid()) {
|
||||
try {
|
||||
fileString = " " + file.getText();
|
||||
}
|
||||
catch (Exception e) {
|
||||
// ignore when failed to get file text
|
||||
}
|
||||
}
|
||||
String fileString = file.isValid() ? (" " + file.getText()) : "";
|
||||
// getNode() will fail if getContainingFile() returns not PsiFileImpl instance
|
||||
String nodeString = (file instanceof PsiFileImpl ? (" node = " + getNode()) : "");
|
||||
|
||||
@@ -126,7 +107,7 @@ public class KtElementImplStub<T extends StubElement<?>> extends StubBasedPsiEle
|
||||
}
|
||||
|
||||
@NotNull
|
||||
protected <PsiT extends KtElementImplStub<?>, StubT extends StubElement> List<PsiT> getStubOrPsiChildrenAsList(
|
||||
protected <PsiT extends KtElementImplStub<?>, StubT extends StubElement<?>> List<PsiT> getStubOrPsiChildrenAsList(
|
||||
@NotNull KtStubElementType<StubT, PsiT> elementType
|
||||
) {
|
||||
return Arrays.asList(getStubOrPsiChildren(elementType, elementType.getArrayFactory()));
|
||||
|
||||
+23
-4
@@ -1,6 +1,17 @@
|
||||
/*
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.psi;
|
||||
@@ -59,7 +70,15 @@ public class KtElementImplStub<T extends StubElement<?>> extends StubBasedPsiEle
|
||||
PsiFile file = getContainingFile();
|
||||
if (!(file instanceof KtFile)) {
|
||||
// KtElementImpl.copy() might be the reason for this exception
|
||||
String fileString = file.isValid() ? (" " + file.getText()) : "";
|
||||
String fileString = "";
|
||||
if (file.isValid()) {
|
||||
try {
|
||||
fileString = " " + file.getText();
|
||||
}
|
||||
catch (Exception e) {
|
||||
// ignore when failed to get file text
|
||||
}
|
||||
}
|
||||
// getNode() will fail if getContainingFile() returns not PsiFileImpl instance
|
||||
String nodeString = (file instanceof PsiFileImpl ? (" node = " + getNode()) : "");
|
||||
|
||||
@@ -107,7 +126,7 @@ public class KtElementImplStub<T extends StubElement<?>> extends StubBasedPsiEle
|
||||
}
|
||||
|
||||
@NotNull
|
||||
protected <PsiT extends KtElementImplStub<?>, StubT extends StubElement<?>> List<PsiT> getStubOrPsiChildrenAsList(
|
||||
protected <PsiT extends KtElementImplStub<?>, StubT extends StubElement> List<PsiT> getStubOrPsiChildrenAsList(
|
||||
@NotNull KtStubElementType<StubT, PsiT> elementType
|
||||
) {
|
||||
return Arrays.asList(getStubOrPsiChildren(elementType, elementType.getArrayFactory()));
|
||||
+3
-14
@@ -1,17 +1,6 @@
|
||||
/*
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.psi.stubs.elements
|
||||
@@ -30,7 +19,7 @@ class KtAnnotationUseSiteTargetElementType(debugName: String) :
|
||||
debugName, KtAnnotationUseSiteTarget::class.java, KotlinAnnotationUseSiteTargetStub::class.java
|
||||
) {
|
||||
|
||||
override fun createStub(psi: KtAnnotationUseSiteTarget, parentStub: StubElement<PsiElement>): KotlinAnnotationUseSiteTargetStub {
|
||||
override fun createStub(psi: KtAnnotationUseSiteTarget, parentStub: StubElement<out PsiElement>): KotlinAnnotationUseSiteTargetStub {
|
||||
val useSiteTarget = psi.getAnnotationUseSiteTarget().name
|
||||
return KotlinAnnotationUseSiteTargetStubImpl(parentStub, StringRef.fromString(useSiteTarget)!!)
|
||||
}
|
||||
|
||||
+14
-3
@@ -1,6 +1,17 @@
|
||||
/*
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.psi.stubs.elements
|
||||
@@ -19,7 +30,7 @@ class KtAnnotationUseSiteTargetElementType(debugName: String) :
|
||||
debugName, KtAnnotationUseSiteTarget::class.java, KotlinAnnotationUseSiteTargetStub::class.java
|
||||
) {
|
||||
|
||||
override fun createStub(psi: KtAnnotationUseSiteTarget, parentStub: StubElement<out PsiElement>): KotlinAnnotationUseSiteTargetStub {
|
||||
override fun createStub(psi: KtAnnotationUseSiteTarget, parentStub: StubElement<PsiElement>): KotlinAnnotationUseSiteTargetStub {
|
||||
val useSiteTarget = psi.getAnnotationUseSiteTarget().name
|
||||
return KotlinAnnotationUseSiteTargetStubImpl(parentStub, StringRef.fromString(useSiteTarget)!!)
|
||||
}
|
||||
+2
-2
@@ -22,7 +22,7 @@ class KtContractEffectElementType(debugName: String, psiClass: Class<KtContractE
|
||||
return KotlinContractEffectStubImpl(parentStub, this)
|
||||
}
|
||||
|
||||
override fun createStub(psi: KtContractEffect, parentStub: StubElement<PsiElement>?): KotlinContractEffectStub {
|
||||
override fun createStub(psi: KtContractEffect, parentStub: StubElement<*>?): KotlinContractEffectStub {
|
||||
return KotlinContractEffectStubImpl(parentStub, this)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ class KtContractEffectElementType(debugName: String, psiClass: Class<KtContractE
|
||||
return KotlinContractEffectStubImpl(parentStub, this)
|
||||
}
|
||||
|
||||
override fun createStub(psi: KtContractEffect, parentStub: StubElement<*>?): KotlinContractEffectStub {
|
||||
override fun createStub(psi: KtContractEffect, parentStub: StubElement<PsiElement>?): KotlinContractEffectStub {
|
||||
return KotlinContractEffectStubImpl(parentStub, this)
|
||||
}
|
||||
}
|
||||
+4
-15
@@ -1,17 +1,6 @@
|
||||
/*
|
||||
* Copyright 2010-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.psi.stubs.elements
|
||||
@@ -27,7 +16,7 @@ import org.jetbrains.kotlin.psi.stubs.impl.KotlinImportAliasStubImpl
|
||||
|
||||
class KtImportAliasElementType(debugName: String) :
|
||||
KtStubElementType<KotlinImportAliasStub, KtImportAlias>(debugName, KtImportAlias::class.java, KotlinImportAliasStub::class.java) {
|
||||
override fun createStub(psi: KtImportAlias, parentStub: StubElement<PsiElement>?): KotlinImportAliasStub {
|
||||
override fun createStub(psi: KtImportAlias, parentStub: StubElement<out PsiElement>?): KotlinImportAliasStub {
|
||||
return KotlinImportAliasStubImpl(parentStub, StringRef.fromString(psi.name))
|
||||
}
|
||||
|
||||
@@ -39,4 +28,4 @@ class KtImportAliasElementType(debugName: String) :
|
||||
val name = dataStream.readName()
|
||||
return KotlinImportAliasStubImpl(parentStub, name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+14
-3
@@ -1,6 +1,17 @@
|
||||
/*
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
* Copyright 2010-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.psi.stubs.elements
|
||||
@@ -16,7 +27,7 @@ import org.jetbrains.kotlin.psi.stubs.impl.KotlinImportAliasStubImpl
|
||||
|
||||
class KtImportAliasElementType(debugName: String) :
|
||||
KtStubElementType<KotlinImportAliasStub, KtImportAlias>(debugName, KtImportAlias::class.java, KotlinImportAliasStub::class.java) {
|
||||
override fun createStub(psi: KtImportAlias, parentStub: StubElement<out PsiElement>?): KotlinImportAliasStub {
|
||||
override fun createStub(psi: KtImportAlias, parentStub: StubElement<PsiElement>?): KotlinImportAliasStub {
|
||||
return KotlinImportAliasStubImpl(parentStub, StringRef.fromString(psi.name))
|
||||
}
|
||||
|
||||
+3
-14
@@ -1,17 +1,6 @@
|
||||
/*
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.psi.stubs.elements;
|
||||
@@ -36,7 +25,7 @@ public class KtModifierListElementType<T extends KtModifierList> extends KtStubE
|
||||
}
|
||||
|
||||
@Override
|
||||
public KotlinModifierListStub createStub(@NotNull T psi, StubElement parentStub) {
|
||||
public KotlinModifierListStub createStub(@NotNull T psi, StubElement<?> parentStub) {
|
||||
return new KotlinModifierListStubImpl(parentStub, computeMaskFromModifierList(psi), this);
|
||||
}
|
||||
|
||||
|
||||
+14
-3
@@ -1,6 +1,17 @@
|
||||
/*
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.psi.stubs.elements;
|
||||
@@ -25,7 +36,7 @@ public class KtModifierListElementType<T extends KtModifierList> extends KtStubE
|
||||
}
|
||||
|
||||
@Override
|
||||
public KotlinModifierListStub createStub(@NotNull T psi, StubElement<?> parentStub) {
|
||||
public KotlinModifierListStub createStub(@NotNull T psi, StubElement parentStub) {
|
||||
return new KotlinModifierListStubImpl(parentStub, computeMaskFromModifierList(psi), this);
|
||||
}
|
||||
|
||||
+3
-14
@@ -1,17 +1,6 @@
|
||||
/*
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.psi.stubs.elements;
|
||||
@@ -34,7 +23,7 @@ public class KtPlaceHolderStubElementType<T extends KtElementImplStub<? extends
|
||||
}
|
||||
|
||||
@Override
|
||||
public KotlinPlaceHolderStub<T> createStub(@NotNull T psi, StubElement parentStub) {
|
||||
public KotlinPlaceHolderStub<T> createStub(@NotNull T psi, StubElement<?> parentStub) {
|
||||
return new KotlinPlaceHolderStubImpl<>(parentStub, this);
|
||||
}
|
||||
|
||||
|
||||
+14
-3
@@ -1,6 +1,17 @@
|
||||
/*
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.psi.stubs.elements;
|
||||
@@ -23,7 +34,7 @@ public class KtPlaceHolderStubElementType<T extends KtElementImplStub<? extends
|
||||
}
|
||||
|
||||
@Override
|
||||
public KotlinPlaceHolderStub<T> createStub(@NotNull T psi, StubElement<?> parentStub) {
|
||||
public KotlinPlaceHolderStub<T> createStub(@NotNull T psi, StubElement parentStub) {
|
||||
return new KotlinPlaceHolderStubImpl<>(parentStub, this);
|
||||
}
|
||||
|
||||
@@ -1,17 +1,6 @@
|
||||
/*
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.psi.stubs.elements
|
||||
@@ -30,7 +19,7 @@ class KtScriptElementType(debugName: String) : KtStubElementType<KotlinScriptStu
|
||||
debugName, KtScript::class.java, KotlinScriptStub::class.java
|
||||
) {
|
||||
|
||||
override fun createStub(psi: KtScript, parentStub: StubElement<PsiElement>): KotlinScriptStub {
|
||||
override fun createStub(psi: KtScript, parentStub: StubElement<out PsiElement>): KotlinScriptStub {
|
||||
return KotlinScriptStubImpl(parentStub, StringRef.fromString(psi.fqName.asString()))
|
||||
}
|
||||
|
||||
|
||||
+14
-3
@@ -1,6 +1,17 @@
|
||||
/*
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.psi.stubs.elements
|
||||
@@ -19,7 +30,7 @@ class KtScriptElementType(debugName: String) : KtStubElementType<KotlinScriptStu
|
||||
debugName, KtScript::class.java, KotlinScriptStub::class.java
|
||||
) {
|
||||
|
||||
override fun createStub(psi: KtScript, parentStub: StubElement<out PsiElement>): KotlinScriptStub {
|
||||
override fun createStub(psi: KtScript, parentStub: StubElement<PsiElement>): KotlinScriptStub {
|
||||
return KotlinScriptStubImpl(parentStub, StringRef.fromString(psi.fqName.asString()))
|
||||
}
|
||||
|
||||
@@ -1,17 +1,6 @@
|
||||
/*
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.psi.stubs.elements;
|
||||
@@ -36,7 +25,7 @@ import org.jetbrains.kotlin.psi.KtProperty;
|
||||
import java.lang.reflect.Array;
|
||||
import java.lang.reflect.Constructor;
|
||||
|
||||
public abstract class KtStubElementType<StubT extends StubElement, PsiT extends KtElementImplStub<?>> extends IStubElementType<StubT, PsiT> {
|
||||
public abstract class KtStubElementType<StubT extends StubElement<?>, PsiT extends KtElementImplStub<?>> extends IStubElementType<StubT, PsiT> {
|
||||
|
||||
@NotNull
|
||||
private final Constructor<PsiT> byNodeConstructor;
|
||||
|
||||
+14
-3
@@ -1,6 +1,17 @@
|
||||
/*
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.psi.stubs.elements;
|
||||
@@ -25,7 +36,7 @@ import org.jetbrains.kotlin.psi.KtProperty;
|
||||
import java.lang.reflect.Array;
|
||||
import java.lang.reflect.Constructor;
|
||||
|
||||
public abstract class KtStubElementType<StubT extends StubElement<?>, PsiT extends KtElementImplStub<?>> extends IStubElementType<StubT, PsiT> {
|
||||
public abstract class KtStubElementType<StubT extends StubElement, PsiT extends KtElementImplStub<?>> extends IStubElementType<StubT, PsiT> {
|
||||
|
||||
@NotNull
|
||||
private final Constructor<PsiT> byNodeConstructor;
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
@@ -16,7 +16,7 @@ import org.jetbrains.kotlin.psi.stubs.impl.KotlinValueArgumentStubImpl
|
||||
class KtValueArgumentElementType<T : KtValueArgument>(debugName: String, psiClass: Class<T>) :
|
||||
KtStubElementType<KotlinValueArgumentStub<T>, T>(debugName, psiClass, KotlinValueArgumentStub::class.java) {
|
||||
|
||||
override fun createStub(psi: T, parentStub: StubElement<PsiElement>?): KotlinValueArgumentStub<T> {
|
||||
override fun createStub(psi: T, parentStub: StubElement<out PsiElement>?): KotlinValueArgumentStub<T> {
|
||||
return KotlinValueArgumentStubImpl(parentStub, this, psi.isSpread)
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
@@ -16,7 +16,7 @@ import org.jetbrains.kotlin.psi.stubs.impl.KotlinValueArgumentStubImpl
|
||||
class KtValueArgumentElementType<T : KtValueArgument>(debugName: String, psiClass: Class<T>) :
|
||||
KtStubElementType<KotlinValueArgumentStub<T>, T>(debugName, psiClass, KotlinValueArgumentStub::class.java) {
|
||||
|
||||
override fun createStub(psi: T, parentStub: StubElement<out PsiElement>?): KotlinValueArgumentStub<T> {
|
||||
override fun createStub(psi: T, parentStub: StubElement<PsiElement>?): KotlinValueArgumentStub<T> {
|
||||
return KotlinValueArgumentStubImpl(parentStub, this, psi.isSpread)
|
||||
}
|
||||
|
||||
@@ -1,17 +1,6 @@
|
||||
/*
|
||||
* Copyright 2010-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.psi.stubs.impl
|
||||
@@ -24,7 +13,7 @@ import org.jetbrains.kotlin.psi.stubs.KotlinImportAliasStub
|
||||
import org.jetbrains.kotlin.psi.stubs.elements.KtStubElementTypes
|
||||
|
||||
class KotlinImportAliasStubImpl(
|
||||
parent: StubElement<PsiElement>?,
|
||||
parent: StubElement<out PsiElement>?,
|
||||
private val name: StringRef?
|
||||
) : KotlinStubBaseImpl<KtImportAlias>(parent, KtStubElementTypes.IMPORT_ALIAS), KotlinImportAliasStub {
|
||||
override fun getName(): String? = StringRef.toString(name)
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright 2010-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.psi.stubs.impl
|
||||
|
||||
import com.intellij.psi.PsiElement
|
||||
import com.intellij.psi.stubs.StubElement
|
||||
import com.intellij.util.io.StringRef
|
||||
import org.jetbrains.kotlin.psi.KtImportAlias
|
||||
import org.jetbrains.kotlin.psi.stubs.KotlinImportAliasStub
|
||||
import org.jetbrains.kotlin.psi.stubs.elements.KtStubElementTypes
|
||||
|
||||
class KotlinImportAliasStubImpl(
|
||||
parent: StubElement<PsiElement>?,
|
||||
private val name: StringRef?
|
||||
) : KotlinStubBaseImpl<KtImportAlias>(parent, KtStubElementTypes.IMPORT_ALIAS), KotlinImportAliasStub {
|
||||
override fun getName(): String? = StringRef.toString(name)
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.psi.stubs.impl
|
||||
|
||||
import com.intellij.psi.PsiElement
|
||||
import com.intellij.psi.stubs.StubElement
|
||||
import com.intellij.util.io.StringRef
|
||||
import org.jetbrains.kotlin.psi.KtImportAlias
|
||||
import org.jetbrains.kotlin.psi.stubs.KotlinImportAliasStub
|
||||
import org.jetbrains.kotlin.psi.stubs.elements.KtStubElementTypes
|
||||
|
||||
class KotlinImportAliasStubImpl(
|
||||
parent: StubElement<out PsiElement>?,
|
||||
private val name: StringRef?
|
||||
) : KotlinStubBaseImpl<KtImportAlias>(parent, KtStubElementTypes.IMPORT_ALIAS), KotlinImportAliasStub {
|
||||
override fun getName(): String? = StringRef.toString(name)
|
||||
}
|
||||
+6
-16
@@ -1,17 +1,6 @@
|
||||
/*
|
||||
* Copyright 2010-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.test.testFramework;
|
||||
@@ -19,14 +8,15 @@ package org.jetbrains.kotlin.test.testFramework;
|
||||
import com.intellij.codeInsight.CodeInsightSettings;
|
||||
import com.intellij.concurrency.IdeaForkJoinWorkerThreadFactory;
|
||||
import com.intellij.diagnostic.PerformanceWatcher;
|
||||
import com.intellij.ide.highlighter.JavaFileType;
|
||||
import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.application.Application;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.application.PathManager;
|
||||
import com.intellij.openapi.application.impl.ApplicationInfoImpl;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.fileTypes.StdFileTypes;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.openapi.util.JDOMUtil;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
@@ -319,7 +309,7 @@ public abstract class KtUsefulTestCase extends TestCase {
|
||||
}
|
||||
})
|
||||
.append(() -> {
|
||||
currentCodeStyleSettings.getIndentOptions(JavaFileType.INSTANCE);
|
||||
currentCodeStyleSettings.getIndentOptions(StdFileTypes.JAVA);
|
||||
try {
|
||||
checkCodeStyleSettingsEqual(oldCodeStyleSettings, currentCodeStyleSettings);
|
||||
}
|
||||
@@ -869,7 +859,7 @@ public abstract class KtUsefulTestCase extends TestCase {
|
||||
}
|
||||
String expected = StringUtil.convertLineSeparators(trimBeforeComparing ? fileText.trim() : fileText);
|
||||
String actual = StringUtil.convertLineSeparators(trimBeforeComparing ? actualText.trim() : actualText);
|
||||
if (!Objects.equals(expected, actual)) {
|
||||
if (!Comparing.equal(expected, actual)) {
|
||||
throw new FileComparisonFailure(messageProducer == null ? null : messageProducer.get(), expected, actual, filePath);
|
||||
}
|
||||
}
|
||||
|
||||
+18
-8
@@ -1,6 +1,17 @@
|
||||
/*
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
* Copyright 2010-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.test.testFramework;
|
||||
@@ -8,15 +19,14 @@ package org.jetbrains.kotlin.test.testFramework;
|
||||
import com.intellij.codeInsight.CodeInsightSettings;
|
||||
import com.intellij.concurrency.IdeaForkJoinWorkerThreadFactory;
|
||||
import com.intellij.diagnostic.PerformanceWatcher;
|
||||
import com.intellij.ide.highlighter.JavaFileType;
|
||||
import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.application.Application;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.application.PathManager;
|
||||
import com.intellij.openapi.application.impl.ApplicationInfoImpl;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.fileTypes.StdFileTypes;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.openapi.util.IconLoader;
|
||||
import com.intellij.openapi.util.JDOMUtil;
|
||||
@@ -337,7 +347,7 @@ public abstract class KtUsefulTestCase extends TestCase {
|
||||
}
|
||||
})
|
||||
.append(() -> {
|
||||
currentCodeStyleSettings.getIndentOptions(StdFileTypes.JAVA);
|
||||
currentCodeStyleSettings.getIndentOptions(JavaFileType.INSTANCE);
|
||||
try {
|
||||
checkCodeStyleSettingsEqual(oldCodeStyleSettings, currentCodeStyleSettings);
|
||||
}
|
||||
@@ -491,7 +501,7 @@ public abstract class KtUsefulTestCase extends TestCase {
|
||||
/**
|
||||
* If you want a more shorter name than runInEdtAndWait.
|
||||
*/
|
||||
protected void edt(@NotNull ThrowableRunnable<Throwable> runnable) throws Throwable {
|
||||
protected void edt(@NotNull ThrowableRunnable<Throwable> runnable) {
|
||||
EdtTestUtil.runInEdtAndWait(runnable);
|
||||
}
|
||||
|
||||
@@ -901,7 +911,7 @@ public abstract class KtUsefulTestCase extends TestCase {
|
||||
}
|
||||
String expected = StringUtil.convertLineSeparators(trimBeforeComparing ? fileText.trim() : fileText);
|
||||
String actual = StringUtil.convertLineSeparators(trimBeforeComparing ? actualText.trim() : actualText);
|
||||
if (!Comparing.equal(expected, actual)) {
|
||||
if (!Objects.equals(expected, actual)) {
|
||||
throw new FileComparisonFailure(messageProducer == null ? null : messageProducer.get(), expected, actual, filePath);
|
||||
}
|
||||
}
|
||||
@@ -1134,7 +1144,7 @@ public abstract class KtUsefulTestCase extends TestCase {
|
||||
return UIUtil.invokeAndWaitIfNeeded(() -> LocalFileSystem.getInstance().refreshAndFindFileByIoFile(file));
|
||||
}
|
||||
|
||||
public static void waitForAppLeakingThreads(long timeout, @NotNull TimeUnit timeUnit) throws Exception {
|
||||
public static void waitForAppLeakingThreads(long timeout, @NotNull TimeUnit timeUnit) {
|
||||
EdtTestUtil.runInEdtAndWait(() -> {
|
||||
Application app = ApplicationManager.getApplication();
|
||||
if (app != null && !app.isDisposed()) {
|
||||
@@ -1,9 +1,9 @@
|
||||
versions.intellijSdk=202.7660.26
|
||||
versions.intellijSdk=203.6682.168
|
||||
versions.intellijSdk.forIde.202=202.7660.26
|
||||
versions.intellijSdk.forIde.203=203.6682.168
|
||||
versions.intellijSdk.forIde.211=211.7442.40
|
||||
versions.idea.NodeJS=193.6494.7
|
||||
versions.jar.asm-all=8.0.1
|
||||
versions.jar.asm-all=9.0
|
||||
versions.jar.guava=29.0-jre
|
||||
versions.jar.groovy=2.5.11
|
||||
versions.jar.groovy-xml=2.5.11
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
versions.intellijSdk=203.6682.168
|
||||
versions.intellijSdk=202.7660.26
|
||||
versions.intellijSdk.forIde.202=202.7660.26
|
||||
versions.intellijSdk.forIde.203=203.6682.168
|
||||
versions.intellijSdk.forIde.211=211.7442.40
|
||||
versions.idea.NodeJS=193.6494.7
|
||||
versions.jar.asm-all=9.0
|
||||
versions.jar.asm-all=8.0.1
|
||||
versions.jar.guava=29.0-jre
|
||||
versions.jar.groovy=2.5.11
|
||||
versions.jar.groovy-xml=2.5.11
|
||||
Reference in New Issue
Block a user