mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
continue v8 scriptParsed event, kotlin beta 3 compatibility
This commit is contained in:
@@ -329,9 +329,7 @@ open class StateStorageManagerImpl(private val rootTagName: String,
|
||||
return normalizeFileSpec(result)
|
||||
}
|
||||
|
||||
override fun startExternalization() = StateStorageManagerExternalizationSession(this)
|
||||
|
||||
private class StateStorageManagerExternalizationSession(private val storageManager: StateStorageManagerImpl) : StateStorageManager.ExternalizationSession {
|
||||
override final fun startExternalization() = object : StateStorageManager.ExternalizationSession {
|
||||
private val sessions = LinkedHashMap<StateStorage, StateStorage.ExternalizationSession>()
|
||||
|
||||
override fun setState(storageSpecs: Array<Storage>, component: Any, componentName: String, state: Any) {
|
||||
@@ -342,12 +340,12 @@ open class StateStorageManagerImpl(private val rootTagName: String,
|
||||
continue
|
||||
}
|
||||
|
||||
getExternalizationSession(storageManager.getStateStorage(storageSpec))?.setState(component, componentName, if (storageSpec.deprecated || resolution == Resolution.CLEAR) Element("empty") else state)
|
||||
getExternalizationSession(getStateStorage(storageSpec))?.setState(component, componentName, if (storageSpec.deprecated || resolution == Resolution.CLEAR) Element("empty") else state)
|
||||
}
|
||||
}
|
||||
|
||||
override fun setStateInOldStorage(component: Any, componentName: String, state: Any) {
|
||||
storageManager.getOldStorage(component, componentName, StateStorageOperation.WRITE)?.let {
|
||||
getOldStorage(component, componentName, StateStorageOperation.WRITE)?.let {
|
||||
getExternalizationSession(it)?.setState(component, componentName, state)
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -230,7 +230,7 @@ abstract class LineBreakpointManager(private val debugProcess: DebugProcessImpl<
|
||||
if (runToLocationBreakpoints.isEmpty) {
|
||||
return@clearRunToLocationBreakpoints
|
||||
}
|
||||
var breakpoints = runToLocationBreakpoints.toArray<Breakpoint>(arrayOfNulls<Breakpoint>(runToLocationBreakpoints.size()))
|
||||
var breakpoints = runToLocationBreakpoints.toArray<Breakpoint>(arrayOfNulls<Breakpoint>(runToLocationBreakpoints.size))
|
||||
runToLocationBreakpoints.clear()
|
||||
breakpoints
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@ import com.intellij.openapi.util.text.StringUtil
|
||||
import com.intellij.pom.Navigatable
|
||||
import com.intellij.psi.PsiElement
|
||||
import com.intellij.psi.PsiReference
|
||||
import com.intellij.util.Consumer
|
||||
import com.intellij.util.SmartList
|
||||
import com.intellij.util.ThreeState
|
||||
import com.intellij.xdebugger.XSourcePositionWrapper
|
||||
@@ -304,11 +303,11 @@ class VariableView(name: String, private val variable: Variable, private val con
|
||||
|
||||
override fun setValue(expression: String, callback: XValueModifier.XModificationCallback) {
|
||||
variable.valueModifier!!.setValue(variable, expression, evaluateContext)
|
||||
.done(Consumer<Any?> {
|
||||
.done {
|
||||
value = null
|
||||
callback.valueModified()
|
||||
})
|
||||
.rejected(createErrorMessageConsumer(callback))
|
||||
}
|
||||
.rejected { callback.errorOccurred(it.message!!) }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -400,7 +399,7 @@ class VariableView(name: String, private val variable: Variable, private val con
|
||||
callback.evaluated(value.valueString!!)
|
||||
}
|
||||
}
|
||||
.rejected(createErrorMessageConsumer(callback))
|
||||
.rejected { callback.errorOccurred(it.message!!) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -470,14 +469,6 @@ private fun createNumberPresentation(value: String): XValuePresentation {
|
||||
return if (value == PrimitiveValue.NA_N_VALUE || value == PrimitiveValue.INFINITY_VALUE) XKeywordValuePresentation(value) else XNumericValuePresentation(value)
|
||||
}
|
||||
|
||||
private fun createErrorMessageConsumer(callback: XValueCallback): Consumer<Throwable> {
|
||||
return object : Consumer<Throwable> {
|
||||
override fun consume(error: Throwable) {
|
||||
callback.errorOccurred(error.message!!)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private val ARRAY_DESCRIPTION_PATTERN = Pattern.compile("^[a-zA-Z\\d]+\\[\\d+\\]$")
|
||||
|
||||
private class ArrayPresentation(length: Int, className: String?) : XValuePresentation() {
|
||||
|
||||
+1
-1
@@ -64,7 +64,7 @@ abstract class RemoteVmConnection : VmConnection<Vm>() {
|
||||
if (it !is ConnectException) {
|
||||
Promise.logError(LOG, it)
|
||||
}
|
||||
setState(ConnectionStatus.CONNECTION_FAILED, it.getMessage())
|
||||
setState(ConnectionStatus.CONNECTION_FAILED, it.message)
|
||||
}
|
||||
.processed { connectCancelHandler.set(null) }
|
||||
|
||||
|
||||
+1
-1
@@ -80,7 +80,7 @@ class CallFrameView @JvmOverloads constructor(val callFrame: CallFrame,
|
||||
val textAttributes = if (isInLibraryContent) SimpleTextAttributes.GRAYED_ATTRIBUTES else SimpleTextAttributes.REGULAR_ATTRIBUTES
|
||||
|
||||
val functionName = sourceInfo.functionName
|
||||
if (functionName == null || (functionName.isEmpty() && callFrame.hasOnlyGlobalScope())) {
|
||||
if (functionName == null || (functionName.isEmpty() && callFrame.hasOnlyGlobalScope)) {
|
||||
if (fileName.startsWith("index.")) {
|
||||
sourceInfo.file.parent?.let {
|
||||
component.append("${it.name}/", textAttributes)
|
||||
|
||||
+2
-1
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package org.jetbrains.debugger.frame
|
||||
|
||||
import com.intellij.xdebugger.frame.XExecutionStack
|
||||
import com.intellij.xdebugger.frame.XSuspendContext
|
||||
import org.jetbrains.concurrency.Promise
|
||||
import org.jetbrains.concurrency.rejectedPromise
|
||||
@@ -26,7 +27,7 @@ import org.jetbrains.debugger.values.StringValue
|
||||
open class SuspendContextImpl(suspendContext: SuspendContext<out CallFrame>, debugProcess: DebuggerViewSupport, topFrameScript: Script?, topFrameSourceInfo: SourceInfo? = null) : XSuspendContext() {
|
||||
private val executionStack = ExecutionStackImpl(suspendContext, debugProcess, topFrameScript, topFrameSourceInfo)
|
||||
|
||||
override fun getActiveExecutionStack() = executionStack
|
||||
override final fun getActiveExecutionStack(): XExecutionStack = executionStack
|
||||
|
||||
fun evaluateExpression(expression: String): Promise<String> {
|
||||
val frame = executionStack.topFrame ?: return rejectedPromise("Top frame is null")
|
||||
|
||||
+433
@@ -0,0 +1,433 @@
|
||||
// Generated source
|
||||
package org.jetbrains.jsonProtocol
|
||||
|
||||
import org.jetbrains.jsonProtocol.*
|
||||
|
||||
import org.jetbrains.io.JsonReaderEx
|
||||
|
||||
import org.jetbrains.jsonProtocol.JsonReaders.*
|
||||
|
||||
internal class ProtocolSchemaReaderImpl : org.jetbrains.jsonProtocol.ProtocolSchemaReader {
|
||||
override fun parseRoot(reader: org.jetbrains.io.JsonReaderEx): ProtocolMetaModel.Root = M0(reader, null)
|
||||
|
||||
private class M0(reader: JsonReaderEx, preReadName: String?) : org.jetbrains.jsonProtocol.ProtocolMetaModel.Root {
|
||||
private var _domains: List<org.jetbrains.jsonProtocol.ProtocolMetaModel.Domain>? = null
|
||||
private var _version: org.jetbrains.jsonProtocol.ProtocolMetaModel.Version? = null
|
||||
|
||||
init {
|
||||
var name = preReadName
|
||||
if (name == null && reader.hasNext() && reader.beginObject().hasNext()) {
|
||||
name = reader.nextName()
|
||||
}
|
||||
|
||||
loop@ while (name != null) {
|
||||
when (name) {
|
||||
"domains" -> _domains = readObjectArray(reader, FM2())
|
||||
"version" -> _version = M1(reader, null)
|
||||
else -> reader.skipValue()
|
||||
}
|
||||
name = reader.nextNameOrNull()
|
||||
}
|
||||
|
||||
reader.endObject()
|
||||
}
|
||||
|
||||
override fun domains() = _domains!!
|
||||
|
||||
override fun version() = _version
|
||||
|
||||
override fun equals(other: Any?): Boolean = other is M0 && _domains == other._domains && _version == other._version
|
||||
}
|
||||
|
||||
private class M1(reader: JsonReaderEx, preReadName: String?) : org.jetbrains.jsonProtocol.ProtocolMetaModel.Version {
|
||||
private var _major: String? = null
|
||||
private var _minor: String? = null
|
||||
|
||||
init {
|
||||
var name = preReadName
|
||||
if (name == null && reader.hasNext() && reader.beginObject().hasNext()) {
|
||||
name = reader.nextName()
|
||||
}
|
||||
|
||||
loop@ while (name != null) {
|
||||
when (name) {
|
||||
"major" -> _major = reader.nextString()
|
||||
"minor" -> _minor = reader.nextString()
|
||||
else -> reader.skipValue()
|
||||
}
|
||||
name = reader.nextNameOrNull()
|
||||
}
|
||||
|
||||
reader.endObject()
|
||||
}
|
||||
|
||||
override fun major() = _major!!
|
||||
|
||||
override fun minor() = _minor!!
|
||||
|
||||
override fun equals(other: Any?): Boolean = other is M1 && _major == other._major && _minor == other._minor
|
||||
}
|
||||
|
||||
private class M2(reader: JsonReaderEx, preReadName: String?) : org.jetbrains.jsonProtocol.ProtocolMetaModel.Domain {
|
||||
private var _commands: List<org.jetbrains.jsonProtocol.ProtocolMetaModel.Command>? = null
|
||||
private var _description: String? = null
|
||||
private var _domain: String? = null
|
||||
private var _events: List<org.jetbrains.jsonProtocol.ProtocolMetaModel.Event>? = null
|
||||
private var _hidden = false
|
||||
private var _types: List<org.jetbrains.jsonProtocol.ProtocolMetaModel.StandaloneType>? = null
|
||||
|
||||
init {
|
||||
var name = preReadName
|
||||
if (name == null && reader.hasNext() && reader.beginObject().hasNext()) {
|
||||
name = reader.nextName()
|
||||
}
|
||||
|
||||
loop@ while (name != null) {
|
||||
when (name) {
|
||||
"commands" -> _commands = readObjectArray(reader, FM3())
|
||||
"description" -> _description = reader.nextNullableString()
|
||||
"domain" -> _domain = reader.nextString()
|
||||
"events" -> _events = readObjectArray(reader, FM5())
|
||||
"hidden" -> _hidden = reader.nextBoolean()
|
||||
"types" -> _types = readObjectArray(reader, FM6())
|
||||
else -> reader.skipValue()
|
||||
}
|
||||
name = reader.nextNameOrNull()
|
||||
}
|
||||
|
||||
reader.endObject()
|
||||
}
|
||||
|
||||
override fun commands() = _commands!!
|
||||
|
||||
override fun description() = _description
|
||||
|
||||
override fun domain() = _domain!!
|
||||
|
||||
override fun events() = _events
|
||||
|
||||
override fun hidden() = _hidden
|
||||
|
||||
override fun types() = _types
|
||||
|
||||
override fun equals(other: Any?): Boolean = other is M2 && _hidden == other._hidden && _description == other._description && _domain == other._domain && _commands == other._commands && _events == other._events && _types == other._types
|
||||
}
|
||||
|
||||
private class M3(reader: JsonReaderEx, preReadName: String?) : org.jetbrains.jsonProtocol.ProtocolMetaModel.Command {
|
||||
private var _async = false
|
||||
private var _description: String? = null
|
||||
private var _hidden = false
|
||||
private var _name: String? = null
|
||||
private var _parameters: List<org.jetbrains.jsonProtocol.ProtocolMetaModel.Parameter>? = null
|
||||
private var _returns: List<org.jetbrains.jsonProtocol.ProtocolMetaModel.Parameter>? = null
|
||||
|
||||
init {
|
||||
var name = preReadName
|
||||
if (name == null && reader.hasNext() && reader.beginObject().hasNext()) {
|
||||
name = reader.nextName()
|
||||
}
|
||||
|
||||
loop@ while (name != null) {
|
||||
when (name) {
|
||||
"async" -> _async = reader.nextBoolean()
|
||||
"description" -> _description = reader.nextNullableString()
|
||||
"hidden" -> _hidden = reader.nextBoolean()
|
||||
"name" -> _name = reader.nextString()
|
||||
"parameters" -> _parameters = readObjectArray(reader, FM4())
|
||||
"returns" -> _returns = readObjectArray(reader, FM4())
|
||||
else -> reader.skipValue()
|
||||
}
|
||||
name = reader.nextNameOrNull()
|
||||
}
|
||||
|
||||
reader.endObject()
|
||||
}
|
||||
|
||||
override fun async() = _async
|
||||
|
||||
override fun description() = _description
|
||||
|
||||
override fun hidden() = _hidden
|
||||
|
||||
override fun name() = _name!!
|
||||
|
||||
override fun parameters() = _parameters
|
||||
|
||||
override fun returns() = _returns
|
||||
|
||||
override fun equals(other: Any?): Boolean = other is M3 && _async == other._async && _hidden == other._hidden && _description == other._description && _name == other._name && _parameters == other._parameters && _returns == other._returns
|
||||
}
|
||||
|
||||
private class M4(reader: JsonReaderEx, preReadName: String?) : org.jetbrains.jsonProtocol.ProtocolMetaModel.Parameter {
|
||||
private var _description: String? = null
|
||||
private var _getEnum: List<String>? = null
|
||||
private var _hidden = false
|
||||
private var _items: org.jetbrains.jsonProtocol.ProtocolMetaModel.ArrayItemType? = null
|
||||
private var _name: String? = null
|
||||
private var _optional = false
|
||||
private var _ref: String? = null
|
||||
private var _shortName: String? = null
|
||||
private var _type: String? = null
|
||||
|
||||
init {
|
||||
var name = preReadName
|
||||
if (name == null && reader.hasNext() && reader.beginObject().hasNext()) {
|
||||
name = reader.nextName()
|
||||
}
|
||||
|
||||
loop@ while (name != null) {
|
||||
when (name) {
|
||||
"description" -> _description = reader.nextNullableString()
|
||||
"enum" -> _getEnum = nextList(reader)
|
||||
"hidden" -> _hidden = reader.nextBoolean()
|
||||
"items" -> _items = M7(reader, null)
|
||||
"name" -> _name = reader.nextString()
|
||||
"optional" -> _optional = reader.nextBoolean()
|
||||
"\$ref" -> _ref = reader.nextNullableString()
|
||||
"shortName" -> _shortName = reader.nextNullableString()
|
||||
"type" -> _type = reader.nextNullableString()
|
||||
else -> reader.skipValue()
|
||||
}
|
||||
name = reader.nextNameOrNull()
|
||||
}
|
||||
|
||||
reader.endObject()
|
||||
}
|
||||
|
||||
override fun description() = _description
|
||||
|
||||
override fun getEnum() = _getEnum
|
||||
|
||||
override fun hidden() = _hidden
|
||||
|
||||
override fun items() = _items
|
||||
|
||||
override fun name() = _name!!
|
||||
|
||||
override fun optional() = _optional
|
||||
|
||||
override fun ref() = _ref
|
||||
|
||||
override fun shortName() = _shortName
|
||||
|
||||
override fun type() = _type
|
||||
|
||||
override fun equals(other: Any?): Boolean = other is M4 && _hidden == other._hidden && _optional == other._optional && _description == other._description && _name == other._name && _ref == other._ref && _shortName == other._shortName && _type == other._type && _getEnum == other._getEnum && _items == other._items
|
||||
}
|
||||
|
||||
private class M5(reader: JsonReaderEx, preReadName: String?) : org.jetbrains.jsonProtocol.ProtocolMetaModel.Event {
|
||||
private var _description: String? = null
|
||||
private var _hidden = false
|
||||
private var _name: String? = null
|
||||
private var _parameters: List<org.jetbrains.jsonProtocol.ProtocolMetaModel.Parameter>? = null
|
||||
|
||||
init {
|
||||
var name = preReadName
|
||||
if (name == null && reader.hasNext() && reader.beginObject().hasNext()) {
|
||||
name = reader.nextName()
|
||||
}
|
||||
|
||||
loop@ while (name != null) {
|
||||
when (name) {
|
||||
"description" -> _description = reader.nextNullableString()
|
||||
"hidden" -> _hidden = reader.nextBoolean()
|
||||
"name" -> _name = reader.nextString()
|
||||
"parameters" -> _parameters = readObjectArray(reader, FM4())
|
||||
else -> reader.skipValue()
|
||||
}
|
||||
name = reader.nextNameOrNull()
|
||||
}
|
||||
|
||||
reader.endObject()
|
||||
}
|
||||
|
||||
override fun description() = _description
|
||||
|
||||
override fun hidden() = _hidden
|
||||
|
||||
override fun name() = _name!!
|
||||
|
||||
override fun parameters() = _parameters
|
||||
|
||||
override fun equals(other: Any?): Boolean = other is M5 && _hidden == other._hidden && _description == other._description && _name == other._name && _parameters == other._parameters
|
||||
}
|
||||
|
||||
private class M6(reader: JsonReaderEx, preReadName: String?) : org.jetbrains.jsonProtocol.ProtocolMetaModel.StandaloneType {
|
||||
private var _description: String? = null
|
||||
private var _getEnum: List<String>? = null
|
||||
private var _hidden = false
|
||||
private var _id: String? = null
|
||||
private var _items: org.jetbrains.jsonProtocol.ProtocolMetaModel.ArrayItemType? = null
|
||||
private var _properties: List<org.jetbrains.jsonProtocol.ProtocolMetaModel.ObjectProperty>? = null
|
||||
private var _type: String? = null
|
||||
|
||||
init {
|
||||
var name = preReadName
|
||||
if (name == null && reader.hasNext() && reader.beginObject().hasNext()) {
|
||||
name = reader.nextName()
|
||||
}
|
||||
|
||||
loop@ while (name != null) {
|
||||
when (name) {
|
||||
"description" -> _description = reader.nextNullableString()
|
||||
"enum" -> _getEnum = nextList(reader)
|
||||
"hidden" -> _hidden = reader.nextBoolean()
|
||||
"id" -> _id = reader.nextString()
|
||||
"items" -> _items = M7(reader, null)
|
||||
"properties" -> _properties = readObjectArray(reader, FM8())
|
||||
"type" -> _type = reader.nextString()
|
||||
else -> reader.skipValue()
|
||||
}
|
||||
name = reader.nextNameOrNull()
|
||||
}
|
||||
|
||||
reader.endObject()
|
||||
}
|
||||
|
||||
override fun description() = _description
|
||||
|
||||
override fun getEnum() = _getEnum
|
||||
|
||||
override fun hidden() = _hidden
|
||||
|
||||
override fun id() = _id!!
|
||||
|
||||
override fun items() = _items
|
||||
|
||||
override fun properties() = _properties
|
||||
|
||||
override fun type() = _type!!
|
||||
|
||||
override fun equals(other: Any?): Boolean = other is M6 && _hidden == other._hidden && _description == other._description && _id == other._id && _type == other._type && _getEnum == other._getEnum && _items == other._items && _properties == other._properties
|
||||
}
|
||||
|
||||
private class M7(reader: JsonReaderEx, preReadName: String?) : org.jetbrains.jsonProtocol.ProtocolMetaModel.ArrayItemType {
|
||||
private var _description: String? = null
|
||||
private var _getEnum: List<String>? = null
|
||||
private var _items: org.jetbrains.jsonProtocol.ProtocolMetaModel.ArrayItemType? = null
|
||||
private var _optional = false
|
||||
private var _properties: List<org.jetbrains.jsonProtocol.ProtocolMetaModel.ObjectProperty>? = null
|
||||
private var _ref: String? = null
|
||||
private var _type: String? = null
|
||||
|
||||
init {
|
||||
var name = preReadName
|
||||
if (name == null && reader.hasNext() && reader.beginObject().hasNext()) {
|
||||
name = reader.nextName()
|
||||
}
|
||||
|
||||
loop@ while (name != null) {
|
||||
when (name) {
|
||||
"description" -> _description = reader.nextNullableString()
|
||||
"enum" -> _getEnum = nextList(reader)
|
||||
"items" -> _items = M7(reader, null)
|
||||
"optional" -> _optional = reader.nextBoolean()
|
||||
"properties" -> _properties = readObjectArray(reader, FM8())
|
||||
"\$ref" -> _ref = reader.nextNullableString()
|
||||
"type" -> _type = reader.nextNullableString()
|
||||
else -> reader.skipValue()
|
||||
}
|
||||
name = reader.nextNameOrNull()
|
||||
}
|
||||
|
||||
reader.endObject()
|
||||
}
|
||||
|
||||
override fun description() = _description
|
||||
|
||||
override fun getEnum() = _getEnum
|
||||
|
||||
override fun items() = _items
|
||||
|
||||
override fun optional() = _optional
|
||||
|
||||
override fun properties() = _properties
|
||||
|
||||
override fun ref() = _ref
|
||||
|
||||
override fun type() = _type
|
||||
|
||||
override fun equals(other: Any?): Boolean = other is M7 && _optional == other._optional && _description == other._description && _ref == other._ref && _type == other._type && _getEnum == other._getEnum && _items == other._items && _properties == other._properties
|
||||
}
|
||||
|
||||
private class M8(reader: JsonReaderEx, preReadName: String?) : org.jetbrains.jsonProtocol.ProtocolMetaModel.ObjectProperty {
|
||||
private var _description: String? = null
|
||||
private var _getEnum: List<String>? = null
|
||||
private var _hidden = false
|
||||
private var _items: org.jetbrains.jsonProtocol.ProtocolMetaModel.ArrayItemType? = null
|
||||
private var _name: String? = null
|
||||
private var _optional = false
|
||||
private var _ref: String? = null
|
||||
private var _shortName: String? = null
|
||||
private var _type: String? = null
|
||||
|
||||
init {
|
||||
var name = preReadName
|
||||
if (name == null && reader.hasNext() && reader.beginObject().hasNext()) {
|
||||
name = reader.nextName()
|
||||
}
|
||||
|
||||
loop@ while (name != null) {
|
||||
when (name) {
|
||||
"description" -> _description = reader.nextNullableString()
|
||||
"enum" -> _getEnum = nextList(reader)
|
||||
"hidden" -> _hidden = reader.nextBoolean()
|
||||
"items" -> _items = M7(reader, null)
|
||||
"name" -> _name = reader.nextString()
|
||||
"optional" -> _optional = reader.nextBoolean()
|
||||
"\$ref" -> _ref = reader.nextNullableString()
|
||||
"shortName" -> _shortName = reader.nextNullableString()
|
||||
"type" -> _type = reader.nextNullableString()
|
||||
else -> reader.skipValue()
|
||||
}
|
||||
name = reader.nextNameOrNull()
|
||||
}
|
||||
|
||||
reader.endObject()
|
||||
}
|
||||
|
||||
override fun description() = _description
|
||||
|
||||
override fun getEnum() = _getEnum
|
||||
|
||||
override fun hidden() = _hidden
|
||||
|
||||
override fun items() = _items
|
||||
|
||||
override fun name() = _name!!
|
||||
|
||||
override fun optional() = _optional
|
||||
|
||||
override fun ref() = _ref
|
||||
|
||||
override fun shortName() = _shortName
|
||||
|
||||
override fun type() = _type
|
||||
|
||||
override fun equals(other: Any?): Boolean = other is M8 && _hidden == other._hidden && _optional == other._optional && _description == other._description && _name == other._name && _ref == other._ref && _shortName == other._shortName && _type == other._type && _getEnum == other._getEnum && _items == other._items
|
||||
}
|
||||
|
||||
private class FM2 : ObjectFactory<org.jetbrains.jsonProtocol.ProtocolMetaModel.Domain>() {
|
||||
override fun read(reader: JsonReaderEx) = M2(reader, null)
|
||||
}
|
||||
|
||||
private class FM3 : ObjectFactory<org.jetbrains.jsonProtocol.ProtocolMetaModel.Command>() {
|
||||
override fun read(reader: JsonReaderEx) = M3(reader, null)
|
||||
}
|
||||
|
||||
private class FM5 : ObjectFactory<org.jetbrains.jsonProtocol.ProtocolMetaModel.Event>() {
|
||||
override fun read(reader: JsonReaderEx) = M5(reader, null)
|
||||
}
|
||||
|
||||
private class FM6 : ObjectFactory<org.jetbrains.jsonProtocol.ProtocolMetaModel.StandaloneType>() {
|
||||
override fun read(reader: JsonReaderEx) = M6(reader, null)
|
||||
}
|
||||
|
||||
private class FM4 : ObjectFactory<org.jetbrains.jsonProtocol.ProtocolMetaModel.Parameter>() {
|
||||
override fun read(reader: JsonReaderEx) = M4(reader, null)
|
||||
}
|
||||
|
||||
private class FM8 : ObjectFactory<org.jetbrains.jsonProtocol.ProtocolMetaModel.ObjectProperty>() {
|
||||
override fun read(reader: JsonReaderEx) = M8(reader, null)
|
||||
}
|
||||
}
|
||||
-742
@@ -1,742 +0,0 @@
|
||||
// Generated source
|
||||
package org.jetbrains.jsonProtocol;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import static org.jetbrains.jsonProtocol.JsonReaders.nextList;
|
||||
import static org.jetbrains.jsonProtocol.JsonReaders.readObjectArray;
|
||||
|
||||
public final class ProtocolSchemaReaderImpl implements org.jetbrains.jsonProtocol.ProtocolSchemaReader {
|
||||
@Override
|
||||
public org.jetbrains.jsonProtocol.ProtocolMetaModel.Root parseRoot(org.jetbrains.io.JsonReaderEx reader) {
|
||||
return new M0(reader, null);
|
||||
}
|
||||
|
||||
private static final class M0 implements org.jetbrains.jsonProtocol.ProtocolMetaModel.Root {
|
||||
private java.util.List<org.jetbrains.jsonProtocol.ProtocolMetaModel.Domain> _domains;
|
||||
private org.jetbrains.jsonProtocol.ProtocolMetaModel.Version _version;
|
||||
|
||||
M0(org.jetbrains.io.JsonReaderEx reader, String name) {
|
||||
if (name == null) {
|
||||
if (reader.hasNext() && reader.beginObject().hasNext()) {
|
||||
name = reader.nextName();
|
||||
}
|
||||
else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
do {
|
||||
if (name.equals("domains")) {
|
||||
_domains = readObjectArray(reader, new M2F());
|
||||
}
|
||||
else if (name.equals("version")) {
|
||||
_version = new M1(reader, null);
|
||||
}
|
||||
else {
|
||||
reader.skipValue();
|
||||
}
|
||||
}
|
||||
while ((name = reader.nextNameOrNull()) != null);
|
||||
|
||||
reader.endObject();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public java.util.List<org.jetbrains.jsonProtocol.ProtocolMetaModel.Domain> domains() {
|
||||
return _domains;
|
||||
}
|
||||
|
||||
@Override
|
||||
public org.jetbrains.jsonProtocol.ProtocolMetaModel.Version version() {
|
||||
return _version;
|
||||
}
|
||||
}
|
||||
|
||||
private static final class M1 implements org.jetbrains.jsonProtocol.ProtocolMetaModel.Version {
|
||||
private String _major;
|
||||
private String _minor;
|
||||
|
||||
M1(org.jetbrains.io.JsonReaderEx reader, String name) {
|
||||
if (name == null) {
|
||||
if (reader.hasNext() && reader.beginObject().hasNext()) {
|
||||
name = reader.nextName();
|
||||
}
|
||||
else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
do {
|
||||
if (name.equals("major")) {
|
||||
_major = reader.nextString();
|
||||
}
|
||||
else if (name.equals("minor")) {
|
||||
_minor = reader.nextString();
|
||||
}
|
||||
else {
|
||||
reader.skipValue();
|
||||
}
|
||||
}
|
||||
while ((name = reader.nextNameOrNull()) != null);
|
||||
|
||||
reader.endObject();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public java.lang.String major() {
|
||||
return _major;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public java.lang.String minor() {
|
||||
return _minor;
|
||||
}
|
||||
}
|
||||
|
||||
private static final class M2 implements org.jetbrains.jsonProtocol.ProtocolMetaModel.Domain {
|
||||
private java.util.List<org.jetbrains.jsonProtocol.ProtocolMetaModel.Command> _commands;
|
||||
private String _description;
|
||||
private String _domain;
|
||||
private java.util.List<org.jetbrains.jsonProtocol.ProtocolMetaModel.Event> _events;
|
||||
private boolean _hidden;
|
||||
private java.util.List<org.jetbrains.jsonProtocol.ProtocolMetaModel.StandaloneType> _types;
|
||||
|
||||
M2(org.jetbrains.io.JsonReaderEx reader, String name) {
|
||||
if (name == null) {
|
||||
if (reader.hasNext() && reader.beginObject().hasNext()) {
|
||||
name = reader.nextName();
|
||||
}
|
||||
else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
do {
|
||||
if (name.equals("commands")) {
|
||||
_commands = readObjectArray(reader, new M3F());
|
||||
}
|
||||
else if (name.equals("description")) {
|
||||
_description = reader.nextNullableString();
|
||||
}
|
||||
else if (name.equals("domain")) {
|
||||
_domain = reader.nextString();
|
||||
}
|
||||
else if (name.equals("events")) {
|
||||
_events = readObjectArray(reader, new M5F());
|
||||
}
|
||||
else if (name.equals("hidden")) {
|
||||
_hidden = reader.nextBoolean();
|
||||
}
|
||||
else if (name.equals("types")) {
|
||||
_types = readObjectArray(reader, new M6F());
|
||||
}
|
||||
else {
|
||||
reader.skipValue();
|
||||
}
|
||||
}
|
||||
while ((name = reader.nextNameOrNull()) != null);
|
||||
|
||||
reader.endObject();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public java.util.List<org.jetbrains.jsonProtocol.ProtocolMetaModel.Command> commands() {
|
||||
return _commands;
|
||||
}
|
||||
|
||||
@Override
|
||||
public java.lang.String description() {
|
||||
return _description;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public java.lang.String domain() {
|
||||
return _domain;
|
||||
}
|
||||
|
||||
@Override
|
||||
public java.util.List<org.jetbrains.jsonProtocol.ProtocolMetaModel.Event> events() {
|
||||
return _events;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hidden() {
|
||||
return _hidden;
|
||||
}
|
||||
|
||||
@Override
|
||||
public java.util.List<org.jetbrains.jsonProtocol.ProtocolMetaModel.StandaloneType> types() {
|
||||
return _types;
|
||||
}
|
||||
}
|
||||
|
||||
private static final class M3 implements org.jetbrains.jsonProtocol.ProtocolMetaModel.Command {
|
||||
private boolean _async;
|
||||
private String _description;
|
||||
private boolean _hidden;
|
||||
private String _name;
|
||||
private java.util.List<org.jetbrains.jsonProtocol.ProtocolMetaModel.Parameter> _parameters;
|
||||
private java.util.List<org.jetbrains.jsonProtocol.ProtocolMetaModel.Parameter> _returns;
|
||||
|
||||
M3(org.jetbrains.io.JsonReaderEx reader, String name) {
|
||||
if (name == null) {
|
||||
if (reader.hasNext() && reader.beginObject().hasNext()) {
|
||||
name = reader.nextName();
|
||||
}
|
||||
else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
do {
|
||||
if (name.equals("async")) {
|
||||
_async = reader.nextBoolean();
|
||||
}
|
||||
else if (name.equals("description")) {
|
||||
_description = reader.nextNullableString();
|
||||
}
|
||||
else if (name.equals("hidden")) {
|
||||
_hidden = reader.nextBoolean();
|
||||
}
|
||||
else if (name.equals("name")) {
|
||||
_name = reader.nextString();
|
||||
}
|
||||
else if (name.equals("parameters")) {
|
||||
_parameters = readObjectArray(reader, new M4F());
|
||||
}
|
||||
else if (name.equals("returns")) {
|
||||
_returns = readObjectArray(reader, new M4F());
|
||||
}
|
||||
else {
|
||||
reader.skipValue();
|
||||
}
|
||||
}
|
||||
while ((name = reader.nextNameOrNull()) != null);
|
||||
|
||||
reader.endObject();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean async() {
|
||||
return _async;
|
||||
}
|
||||
|
||||
@Override
|
||||
public java.lang.String description() {
|
||||
return _description;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hidden() {
|
||||
return _hidden;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public java.lang.String name() {
|
||||
return _name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public java.util.List<org.jetbrains.jsonProtocol.ProtocolMetaModel.Parameter> parameters() {
|
||||
return _parameters;
|
||||
}
|
||||
|
||||
@Override
|
||||
public java.util.List<org.jetbrains.jsonProtocol.ProtocolMetaModel.Parameter> returns() {
|
||||
return _returns;
|
||||
}
|
||||
}
|
||||
|
||||
private static final class M4 implements org.jetbrains.jsonProtocol.ProtocolMetaModel.Parameter {
|
||||
private String _description;
|
||||
private java.util.List<String> _getEnum;
|
||||
private boolean _hidden;
|
||||
private org.jetbrains.jsonProtocol.ProtocolMetaModel.ArrayItemType _items;
|
||||
private String _name;
|
||||
private boolean _optional;
|
||||
private String _ref;
|
||||
private String _shortName;
|
||||
private String _type;
|
||||
|
||||
M4(org.jetbrains.io.JsonReaderEx reader, String name) {
|
||||
if (name == null) {
|
||||
if (reader.hasNext() && reader.beginObject().hasNext()) {
|
||||
name = reader.nextName();
|
||||
}
|
||||
else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
do {
|
||||
if (name.equals("description")) {
|
||||
_description = reader.nextNullableString();
|
||||
}
|
||||
else if (name.equals("enum")) {
|
||||
_getEnum = nextList(reader);
|
||||
}
|
||||
else if (name.equals("hidden")) {
|
||||
_hidden = reader.nextBoolean();
|
||||
}
|
||||
else if (name.equals("items")) {
|
||||
_items = new M7(reader, null);
|
||||
}
|
||||
else if (name.equals("name")) {
|
||||
_name = reader.nextString();
|
||||
}
|
||||
else if (name.equals("optional")) {
|
||||
_optional = reader.nextBoolean();
|
||||
}
|
||||
else if (name.equals("$ref")) {
|
||||
_ref = reader.nextNullableString();
|
||||
}
|
||||
else if (name.equals("shortName")) {
|
||||
_shortName = reader.nextNullableString();
|
||||
}
|
||||
else if (name.equals("type")) {
|
||||
_type = reader.nextNullableString();
|
||||
}
|
||||
else {
|
||||
reader.skipValue();
|
||||
}
|
||||
}
|
||||
while ((name = reader.nextNameOrNull()) != null);
|
||||
|
||||
reader.endObject();
|
||||
}
|
||||
|
||||
@Override
|
||||
public java.lang.String description() {
|
||||
return _description;
|
||||
}
|
||||
|
||||
@Override
|
||||
public java.util.List<java.lang.String> getEnum() {
|
||||
return _getEnum;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hidden() {
|
||||
return _hidden;
|
||||
}
|
||||
|
||||
@Override
|
||||
public org.jetbrains.jsonProtocol.ProtocolMetaModel.ArrayItemType items() {
|
||||
return _items;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public java.lang.String name() {
|
||||
return _name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean optional() {
|
||||
return _optional;
|
||||
}
|
||||
|
||||
@Override
|
||||
public java.lang.String ref() {
|
||||
return _ref;
|
||||
}
|
||||
|
||||
@Override
|
||||
public java.lang.String shortName() {
|
||||
return _shortName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public java.lang.String type() {
|
||||
return _type;
|
||||
}
|
||||
}
|
||||
|
||||
private static final class M5 implements org.jetbrains.jsonProtocol.ProtocolMetaModel.Event {
|
||||
private String _description;
|
||||
private boolean _hidden;
|
||||
private String _name;
|
||||
private java.util.List<org.jetbrains.jsonProtocol.ProtocolMetaModel.Parameter> _parameters;
|
||||
|
||||
M5(org.jetbrains.io.JsonReaderEx reader, String name) {
|
||||
if (name == null) {
|
||||
if (reader.hasNext() && reader.beginObject().hasNext()) {
|
||||
name = reader.nextName();
|
||||
}
|
||||
else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
do {
|
||||
if (name.equals("description")) {
|
||||
_description = reader.nextNullableString();
|
||||
}
|
||||
else if (name.equals("hidden")) {
|
||||
_hidden = reader.nextBoolean();
|
||||
}
|
||||
else if (name.equals("name")) {
|
||||
_name = reader.nextString();
|
||||
}
|
||||
else if (name.equals("parameters")) {
|
||||
_parameters = readObjectArray(reader, new M4F());
|
||||
}
|
||||
else {
|
||||
reader.skipValue();
|
||||
}
|
||||
}
|
||||
while ((name = reader.nextNameOrNull()) != null);
|
||||
|
||||
reader.endObject();
|
||||
}
|
||||
|
||||
@Override
|
||||
public java.lang.String description() {
|
||||
return _description;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hidden() {
|
||||
return _hidden;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public java.lang.String name() {
|
||||
return _name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public java.util.List<org.jetbrains.jsonProtocol.ProtocolMetaModel.Parameter> parameters() {
|
||||
return _parameters;
|
||||
}
|
||||
}
|
||||
|
||||
private static final class M6 implements org.jetbrains.jsonProtocol.ProtocolMetaModel.StandaloneType {
|
||||
private String _description;
|
||||
private java.util.List<String> _getEnum;
|
||||
private boolean _hidden;
|
||||
private String _id;
|
||||
private org.jetbrains.jsonProtocol.ProtocolMetaModel.ArrayItemType _items;
|
||||
private java.util.List<org.jetbrains.jsonProtocol.ProtocolMetaModel.ObjectProperty> _properties;
|
||||
private String _type;
|
||||
|
||||
M6(org.jetbrains.io.JsonReaderEx reader, String name) {
|
||||
if (name == null) {
|
||||
if (reader.hasNext() && reader.beginObject().hasNext()) {
|
||||
name = reader.nextName();
|
||||
}
|
||||
else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
do {
|
||||
if (name.equals("description")) {
|
||||
_description = reader.nextNullableString();
|
||||
}
|
||||
else if (name.equals("enum")) {
|
||||
_getEnum = nextList(reader);
|
||||
}
|
||||
else if (name.equals("hidden")) {
|
||||
_hidden = reader.nextBoolean();
|
||||
}
|
||||
else if (name.equals("id")) {
|
||||
_id = reader.nextString();
|
||||
}
|
||||
else if (name.equals("items")) {
|
||||
_items = new M7(reader, null);
|
||||
}
|
||||
else if (name.equals("properties")) {
|
||||
_properties = readObjectArray(reader, new M8F());
|
||||
}
|
||||
else if (name.equals("type")) {
|
||||
_type = reader.nextString();
|
||||
}
|
||||
else {
|
||||
reader.skipValue();
|
||||
}
|
||||
}
|
||||
while ((name = reader.nextNameOrNull()) != null);
|
||||
|
||||
reader.endObject();
|
||||
}
|
||||
|
||||
@Override
|
||||
public java.lang.String description() {
|
||||
return _description;
|
||||
}
|
||||
|
||||
@Override
|
||||
public java.util.List<java.lang.String> getEnum() {
|
||||
return _getEnum;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hidden() {
|
||||
return _hidden;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public java.lang.String id() {
|
||||
return _id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public org.jetbrains.jsonProtocol.ProtocolMetaModel.ArrayItemType items() {
|
||||
return _items;
|
||||
}
|
||||
|
||||
@Override
|
||||
public java.util.List<org.jetbrains.jsonProtocol.ProtocolMetaModel.ObjectProperty> properties() {
|
||||
return _properties;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public java.lang.String type() {
|
||||
return _type;
|
||||
}
|
||||
}
|
||||
|
||||
private static final class M7 implements org.jetbrains.jsonProtocol.ProtocolMetaModel.ArrayItemType {
|
||||
private String _description;
|
||||
private java.util.List<String> _getEnum;
|
||||
private org.jetbrains.jsonProtocol.ProtocolMetaModel.ArrayItemType _items;
|
||||
private boolean _optional;
|
||||
private java.util.List<org.jetbrains.jsonProtocol.ProtocolMetaModel.ObjectProperty> _properties;
|
||||
private String _ref;
|
||||
private String _type;
|
||||
|
||||
M7(org.jetbrains.io.JsonReaderEx reader, String name) {
|
||||
if (name == null) {
|
||||
if (reader.hasNext() && reader.beginObject().hasNext()) {
|
||||
name = reader.nextName();
|
||||
}
|
||||
else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
do {
|
||||
if (name.equals("description")) {
|
||||
_description = reader.nextNullableString();
|
||||
}
|
||||
else if (name.equals("enum")) {
|
||||
_getEnum = nextList(reader);
|
||||
}
|
||||
else if (name.equals("items")) {
|
||||
_items = new M7(reader, null);
|
||||
}
|
||||
else if (name.equals("optional")) {
|
||||
_optional = reader.nextBoolean();
|
||||
}
|
||||
else if (name.equals("properties")) {
|
||||
_properties = readObjectArray(reader, new M8F());
|
||||
}
|
||||
else if (name.equals("$ref")) {
|
||||
_ref = reader.nextNullableString();
|
||||
}
|
||||
else if (name.equals("type")) {
|
||||
_type = reader.nextNullableString();
|
||||
}
|
||||
else {
|
||||
reader.skipValue();
|
||||
}
|
||||
}
|
||||
while ((name = reader.nextNameOrNull()) != null);
|
||||
|
||||
reader.endObject();
|
||||
}
|
||||
|
||||
@Override
|
||||
public java.lang.String description() {
|
||||
return _description;
|
||||
}
|
||||
|
||||
@Override
|
||||
public java.util.List<java.lang.String> getEnum() {
|
||||
return _getEnum;
|
||||
}
|
||||
|
||||
@Override
|
||||
public org.jetbrains.jsonProtocol.ProtocolMetaModel.ArrayItemType items() {
|
||||
return _items;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean optional() {
|
||||
return _optional;
|
||||
}
|
||||
|
||||
@Override
|
||||
public java.util.List<org.jetbrains.jsonProtocol.ProtocolMetaModel.ObjectProperty> properties() {
|
||||
return _properties;
|
||||
}
|
||||
|
||||
@Override
|
||||
public java.lang.String ref() {
|
||||
return _ref;
|
||||
}
|
||||
|
||||
@Override
|
||||
public java.lang.String type() {
|
||||
return _type;
|
||||
}
|
||||
}
|
||||
|
||||
private static final class M8 implements org.jetbrains.jsonProtocol.ProtocolMetaModel.ObjectProperty {
|
||||
private String _description;
|
||||
private java.util.List<String> _getEnum;
|
||||
private boolean _hidden;
|
||||
private org.jetbrains.jsonProtocol.ProtocolMetaModel.ArrayItemType _items;
|
||||
private String _name;
|
||||
private boolean _optional;
|
||||
private String _ref;
|
||||
private String _shortName;
|
||||
private String _type;
|
||||
|
||||
M8(org.jetbrains.io.JsonReaderEx reader, String name) {
|
||||
if (name == null) {
|
||||
if (reader.hasNext() && reader.beginObject().hasNext()) {
|
||||
name = reader.nextName();
|
||||
}
|
||||
else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
do {
|
||||
if (name.equals("description")) {
|
||||
_description = reader.nextNullableString();
|
||||
}
|
||||
else if (name.equals("enum")) {
|
||||
_getEnum = nextList(reader);
|
||||
}
|
||||
else if (name.equals("hidden")) {
|
||||
_hidden = reader.nextBoolean();
|
||||
}
|
||||
else if (name.equals("items")) {
|
||||
_items = new M7(reader, null);
|
||||
}
|
||||
else if (name.equals("name")) {
|
||||
_name = reader.nextString();
|
||||
}
|
||||
else if (name.equals("optional")) {
|
||||
_optional = reader.nextBoolean();
|
||||
}
|
||||
else if (name.equals("$ref")) {
|
||||
_ref = reader.nextNullableString();
|
||||
}
|
||||
else if (name.equals("shortName")) {
|
||||
_shortName = reader.nextNullableString();
|
||||
}
|
||||
else if (name.equals("type")) {
|
||||
_type = reader.nextNullableString();
|
||||
}
|
||||
else {
|
||||
reader.skipValue();
|
||||
}
|
||||
}
|
||||
while ((name = reader.nextNameOrNull()) != null);
|
||||
|
||||
reader.endObject();
|
||||
}
|
||||
|
||||
@Override
|
||||
public java.lang.String description() {
|
||||
return _description;
|
||||
}
|
||||
|
||||
@Override
|
||||
public java.util.List<java.lang.String> getEnum() {
|
||||
return _getEnum;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hidden() {
|
||||
return _hidden;
|
||||
}
|
||||
|
||||
@Override
|
||||
public org.jetbrains.jsonProtocol.ProtocolMetaModel.ArrayItemType items() {
|
||||
return _items;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public java.lang.String name() {
|
||||
return _name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean optional() {
|
||||
return _optional;
|
||||
}
|
||||
|
||||
@Override
|
||||
public java.lang.String ref() {
|
||||
return _ref;
|
||||
}
|
||||
|
||||
@Override
|
||||
public java.lang.String shortName() {
|
||||
return _shortName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public java.lang.String type() {
|
||||
return _type;
|
||||
}
|
||||
}
|
||||
|
||||
private static final class M2F extends ObjectFactory<org.jetbrains.jsonProtocol.ProtocolMetaModel.Domain> {
|
||||
@Override
|
||||
public org.jetbrains.jsonProtocol.ProtocolMetaModel.Domain read(org.jetbrains.io.JsonReaderEx reader) {
|
||||
return new M2(reader, null);
|
||||
}
|
||||
}
|
||||
|
||||
private static final class M3F extends ObjectFactory<org.jetbrains.jsonProtocol.ProtocolMetaModel.Command> {
|
||||
@Override
|
||||
public org.jetbrains.jsonProtocol.ProtocolMetaModel.Command read(org.jetbrains.io.JsonReaderEx reader) {
|
||||
return new M3(reader, null);
|
||||
}
|
||||
}
|
||||
|
||||
private static final class M5F extends ObjectFactory<org.jetbrains.jsonProtocol.ProtocolMetaModel.Event> {
|
||||
@Override
|
||||
public org.jetbrains.jsonProtocol.ProtocolMetaModel.Event read(org.jetbrains.io.JsonReaderEx reader) {
|
||||
return new M5(reader, null);
|
||||
}
|
||||
}
|
||||
|
||||
private static final class M6F extends ObjectFactory<org.jetbrains.jsonProtocol.ProtocolMetaModel.StandaloneType> {
|
||||
@Override
|
||||
public org.jetbrains.jsonProtocol.ProtocolMetaModel.StandaloneType read(org.jetbrains.io.JsonReaderEx reader) {
|
||||
return new M6(reader, null);
|
||||
}
|
||||
}
|
||||
|
||||
private static final class M4F extends ObjectFactory<org.jetbrains.jsonProtocol.ProtocolMetaModel.Parameter> {
|
||||
@Override
|
||||
public org.jetbrains.jsonProtocol.ProtocolMetaModel.Parameter read(org.jetbrains.io.JsonReaderEx reader) {
|
||||
return new M4(reader, null);
|
||||
}
|
||||
}
|
||||
|
||||
private static final class M8F extends ObjectFactory<org.jetbrains.jsonProtocol.ProtocolMetaModel.ObjectProperty> {
|
||||
@Override
|
||||
public org.jetbrains.jsonProtocol.ProtocolMetaModel.ObjectProperty read(org.jetbrains.io.JsonReaderEx reader) {
|
||||
return new M8(reader, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,8 +20,8 @@ interface TextOutConsumer {
|
||||
|
||||
internal class DomainGenerator(val generator: Generator, val domain: ProtocolMetaModel.Domain, val fileUpdater: FileUpdater) {
|
||||
fun registerTypes() {
|
||||
if (domain.types() != null) {
|
||||
for (type in domain.types()!!) {
|
||||
domain.types()?.let {
|
||||
for (type in it) {
|
||||
generator.typeMap.getTypeData(domain.domain(), type.id()).type = type
|
||||
}
|
||||
}
|
||||
|
||||
@@ -236,7 +236,7 @@ fun generateMethodNameSubstitute(originalName: String, out: TextOutput): String
|
||||
return originalName
|
||||
}
|
||||
out.append("@org.jetbrains.jsonProtocol.JsonField(name = \"").append(originalName).append("\")").newLine()
|
||||
return "get" + Character.toUpperCase(originalName.get(0)) + originalName.substring(1)
|
||||
return "get${Character.toUpperCase(originalName.get(0))}${originalName.substring(1)}"
|
||||
}
|
||||
|
||||
fun capitalizeFirstChar(s: String): String {
|
||||
@@ -262,7 +262,7 @@ fun <R> switchByType(typedObject: ItemDescriptor, visitor: TypeVisitor<R>): R {
|
||||
}
|
||||
INTEGER_TYPE, "int" -> return visitor.visitInteger()
|
||||
NUMBER_TYPE -> return visitor.visitNumber()
|
||||
ARRAY_TYPE -> return visitor.visitArray(typedObject.items())
|
||||
ARRAY_TYPE -> return visitor.visitArray(typedObject.items()!!)
|
||||
OBJECT_TYPE -> {
|
||||
if (typedObject !is ItemDescriptor.Type) {
|
||||
return visitor.visitObject(null)
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
package org.jetbrains.protocolReader
|
||||
|
||||
import java.lang.reflect.Method
|
||||
import java.util.*
|
||||
|
||||
private val STATIC_METHOD_PARAM_NAME_LIST = listOf(READER_NAME)
|
||||
private val STATIC_METHOD_PARAM_NAME_LIST2 = Arrays.asList(READER_NAME, "nextName")
|
||||
|
||||
internal class ReadDelegate(private val typeHandler: TypeWriter<*>, private val isList: Boolean, hasNextNameParam: Boolean) {
|
||||
private val paramNames = if (hasNextNameParam) STATIC_METHOD_PARAM_NAME_LIST2 else STATIC_METHOD_PARAM_NAME_LIST
|
||||
|
||||
fun write(scope: ClassScope, method: Method, out: TextOutput) {
|
||||
writeMethodDeclarationJava(out, method, paramNames)
|
||||
out.append(" = ")
|
||||
if (isList) {
|
||||
out.append("readObjectArray(").append(READER_NAME).append(", ").append(TYPE_FACTORY_NAME_PREFIX).append(scope.requireFactoryGenerationAndGetName(typeHandler)).append("()").append(")")
|
||||
}
|
||||
else {
|
||||
typeHandler.writeInstantiateCode(scope, out)
|
||||
out.append('(').append(READER_NAME)
|
||||
out.comma().space()
|
||||
out.append(if (paramNames.size == 1) "null" else "nextName")
|
||||
out.append(')')
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -25,7 +25,7 @@ private fun parseArgs(args: Array<String>): String {
|
||||
|
||||
for (arg in args) {
|
||||
if (!arg.startsWith("--")) {
|
||||
throw IllegalArgumentException("Unrecognized param: " + arg)
|
||||
throw IllegalArgumentException("Unrecognized param: $arg")
|
||||
}
|
||||
val equalsPos = arg.indexOf('=', 2)
|
||||
val key: String
|
||||
@@ -38,12 +38,12 @@ private fun parseArgs(args: Array<String>): String {
|
||||
key = arg.substring(2, equalsPos).trim()
|
||||
value = arg.substring(equalsPos + 1).trim()
|
||||
}
|
||||
val paramListener = paramMap.get(key) ?: throw IllegalArgumentException("Unrecognized param name: " + key)
|
||||
val paramListener = paramMap.get(key) ?: throw IllegalArgumentException("Unrecognized param name: $key")
|
||||
try {
|
||||
paramListener.value = value
|
||||
}
|
||||
catch (e: IllegalArgumentException) {
|
||||
throw IllegalArgumentException("Failed to set value of " + key, e)
|
||||
throw IllegalArgumentException("Failed to set value of $key", e)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -86,7 +86,7 @@ private fun generate(configuration: GenerateConfiguration<*>, stringBuilder: Str
|
||||
out.append(':').space().append(configuration.root.type.canonicalName).append(if (configuration.root.type.isInterface) "" else "()").openBlock(false)
|
||||
|
||||
val rootClassScope = fileScope.newClassScope()
|
||||
configuration.root.writeStaticMethodJava(rootClassScope)
|
||||
configuration.root.write(rootClassScope)
|
||||
|
||||
for (typeWriter in configuration.typeToTypeHandler.values) {
|
||||
out.newLine()
|
||||
@@ -106,7 +106,7 @@ private fun generate(configuration: GenerateConfiguration<*>, stringBuilder: Str
|
||||
val originName = typeWriter.typeClass.canonicalName
|
||||
out.newLine().append("private class ").append(TYPE_FACTORY_NAME_PREFIX).append(globalScope.getTypeImplShortName(typeWriter)).append(" : ObjectFactory<")
|
||||
out.append(originName).append(">()").openBlock()
|
||||
out.append("override fun read(").append(JSON_READER_PARAMETER_DEF).append(") = ")
|
||||
out.append("override fun read(").append(JSON_READER_PARAMETER_DEF).append("): ").append(originName).append(" = ")
|
||||
typeWriter.writeInstantiateCode(rootClassScope, out)
|
||||
out.append('(').append(READER_NAME).append(", null)")
|
||||
out.closeBlock()
|
||||
|
||||
@@ -9,7 +9,7 @@ import java.util.*
|
||||
|
||||
internal class ReaderRoot<R>(val type: Class<R>, private val typeToTypeHandler: LinkedHashMap<Class<*>, TypeWriter<*>?>) {
|
||||
private val visitedInterfaces = THashSet<Class<*>>(1)
|
||||
val methodMap = LinkedHashMap<Method, ReadDelegate>();
|
||||
val methodMap = LinkedHashMap<Method, ReadDelegate>()
|
||||
|
||||
init {
|
||||
readInterfaceRecursive(type)
|
||||
@@ -23,16 +23,14 @@ internal class ReaderRoot<R>(val type: Class<R>, private val typeToTypeHandler:
|
||||
|
||||
// todo sort by source location
|
||||
val methods = clazz.methods
|
||||
Arrays.sort<Method>(methods, object : Comparator<Method> {
|
||||
override fun compare(o1: Method, o2: Method) = o1.name.compareTo(o2.name)
|
||||
})
|
||||
Arrays.sort<Method>(methods, { o1, o2 -> o1.name.compareTo(o2.name) })
|
||||
|
||||
for (m in methods) {
|
||||
m.getAnnotation<JsonParseMethod>(JsonParseMethod::class.java) ?: continue
|
||||
|
||||
val exceptionTypes = m.exceptionTypes
|
||||
if (exceptionTypes.size > 1) {
|
||||
throw JsonProtocolModelParseException("Too many exception declared in " + m)
|
||||
throw JsonProtocolModelParseException("Too many exception declared in $m")
|
||||
}
|
||||
|
||||
var returnType = m.genericReturnType
|
||||
@@ -53,26 +51,26 @@ internal class ReaderRoot<R>(val type: Class<R>, private val typeToTypeHandler:
|
||||
|
||||
val arguments = m.genericParameterTypes
|
||||
if (arguments.size > 2) {
|
||||
throw JsonProtocolModelParseException("Exactly one argument is expected in " + m)
|
||||
throw JsonProtocolModelParseException("Exactly one argument is expected in $m")
|
||||
}
|
||||
val argument = arguments[0]
|
||||
if (argument == JsonReaderEx::class.java || argument == Any::class.java) {
|
||||
methodMap.put(m, ReadDelegate(typeWriter, isList, arguments.size != 1))
|
||||
}
|
||||
else {
|
||||
throw JsonProtocolModelParseException("Unrecognized argument type in " + m)
|
||||
throw JsonProtocolModelParseException("Unrecognized argument type in $m")
|
||||
}
|
||||
}
|
||||
|
||||
for (baseType in clazz.genericInterfaces) {
|
||||
if (baseType !is Class<*>) {
|
||||
throw JsonProtocolModelParseException("Base interface must be class in " + clazz)
|
||||
throw JsonProtocolModelParseException("Base interface must be class in $clazz")
|
||||
}
|
||||
readInterfaceRecursive(baseType)
|
||||
}
|
||||
}
|
||||
|
||||
public fun writeStaticMethodJava(scope: ClassScope) {
|
||||
fun write(scope: ClassScope) {
|
||||
val out = scope.output
|
||||
for (entry in methodMap.entries) {
|
||||
out.newLine()
|
||||
@@ -80,4 +78,28 @@ internal class ReaderRoot<R>(val type: Class<R>, private val typeToTypeHandler:
|
||||
out.newLine()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private val STATIC_METHOD_PARAM_NAME_LIST = listOf(READER_NAME)
|
||||
private val STATIC_METHOD_PARAM_NAME_LIST2 = Arrays.asList(READER_NAME, "nextName")
|
||||
|
||||
internal class ReadDelegate(private val typeHandler: TypeWriter<*>, private val isList: Boolean, hasNextNameParam: Boolean) {
|
||||
private val paramNames = if (hasNextNameParam) STATIC_METHOD_PARAM_NAME_LIST2 else STATIC_METHOD_PARAM_NAME_LIST
|
||||
|
||||
fun write(scope: ClassScope, method: Method, out: TextOutput) {
|
||||
writeMethodDeclarationJava(out, method, paramNames)
|
||||
out.append(": ")
|
||||
writeJavaTypeName(method.genericReturnType, out)
|
||||
out.append(" = ")
|
||||
if (isList) {
|
||||
out.append("readObjectArray(").append(READER_NAME).append(", ").append(TYPE_FACTORY_NAME_PREFIX).append(scope.requireFactoryGenerationAndGetName(typeHandler)).append("()").append(")")
|
||||
}
|
||||
else {
|
||||
typeHandler.writeInstantiateCode(scope, out)
|
||||
out.append('(').append(READER_NAME)
|
||||
out.comma().space()
|
||||
out.append(if (paramNames.size == 1) "null" else "nextName")
|
||||
out.append(')')
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -189,7 +189,11 @@ internal class TypeWriter<T>(val typeClass: Class<T>, jsonSuperClass: TypeRef<*>
|
||||
out.newLine()
|
||||
}
|
||||
|
||||
out.append('"').append(fieldLoader.jsonName).append('"').append(" -> ")
|
||||
out.append('"')
|
||||
if (fieldLoader.jsonName.first() == '$') {
|
||||
out.append('\\')
|
||||
}
|
||||
out.append(fieldLoader.jsonName).append('"').append(" -> ")
|
||||
|
||||
if (stopIfAllFieldsWereRead && !isTracedStop) {
|
||||
out.openBlock()
|
||||
|
||||
+56
-56
@@ -14,11 +14,11 @@ val ANY_TYPE: String = "any"
|
||||
interface ItemDescriptor {
|
||||
fun description(): String?
|
||||
|
||||
fun type(): String
|
||||
fun type(): String?
|
||||
|
||||
fun getEnum(): List<String>?
|
||||
|
||||
fun items(): ProtocolMetaModel.ArrayItemType
|
||||
fun items(): ProtocolMetaModel.ArrayItemType?
|
||||
|
||||
interface Named : Referenceable {
|
||||
fun name(): String
|
||||
@@ -30,7 +30,7 @@ interface ItemDescriptor {
|
||||
}
|
||||
|
||||
interface Referenceable : ItemDescriptor {
|
||||
fun ref(): String
|
||||
fun ref(): String?
|
||||
}
|
||||
|
||||
interface Type : ItemDescriptor {
|
||||
@@ -46,106 +46,106 @@ interface ProtocolSchemaReader {
|
||||
/**
|
||||
* Defines schema of WIP metamodel defined in http://svn.webkit.org/repository/webkit/trunk/Source/WebCore/inspector/Inspector.json
|
||||
*/
|
||||
public interface ProtocolMetaModel {
|
||||
interface ProtocolMetaModel {
|
||||
@JsonType
|
||||
public interface Root {
|
||||
interface Root {
|
||||
@JsonOptionalField
|
||||
public fun version(): Version
|
||||
fun version(): Version?
|
||||
|
||||
public fun domains(): List<Domain>
|
||||
fun domains(): List<Domain>
|
||||
}
|
||||
|
||||
@JsonType
|
||||
public interface Version {
|
||||
public fun major(): String
|
||||
public fun minor(): String
|
||||
interface Version {
|
||||
fun major(): String
|
||||
fun minor(): String
|
||||
}
|
||||
|
||||
@JsonType
|
||||
public interface Domain {
|
||||
public fun domain(): String
|
||||
interface Domain {
|
||||
fun domain(): String
|
||||
|
||||
@JsonOptionalField
|
||||
public fun types(): List<StandaloneType>?
|
||||
fun types(): List<StandaloneType>?
|
||||
|
||||
public fun commands(): List<Command>
|
||||
fun commands(): List<Command>
|
||||
|
||||
@JsonOptionalField
|
||||
public fun events(): List<Event>?
|
||||
fun events(): List<Event>?
|
||||
|
||||
@JsonOptionalField
|
||||
public fun description(): String
|
||||
fun description(): String?
|
||||
|
||||
@JsonOptionalField
|
||||
public fun hidden(): Boolean
|
||||
fun hidden(): Boolean
|
||||
}
|
||||
|
||||
@JsonType
|
||||
public interface Command {
|
||||
public fun name(): String
|
||||
interface Command {
|
||||
fun name(): String
|
||||
|
||||
@JsonOptionalField
|
||||
public fun parameters(): List<Parameter>?
|
||||
fun parameters(): List<Parameter>?
|
||||
|
||||
@JsonOptionalField
|
||||
public fun returns(): List<Parameter>?
|
||||
fun returns(): List<Parameter>?
|
||||
|
||||
@JsonOptionalField
|
||||
public fun description(): String
|
||||
fun description(): String?
|
||||
|
||||
@JsonOptionalField
|
||||
public fun hidden(): Boolean
|
||||
fun hidden(): Boolean
|
||||
|
||||
@JsonOptionalField
|
||||
public fun async(): Boolean
|
||||
fun async(): Boolean
|
||||
}
|
||||
|
||||
@JsonType
|
||||
public interface Parameter : ItemDescriptor.Named {
|
||||
interface Parameter : ItemDescriptor.Named {
|
||||
override fun name(): String
|
||||
|
||||
@JsonOptionalField
|
||||
override fun shortName(): String
|
||||
override fun shortName(): String?
|
||||
|
||||
@JsonOptionalField
|
||||
override fun type(): String
|
||||
override fun type(): String?
|
||||
|
||||
@JsonOptionalField
|
||||
override fun items(): ArrayItemType
|
||||
override fun items(): ArrayItemType?
|
||||
|
||||
@JsonField(name = "enum", optional = true)
|
||||
override fun getEnum(): List<String>
|
||||
override fun getEnum(): List<String>?
|
||||
|
||||
@JsonField(name = "\$ref", optional = true)
|
||||
override fun ref(): String
|
||||
override fun ref(): String?
|
||||
|
||||
@JsonOptionalField
|
||||
override fun optional(): Boolean
|
||||
|
||||
@JsonOptionalField
|
||||
override fun description(): String
|
||||
override fun description(): String?
|
||||
|
||||
@JsonOptionalField
|
||||
public fun hidden(): Boolean
|
||||
}
|
||||
|
||||
@JsonType
|
||||
public interface Event {
|
||||
public fun name(): String
|
||||
interface Event {
|
||||
fun name(): String
|
||||
|
||||
@JsonOptionalField
|
||||
public fun parameters(): List<Parameter>
|
||||
fun parameters(): List<Parameter>?
|
||||
|
||||
@JsonOptionalField
|
||||
public fun description(): String
|
||||
fun description(): String?
|
||||
|
||||
@JsonOptionalField
|
||||
public fun hidden(): Boolean
|
||||
fun hidden(): Boolean
|
||||
}
|
||||
|
||||
@JsonType
|
||||
public interface StandaloneType : ItemDescriptor.Type {
|
||||
public fun id(): String
|
||||
interface StandaloneType : ItemDescriptor.Type {
|
||||
fun id(): String
|
||||
|
||||
@JsonOptionalField
|
||||
override fun description(): String?
|
||||
@@ -156,66 +156,66 @@ public interface ProtocolMetaModel {
|
||||
public fun hidden(): Boolean
|
||||
|
||||
@JsonOptionalField
|
||||
override fun properties(): List<ObjectProperty>
|
||||
override fun properties(): List<ObjectProperty>?
|
||||
|
||||
@JsonField(name = "enum", optional = true)
|
||||
override fun getEnum(): List<String>
|
||||
override fun getEnum(): List<String>?
|
||||
|
||||
@JsonOptionalField
|
||||
override fun items(): ArrayItemType
|
||||
override fun items(): ArrayItemType?
|
||||
}
|
||||
|
||||
|
||||
@JsonType
|
||||
public interface ArrayItemType : ItemDescriptor.Type, ItemDescriptor.Referenceable {
|
||||
interface ArrayItemType : ItemDescriptor.Type, ItemDescriptor.Referenceable {
|
||||
@JsonOptionalField
|
||||
override fun description(): String
|
||||
override fun description(): String?
|
||||
|
||||
@JsonOptionalField
|
||||
public fun optional(): Boolean
|
||||
|
||||
@JsonOptionalField
|
||||
override fun type(): String
|
||||
override fun type(): String?
|
||||
|
||||
@JsonOptionalField
|
||||
override fun items(): ArrayItemType
|
||||
override fun items(): ArrayItemType?
|
||||
|
||||
@JsonField(name = "\$ref", optional = true)
|
||||
override fun ref(): String
|
||||
override fun ref(): String?
|
||||
|
||||
@JsonField(name = "enum", optional = true)
|
||||
override fun getEnum(): List<String>
|
||||
override fun getEnum(): List<String>?
|
||||
|
||||
@JsonOptionalField
|
||||
override fun properties(): List<ObjectProperty>
|
||||
override fun properties(): List<ObjectProperty>?
|
||||
}
|
||||
|
||||
@JsonType
|
||||
public interface ObjectProperty : ItemDescriptor.Named {
|
||||
interface ObjectProperty : ItemDescriptor.Named {
|
||||
override fun name(): String
|
||||
|
||||
@JsonOptionalField
|
||||
override fun shortName(): String
|
||||
override fun shortName(): String?
|
||||
|
||||
@JsonOptionalField
|
||||
override fun description(): String
|
||||
override fun description(): String?
|
||||
|
||||
@JsonOptionalField
|
||||
override fun optional(): Boolean
|
||||
|
||||
@JsonOptionalField
|
||||
override fun type(): String
|
||||
override fun type(): String?
|
||||
|
||||
@JsonOptionalField
|
||||
override fun items(): ArrayItemType
|
||||
override fun items(): ArrayItemType?
|
||||
|
||||
@JsonField(name = "\$ref", optional = true)
|
||||
override fun ref(): String
|
||||
override fun ref(): String?
|
||||
|
||||
@JsonField(name = "enum", optional = true)
|
||||
override fun getEnum(): List<String>
|
||||
override fun getEnum(): List<String>?
|
||||
|
||||
@JsonOptionalField
|
||||
public fun hidden(): Boolean
|
||||
fun hidden(): Boolean
|
||||
}
|
||||
}
|
||||
@@ -86,26 +86,24 @@ class IcsManager(dir: File) {
|
||||
|
||||
val repositoryService: RepositoryService = GitRepositoryService()
|
||||
|
||||
private val commitAlarm = SingleAlarm(object : Runnable {
|
||||
override fun run() {
|
||||
ProgressManager.getInstance().run(object : Task.Backgroundable(null, icsMessage("task.commit.title")) {
|
||||
override fun run(indicator: ProgressIndicator) {
|
||||
try {
|
||||
repositoryManager.commit(indicator, fixStateIfCannotCommit = false)
|
||||
}
|
||||
catch (e: Throwable) {
|
||||
LOG.error(e)
|
||||
}
|
||||
private val commitAlarm = SingleAlarm(Runnable {
|
||||
ProgressManager.getInstance().run(object : Task.Backgroundable(null, icsMessage("task.commit.title")) {
|
||||
override fun run(indicator: ProgressIndicator) {
|
||||
try {
|
||||
repositoryManager.commit(indicator, fixStateIfCannotCommit = false)
|
||||
}
|
||||
})
|
||||
}
|
||||
catch (e: Throwable) {
|
||||
LOG.error(e)
|
||||
}
|
||||
}
|
||||
})
|
||||
}, settings.commitDelay)
|
||||
|
||||
private @Volatile var autoCommitEnabled = true
|
||||
|
||||
@Volatile var repositoryActive = false
|
||||
|
||||
val autoSyncManager = AutoSyncManager(this)
|
||||
internal val autoSyncManager = AutoSyncManager(this)
|
||||
private val syncManager = SyncManager(this, autoSyncManager)
|
||||
|
||||
private fun scheduleCommit() {
|
||||
|
||||
@@ -28,11 +28,11 @@ import org.jetbrains.jgit.dirCache.deletePath
|
||||
import org.jetbrains.jgit.dirCache.writePath
|
||||
import org.jetbrains.settingsRepository.RepositoryVirtualFile
|
||||
import java.nio.CharBuffer
|
||||
import java.util.ArrayList
|
||||
import java.util.*
|
||||
|
||||
internal fun conflictsToVirtualFiles(map: Map<String, Any>): MutableList<VirtualFile> {
|
||||
val result = ArrayList<VirtualFile>(map.size())
|
||||
for (path in map.keySet()) {
|
||||
val result = ArrayList<VirtualFile>(map.size)
|
||||
for (path in map.keys) {
|
||||
result.add(RepositoryVirtualFile(path))
|
||||
}
|
||||
return result
|
||||
@@ -44,7 +44,7 @@ internal fun conflictsToVirtualFiles(map: Map<String, Any>): MutableList<Virtual
|
||||
* Base - missed (no base).
|
||||
*/
|
||||
class JGitMergeProvider<T>(private val repository: Repository, private val conflicts: Map<String, T>, private val pathToContent: Map<String, T>.(path: String, index: Int) -> ByteArray?) : MergeProvider2 {
|
||||
override fun createMergeSession(files: List<VirtualFile>) = JGitMergeSession()
|
||||
override fun createMergeSession(files: List<VirtualFile>): MergeSession = JGitMergeSession()
|
||||
|
||||
override fun conflictResolvedForFile(file: VirtualFile) {
|
||||
// we can postpone dir cache update (on merge dialog close) to reduce number of flush, but it can leads to data loss (if app crashed during merge - nothing will be saved)
|
||||
@@ -61,7 +61,7 @@ class JGitMergeProvider<T>(private val repository: Repository, private val confl
|
||||
}
|
||||
}
|
||||
|
||||
private fun addFile(bytes: ByteArray, file: VirtualFile, size: Int = bytes.size()) {
|
||||
private fun addFile(bytes: ByteArray, file: VirtualFile, size: Int = bytes.size) {
|
||||
repository.writePath(file.path, bytes, size)
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ import java.util.*
|
||||
|
||||
private val LOG_1 = org.jetbrains.settingsRepository.LOG
|
||||
|
||||
class SyncManager(private val icsManager: IcsManager, private val autoSyncManager: AutoSyncManager) {
|
||||
internal class SyncManager(private val icsManager: IcsManager, private val autoSyncManager: AutoSyncManager) {
|
||||
@Volatile var writeAndDeleteProhibited = false
|
||||
private set
|
||||
|
||||
@@ -157,29 +157,27 @@ internal fun updateStoragesFromStreamProvider(store: ComponentStoreImpl, updateR
|
||||
return false
|
||||
}
|
||||
|
||||
return UIUtil.invokeAndWaitIfNeeded(object : Computable<Boolean> {
|
||||
override fun compute(): Boolean {
|
||||
val notReloadableComponents: Collection<String>
|
||||
updateStateStorage(changedComponentNames, changed, false)
|
||||
updateStateStorage(changedComponentNames, deleted, true)
|
||||
return UIUtil.invokeAndWaitIfNeeded(Computable<kotlin.Boolean> {
|
||||
val notReloadableComponents: Collection<String>
|
||||
updateStateStorage(changedComponentNames, changed, false)
|
||||
updateStateStorage(changedComponentNames, deleted, true)
|
||||
|
||||
if (changedComponentNames.isEmpty()) {
|
||||
return false
|
||||
}
|
||||
|
||||
notReloadableComponents = store.getNotReloadableComponents(changedComponentNames)
|
||||
|
||||
val changedStorageSet = THashSet<StateStorage>(changed)
|
||||
changedStorageSet.addAll(deleted)
|
||||
runBatchUpdate(messageBus) {
|
||||
store.reinitComponents(changedComponentNames, changedStorageSet, notReloadableComponents)
|
||||
}
|
||||
|
||||
if (notReloadableComponents.isEmpty()) {
|
||||
return false
|
||||
}
|
||||
return askToRestart(store, notReloadableComponents, null, true)
|
||||
if (changedComponentNames.isEmpty()) {
|
||||
return@Computable false
|
||||
}
|
||||
|
||||
notReloadableComponents = store.getNotReloadableComponents(changedComponentNames)
|
||||
|
||||
val changedStorageSet = THashSet<StateStorage>(changed)
|
||||
changedStorageSet.addAll(deleted)
|
||||
runBatchUpdate(messageBus) {
|
||||
store.reinitComponents(changedComponentNames, changedStorageSet, notReloadableComponents)
|
||||
}
|
||||
|
||||
if (notReloadableComponents.isEmpty()) {
|
||||
return@Computable false
|
||||
}
|
||||
askToRestart(store, notReloadableComponents, null, true)
|
||||
})!!
|
||||
}
|
||||
|
||||
@@ -200,6 +198,6 @@ enum class SyncType {
|
||||
OVERWRITE_REMOTE
|
||||
}
|
||||
|
||||
class NoRemoteRepositoryException(cause: Throwable) : RuntimeException(cause.getMessage(), cause)
|
||||
class NoRemoteRepositoryException(cause: Throwable) : RuntimeException(cause.message, cause)
|
||||
|
||||
class CannotResolveConflictInTestMode() : RuntimeException()
|
||||
Reference in New Issue
Block a user