Move incremental components to :core:descriptors.common module
This commit is contained in:
-30
@@ -1,30 +0,0 @@
|
||||
/*
|
||||
* 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.incremental.components
|
||||
|
||||
import org.jetbrains.kotlin.container.DefaultImplementation
|
||||
import java.io.File
|
||||
|
||||
@DefaultImplementation(ExpectActualTracker.DoNothing::class)
|
||||
interface ExpectActualTracker {
|
||||
fun report(expectedFile: File, actualFile: File)
|
||||
|
||||
object DoNothing : ExpectActualTracker {
|
||||
override fun report(expectedFile: File, actualFile: File) {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
/*
|
||||
* 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.incremental.components
|
||||
|
||||
import java.io.Serializable
|
||||
|
||||
interface LookupLocation {
|
||||
val location: LocationInfo?
|
||||
}
|
||||
|
||||
interface LocationInfo {
|
||||
val filePath: String
|
||||
|
||||
// only for tests
|
||||
val position: Position
|
||||
}
|
||||
|
||||
data class Position(val line: Int, val column: Int) : Serializable {
|
||||
companion object {
|
||||
val NO_POSITION = Position(-1, -1)
|
||||
}
|
||||
}
|
||||
|
||||
enum class NoLookupLocation : LookupLocation {
|
||||
FROM_IDE,
|
||||
FROM_BACKEND,
|
||||
FROM_TEST,
|
||||
FROM_BUILTINS,
|
||||
WHEN_CHECK_DECLARATION_CONFLICTS,
|
||||
WHEN_CHECK_OVERRIDES,
|
||||
FOR_SCRIPT,
|
||||
FROM_REFLECTION,
|
||||
WHEN_RESOLVE_DECLARATION,
|
||||
WHEN_GET_DECLARATION_SCOPE,
|
||||
WHEN_RESOLVING_DEFAULT_TYPE_ARGUMENTS,
|
||||
FOR_ALREADY_TRACKED,
|
||||
// TODO replace with real location (e.g. FROM_IDE) where it possible
|
||||
WHEN_GET_ALL_DESCRIPTORS,
|
||||
WHEN_TYPING,
|
||||
WHEN_GET_SUPER_MEMBERS,
|
||||
FOR_NON_TRACKED_SCOPE,
|
||||
FROM_SYNTHETIC_SCOPE,
|
||||
FROM_DESERIALIZATION,
|
||||
FROM_JAVA_LOADER,
|
||||
WHEN_GET_LOCAL_VARIABLE,
|
||||
WHEN_FIND_BY_FQNAME,
|
||||
WHEN_GET_COMPANION_OBJECT,
|
||||
FOR_DEFAULT_IMPORTS;
|
||||
|
||||
override val location: LocationInfo? get() = null
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
/*
|
||||
* 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.incremental.components
|
||||
|
||||
import org.jetbrains.kotlin.container.DefaultImplementation
|
||||
import java.io.Serializable
|
||||
|
||||
@DefaultImplementation(LookupTracker.DO_NOTHING::class)
|
||||
interface LookupTracker {
|
||||
// used in tests for more accurate checks
|
||||
val requiresPosition: Boolean
|
||||
|
||||
fun record(
|
||||
filePath: String,
|
||||
position: Position,
|
||||
scopeFqName: String,
|
||||
scopeKind: ScopeKind,
|
||||
name: String
|
||||
)
|
||||
|
||||
object DO_NOTHING : LookupTracker {
|
||||
override val requiresPosition: Boolean
|
||||
get() = false
|
||||
|
||||
override fun record(filePath: String, position: Position, scopeFqName: String, scopeKind: ScopeKind, name: String) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
enum class ScopeKind {
|
||||
PACKAGE,
|
||||
CLASSIFIER
|
||||
}
|
||||
|
||||
data class LookupInfo(
|
||||
val filePath: String,
|
||||
val position: Position,
|
||||
val scopeFqName: String,
|
||||
val scopeKind: ScopeKind,
|
||||
val name: String
|
||||
) : Serializable
|
||||
Reference in New Issue
Block a user