Move scripting-compiler-impl definition to another package...

to continue merging with the refactoring with further scripting improvements
This commit is contained in:
Ilya Chernikov
2019-04-11 17:49:47 +02:00
parent f71cc4e480
commit 8df829a7cd
41 changed files with 58 additions and 53 deletions
@@ -3,7 +3,7 @@
* that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.scripting.shared.definitions
package org.jetbrains.kotlin.scripting.definitions
import com.intellij.openapi.fileTypes.LanguageFileType
import org.jetbrains.kotlin.idea.KotlinFileType
@@ -3,7 +3,7 @@
* that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.scripting.shared.definitions
package org.jetbrains.kotlin.scripting.definitions
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity
import org.jetbrains.kotlin.cli.common.messages.MessageCollector
@@ -3,7 +3,7 @@
* that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.scripting.shared.definitions
package org.jetbrains.kotlin.scripting.definitions
import com.intellij.ide.highlighter.JavaFileType
import org.jetbrains.kotlin.idea.KotlinFileType
@@ -3,7 +3,7 @@
* that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.scripting.shared.definitions
package org.jetbrains.kotlin.scripting.definitions
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity
import org.jetbrains.kotlin.cli.common.messages.MessageCollector
@@ -62,7 +62,9 @@ fun discoverScriptTemplatesInClasspath(
if (jar.getJarEntry(SCRIPT_DEFINITION_MARKERS_PATH) != null) {
val definitionNames = jar.entries().asSequence().mapNotNull {
if (it.isDirectory || !it.name.startsWith(SCRIPT_DEFINITION_MARKERS_PATH)) null
else it.name.removePrefix(SCRIPT_DEFINITION_MARKERS_PATH).removeSuffix(SCRIPT_DEFINITION_MARKERS_EXTENSION_WITH_DOT)
else it.name.removePrefix(SCRIPT_DEFINITION_MARKERS_PATH).removeSuffix(
SCRIPT_DEFINITION_MARKERS_EXTENSION_WITH_DOT
)
}.toList()
val (loadedDefinitions, notFoundClasses) =
definitionNames.partitionLoadJarDefinitions(jar, loader, scriptResolverEnv, messageCollector)
@@ -3,7 +3,7 @@
* that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.scripting.shared.definitions
package org.jetbrains.kotlin.scripting.definitions
import org.jetbrains.org.objectweb.asm.*
@@ -3,7 +3,7 @@
* that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.scripting.shared.definitions
package org.jetbrains.kotlin.scripting.definitions
import com.intellij.ide.highlighter.JavaClassFileType
import com.intellij.openapi.fileTypes.FileTypeRegistry
@@ -3,7 +3,7 @@
* that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.scripting.shared.extensions
package org.jetbrains.kotlin.scripting.extensions
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.psi.KtFile
@@ -3,7 +3,7 @@
* that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.scripting.shared.extensions
package org.jetbrains.kotlin.scripting.extensions
import org.jetbrains.kotlin.descriptors.ClassDescriptor
import org.jetbrains.kotlin.descriptors.PackageFragmentDescriptor
@@ -12,7 +12,7 @@ import org.jetbrains.kotlin.resolve.extensions.SyntheticResolveExtension
import org.jetbrains.kotlin.resolve.lazy.LazyClassContext
import org.jetbrains.kotlin.resolve.lazy.ResolveSession
import org.jetbrains.kotlin.resolve.lazy.declarations.PackageMemberDeclarationProvider
import org.jetbrains.kotlin.scripting.shared.resolve.LazyScriptDescriptor
import org.jetbrains.kotlin.scripting.resolve.LazyScriptDescriptor
class ScriptingResolveExtension : SyntheticResolveExtension {
override fun generateSyntheticClasses(
@@ -3,6 +3,6 @@
* that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.scripting.shared
package org.jetbrains.kotlin.scripting
const val KOTLIN_SCRIPTING_PLUGIN_ID = "kotlin.scripting"
@@ -3,7 +3,7 @@
* that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.scripting.shared.resolve
package org.jetbrains.kotlin.scripting.resolve
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.descriptors.annotations.Annotations
@@ -3,7 +3,7 @@
* that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.scripting.shared.resolve
package org.jetbrains.kotlin.scripting.resolve
import com.intellij.openapi.vfs.StandardFileSystems
import com.intellij.openapi.vfs.VirtualFileManager
@@ -36,7 +36,7 @@ import org.jetbrains.kotlin.resolve.source.toSourceElement
import org.jetbrains.kotlin.script.KotlinScriptDefinition
import org.jetbrains.kotlin.script.ScriptDependenciesProvider
import org.jetbrains.kotlin.script.ScriptPriorities
import org.jetbrains.kotlin.scripting.shared.definitions.scriptDefinitionByFileName
import org.jetbrains.kotlin.scripting.definitions.scriptDefinitionByFileName
import org.jetbrains.kotlin.types.TypeSubstitutor
import org.jetbrains.kotlin.types.typeUtil.isNothing
import org.jetbrains.kotlin.types.typeUtil.isUnit
@@ -105,7 +105,10 @@ class LazyScriptDescriptor(
override fun getPriority() = priority
val scriptDefinition: () -> KotlinScriptDefinition = resolveSession.storageManager.createLazyValue {
scriptDefinitionByFileName(resolveSession.project, scriptInfo.script.containingKtFile.name)
scriptDefinitionByFileName(
resolveSession.project,
scriptInfo.script.containingKtFile.name
)
}
override fun substitute(substitutor: TypeSubstitutor) = this
@@ -3,7 +3,7 @@
* that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.scripting.shared.resolve
package org.jetbrains.kotlin.scripting.resolve
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.descriptors.annotations.Annotations
@@ -3,7 +3,7 @@
* that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.scripting.shared.resolve
package org.jetbrains.kotlin.scripting.resolve
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.descriptors.impl.MutableClassDescriptor
@@ -3,7 +3,7 @@
* that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.scripting.shared.resolve
package org.jetbrains.kotlin.scripting.resolve
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.descriptors.annotations.Annotations
@@ -5,7 +5,7 @@
@file:Suppress("DEPRECATION")
package org.jetbrains.kotlin.scripting.shared.resolve
package org.jetbrains.kotlin.scripting.resolve
import org.jetbrains.kotlin.script.DependencyResolverWrapper
import java.io.File
@@ -3,7 +3,7 @@
* that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.scripting.shared.resolve
package org.jetbrains.kotlin.scripting.resolve
import org.jetbrains.kotlin.name.ClassId
import org.jetbrains.kotlin.name.FqName