diff --git a/harness/tests/src/main/kotlin/godot/tests/rpctests/RpcTests.kt b/harness/tests/src/main/kotlin/godot/tests/rpctests/RpcTests.kt index 362e88139a..022b1e71c0 100644 --- a/harness/tests/src/main/kotlin/godot/tests/rpctests/RpcTests.kt +++ b/harness/tests/src/main/kotlin/godot/tests/rpctests/RpcTests.kt @@ -1,11 +1,7 @@ package godot.tests.rpctests import godot.Node -import godot.annotation.RegisterClass -import godot.annotation.RegisterFunction -import godot.annotation.RegisterProperty -import godot.annotation.Rpc -import godot.annotation.Sync +import godot.annotation.* @RegisterClass("RPCTests") class RpcTests : Node() { diff --git a/kt/plugins/godot-intellij-plugin/src/main/kotlin/godot/intellij/plugin/annotator/function/RpcAnnotator.kt b/kt/plugins/godot-intellij-plugin/src/main/kotlin/godot/intellij/plugin/annotator/function/RpcAnnotator.kt new file mode 100644 index 0000000000..4394f51faa --- /dev/null +++ b/kt/plugins/godot-intellij-plugin/src/main/kotlin/godot/intellij/plugin/annotator/function/RpcAnnotator.kt @@ -0,0 +1,68 @@ +package godot.intellij.plugin.annotator.function + +import com.intellij.codeInspection.ProblemHighlightType +import com.intellij.lang.annotation.AnnotationHolder +import com.intellij.lang.annotation.Annotator +import com.intellij.psi.PsiElement +import godot.intellij.plugin.GodotPluginBundle +import godot.intellij.plugin.data.model.RPC_ANNOTATION +import godot.intellij.plugin.extension.isInGodotRoot +import godot.intellij.plugin.extension.registerProblem +import godot.intellij.plugin.quickfix.TransferModeIgnoresChannelQuickFix +import org.jetbrains.kotlin.idea.refactoring.fqName.getKotlinFqName +import org.jetbrains.kotlin.idea.util.findAnnotation +import org.jetbrains.kotlin.name.FqName +import org.jetbrains.kotlin.nj2k.postProcessing.resolve +import org.jetbrains.kotlin.psi.KtAnnotated +import org.jetbrains.kotlin.psi.KtNameReferenceExpression +import org.jetbrains.kotlin.psi.psiUtil.getChildOfType + +class RpcAnnotator : Annotator { + private val transferModeIgnoresChannelQuickFix by lazy { TransferModeIgnoresChannelQuickFix() } + + override fun annotate(element: PsiElement, holder: AnnotationHolder) { + if (!element.isInGodotRoot()) return + + if (element is KtAnnotated && element.findAnnotation(FqName(RPC_ANNOTATION)) != null) { + val valueArgumentList = element.findAnnotation(FqName(RPC_ANNOTATION))?.valueArgumentList ?: return + + val transferModeValueArgument = valueArgumentList + .arguments + .firstOrNull { it.isNamed() && it.getArgumentName()?.text == "transferMode" } // named; so position is not relevant + ?: valueArgumentList + .arguments + .getOrNull(2) // not named; so getting by argument position + + val isTransferModeUnreliableOrdered = transferModeValueArgument + ?.getArgumentExpression() + ?.getChildOfType() + ?.resolve() + ?.getKotlinFqName() + ?.asString() == "godot.annotation.TransferMode.UNRELIABLE_ORDERED" + + val channelElement = valueArgumentList + .arguments + .firstOrNull { it.isNamed() && it.getArgumentName()?.text == "transferChannel" } // named; so position is not relevant + ?: valueArgumentList + .arguments + .getOrNull(3)// not named; so getting by argument position + + val channel = if (channelElement?.isNamed() == true) { + channelElement.text.substringAfterLast("=").trim() + } else { + channelElement?.text + } + ?.removeSurrounding("\"") + ?.toIntOrNull() ?: 0 + + if (channelElement != null && !isTransferModeUnreliableOrdered && channel != 0) { + holder.registerProblem( + message = GodotPluginBundle.message("problem.function.rpcChannelSetWhenTransferTypeIgnoresIt"), + errorLocation = channelElement, + quickFixes = arrayOf(transferModeIgnoresChannelQuickFix), + problemHighlightType = ProblemHighlightType.WEAK_WARNING + ) + } + } + } +} diff --git a/kt/plugins/godot-intellij-plugin/src/main/kotlin/godot/intellij/plugin/annotator/reference/FunctionReferenceAnnotator.kt b/kt/plugins/godot-intellij-plugin/src/main/kotlin/godot/intellij/plugin/annotator/reference/FunctionReferenceAnnotator.kt index 5b8e2d34d2..3d0c0485ea 100644 --- a/kt/plugins/godot-intellij-plugin/src/main/kotlin/godot/intellij/plugin/annotator/reference/FunctionReferenceAnnotator.kt +++ b/kt/plugins/godot-intellij-plugin/src/main/kotlin/godot/intellij/plugin/annotator/reference/FunctionReferenceAnnotator.kt @@ -14,7 +14,6 @@ class FunctionReferenceAnnotator : Annotator { is KtCallableReferenceExpression -> { SignalFunctionReferenceChecker.checkSignalConnectionFunction(element, holder) RpcFunctionReferenceChecker.checkRpcTargetFunction(element, holder) - RSetPropertyReferenceChecker.checkRpcTargetProperty(element, holder) CallFunctionReferenceChecker.checkGeneralTargetFunction(element, holder) } } diff --git a/kt/plugins/godot-intellij-plugin/src/main/kotlin/godot/intellij/plugin/annotator/reference/RSetPropertyReferenceChecker.kt b/kt/plugins/godot-intellij-plugin/src/main/kotlin/godot/intellij/plugin/annotator/reference/RSetPropertyReferenceChecker.kt index 220ba416ce..e69de29bb2 100644 --- a/kt/plugins/godot-intellij-plugin/src/main/kotlin/godot/intellij/plugin/annotator/reference/RSetPropertyReferenceChecker.kt +++ b/kt/plugins/godot-intellij-plugin/src/main/kotlin/godot/intellij/plugin/annotator/reference/RSetPropertyReferenceChecker.kt @@ -1,79 +0,0 @@ -package godot.intellij.plugin.annotator.reference - -import com.intellij.lang.annotation.AnnotationHolder -import godot.intellij.plugin.GodotPluginBundle -import godot.intellij.plugin.data.model.REGISTER_PROPERTY_ANNOTATION -import godot.intellij.plugin.extension.registerProblem -import godot.intellij.plugin.quickfix.TargetPropertyNotRegisteredQuickFix -import org.jetbrains.kotlin.idea.base.utils.fqname.getKotlinFqName -import org.jetbrains.kotlin.idea.util.findAnnotation -import org.jetbrains.kotlin.name.FqName -import org.jetbrains.kotlin.nj2k.postProcessing.resolve -import org.jetbrains.kotlin.psi.KtCallExpression -import org.jetbrains.kotlin.psi.KtCallableReferenceExpression -import org.jetbrains.kotlin.psi.KtNameReferenceExpression -import org.jetbrains.kotlin.psi.KtNamedFunction -import org.jetbrains.kotlin.psi.KtProperty -import org.jetbrains.kotlin.psi.KtValueArgument -import org.jetbrains.kotlin.psi.psiUtil.containingClass -import org.jetbrains.kotlin.psi.psiUtil.getChildOfType -import org.jetbrains.kotlin.psi.psiUtil.getChildrenOfType -import org.jetbrains.kotlin.utils.addToStdlib.firstIsInstanceOrNull - -object RSetPropertyReferenceChecker { - private val rsetFunctionNames = listOf( - "rset", - "rsetId", - "rsetUnreliable", - "rsetUnreliableId", - ) - - fun checkRpcTargetProperty(element: KtCallableReferenceExpression, holder: AnnotationHolder) { - val relevantParent = element.parent.parent.parent - val propertyReference = relevantParent.children.firstIsInstanceOrNull() - if ( - relevantParent is KtCallExpression && - rsetFunctionNames.contains(propertyReference?.text) && - (propertyReference?.resolve() as? KtNamedFunction)?.containingClass()?.fqName?.asString() == "godot.Node" - ) { - val targetProperty = element - .callableReference - .resolve() as? KtProperty - - val registerPropertyAnnotation = targetProperty?.findAnnotation(FqName(REGISTER_PROPERTY_ANNOTATION)) - if (targetProperty != null && registerPropertyAnnotation == null) { - holder.registerProblem( - GodotPluginBundle.message("problem.rpc.calledPropertyNotRegistered"), - element, - TargetPropertyNotRegisteredQuickFix() - ) - } else { - if ( - registerPropertyAnnotation?.valueArguments?.isEmpty() == true || - registerPropertyAnnotation - ?.valueArgumentList - ?.getChildrenOfType() - ?.mapNotNull { ktValueArgument -> - ktValueArgument - .getArgumentExpression() - ?.getChildOfType() - ?.resolve() - ?.getKotlinFqName() - ?.asString() - } - ?.filter { fqName -> - fqName.startsWith("godot.MultiplayerAPI.RPCMode") - } - ?.any { fqName -> - fqName == "godot.MultiplayerAPI.RPCMode.DISABLED" - } == true - ) { - holder.registerProblem( - GodotPluginBundle.message("problem.rpc.calledPropertyNotAccessible"), - element - ) - } - } - } - } -} diff --git a/kt/plugins/godot-intellij-plugin/src/main/kotlin/godot/intellij/plugin/annotator/reference/RpcFunctionReferenceChecker.kt b/kt/plugins/godot-intellij-plugin/src/main/kotlin/godot/intellij/plugin/annotator/reference/RpcFunctionReferenceChecker.kt index 7faa385436..22422c6da3 100644 --- a/kt/plugins/godot-intellij-plugin/src/main/kotlin/godot/intellij/plugin/annotator/reference/RpcFunctionReferenceChecker.kt +++ b/kt/plugins/godot-intellij-plugin/src/main/kotlin/godot/intellij/plugin/annotator/reference/RpcFunctionReferenceChecker.kt @@ -3,8 +3,11 @@ package godot.intellij.plugin.annotator.reference import com.intellij.lang.annotation.AnnotationHolder import godot.intellij.plugin.GodotPluginBundle import godot.intellij.plugin.data.model.REGISTER_FUNCTION_ANNOTATION +import godot.intellij.plugin.data.model.RPC_ANNOTATION import godot.intellij.plugin.extension.registerProblem import godot.intellij.plugin.quickfix.TargetFunctionNotRegisteredQuickFix +import godot.intellij.plugin.quickfix.TargetFunctionHasNoRpcAnnotationQuickFix +import godot.intellij.plugin.quickfix.TargetFunctionsRpcAnnotationHasRpcModeDisabled import org.jetbrains.kotlin.idea.base.utils.fqname.getKotlinFqName import org.jetbrains.kotlin.idea.util.findAnnotation import org.jetbrains.kotlin.name.FqName @@ -13,9 +16,8 @@ import org.jetbrains.kotlin.psi.KtCallExpression import org.jetbrains.kotlin.psi.KtCallableReferenceExpression import org.jetbrains.kotlin.psi.KtNameReferenceExpression import org.jetbrains.kotlin.psi.KtNamedFunction -import org.jetbrains.kotlin.psi.KtValueArgument import org.jetbrains.kotlin.psi.psiUtil.containingClass -import org.jetbrains.kotlin.psi.psiUtil.getChildOfType +import org.jetbrains.kotlin.psi.psiUtil.getChildrenOfType import org.jetbrains.kotlin.utils.addToStdlib.firstIsInstanceOrNull object RpcFunctionReferenceChecker { @@ -26,6 +28,10 @@ object RpcFunctionReferenceChecker { "rpcUnreliableId", ) + private val targetFunctionNotRegisteredQuickFix by lazy { TargetFunctionNotRegisteredQuickFix() } + private val targetFunctionHasNoRpcAnnotationQuickFix by lazy { TargetFunctionHasNoRpcAnnotationQuickFix() } + private val targetFunctionsRpcAnnotationHasRpcModeDisabled by lazy { TargetFunctionsRpcAnnotationHasRpcModeDisabled() } + fun checkRpcTargetFunction(element: KtCallableReferenceExpression, holder: AnnotationHolder) { val relevantParent = element.parent.parent.parent val callReference = relevantParent.children.firstIsInstanceOrNull() @@ -39,29 +45,49 @@ object RpcFunctionReferenceChecker { .resolve() as? KtNamedFunction val registerFunctionAnnotation = targetFunction?.findAnnotation(FqName(REGISTER_FUNCTION_ANNOTATION)) - if (targetFunction != null && registerFunctionAnnotation == null) { - holder.registerProblem( - GodotPluginBundle.message("problem.rpc.calledFunctionNotRegistered"), - element, - TargetFunctionNotRegisteredQuickFix() - ) - } else { - if ( - registerFunctionAnnotation?.valueArguments?.isEmpty() == true || - registerFunctionAnnotation - ?.valueArgumentList - ?.getChildOfType() - ?.getArgumentExpression() - ?.getChildOfType() - ?.resolve() - ?.getKotlinFqName() - ?.asString() == "godot.MultiplayerAPI.RPCMode.DISABLED" - ) { + val rpcAnnotation = targetFunction?.findAnnotation(FqName(RPC_ANNOTATION)) + + when { + targetFunction != null && registerFunctionAnnotation == null -> { holder.registerProblem( - GodotPluginBundle.message("problem.rpc.calledFunctionNotAccessible"), - element + GodotPluginBundle.message("problem.rpc.calledFunctionNotRegistered"), + element, + targetFunctionNotRegisteredQuickFix ) } + targetFunction != null && rpcAnnotation == null -> { + holder.registerProblem( + GodotPluginBundle.message("problem.rpc.calledFunctionHasNoRpcAnnotation"), + element, + targetFunctionHasNoRpcAnnotationQuickFix + ) + } + else -> { + val rpcModeValueArgument = rpcAnnotation + ?.valueArgumentList + ?.arguments + ?.firstOrNull { it.isNamed() && it.getArgumentName()?.text == "rpcMode" } // named; so position is not relevant + ?: rpcAnnotation + ?.valueArgumentList + ?.arguments + ?.getOrNull(0) // not named; so getting by argument position + + if ( + rpcModeValueArgument + ?.getArgumentExpression() + ?.getChildrenOfType() + ?.lastOrNull() + ?.resolve() + ?.getKotlinFqName() + ?.asString() == "godot.annotation.RpcMode.DISABLED" + ) { + holder.registerProblem( + GodotPluginBundle.message("problem.rpc.calledFunctionNotAccessible"), + element, + targetFunctionsRpcAnnotationHasRpcModeDisabled + ) + } + } } } } diff --git a/kt/plugins/godot-intellij-plugin/src/main/kotlin/godot/intellij/plugin/annotator/signal/RegisterSignalAnnotator.kt b/kt/plugins/godot-intellij-plugin/src/main/kotlin/godot/intellij/plugin/annotator/signal/RegisterSignalAnnotator.kt index db97bec032..ec5971a70e 100644 --- a/kt/plugins/godot-intellij-plugin/src/main/kotlin/godot/intellij/plugin/annotator/signal/RegisterSignalAnnotator.kt +++ b/kt/plugins/godot-intellij-plugin/src/main/kotlin/godot/intellij/plugin/annotator/signal/RegisterSignalAnnotator.kt @@ -32,10 +32,10 @@ class RegisterSignalAnnotator : Annotator { private fun checkMutability(ktProperty: KtProperty, holder: AnnotationHolder) { if (ktProperty.isVar) { holder.registerProblem( - GodotPluginBundle.message("problem.signal.mutability"), - ktProperty.valOrVarKeyword, - mutabilityQuickFix, - ProblemHighlightType.WARNING + message = GodotPluginBundle.message("problem.signal.mutability"), + errorLocation = ktProperty.valOrVarKeyword, + quickFixes = arrayOf(mutabilityQuickFix), + problemHighlightType = ProblemHighlightType.WARNING, ) } } @@ -44,9 +44,9 @@ class RegisterSignalAnnotator : Annotator { val type = ktProperty.type() ?: return if (!type.getJetTypeFqName(false).startsWith("godot.signals.Signal")) { holder.registerProblem( - GodotPluginBundle.message("problem.signal.wrongType"), - getInitializerProblemLocation(ktProperty), - useDelegateQuickFix + message = GodotPluginBundle.message("problem.signal.wrongType"), + errorLocation = getInitializerProblemLocation(ktProperty), + quickFixes = arrayOf(useDelegateQuickFix) ) } } diff --git a/kt/plugins/godot-intellij-plugin/src/main/kotlin/godot/intellij/plugin/data/model/annotations.kt b/kt/plugins/godot-intellij-plugin/src/main/kotlin/godot/intellij/plugin/data/model/annotations.kt index 9d516ec6c3..539563f767 100644 --- a/kt/plugins/godot-intellij-plugin/src/main/kotlin/godot/intellij/plugin/data/model/annotations.kt +++ b/kt/plugins/godot-intellij-plugin/src/main/kotlin/godot/intellij/plugin/data/model/annotations.kt @@ -8,3 +8,4 @@ const val REGISTER_PROPERTY_ANNOTATION = "godot.annotation.RegisterProperty" const val EXPORT_ANNOTATION = "godot.annotation.Export" const val REGISTER_SIGNAL_ANNOTATION = "godot.annotation.RegisterSignal" const val CORE_TYPE_HELPER_ANNOTATION = "godot.annotation.CoreTypeHelper" +const val RPC_ANNOTATION = "godot.annotation.Rpc" diff --git a/kt/plugins/godot-intellij-plugin/src/main/kotlin/godot/intellij/plugin/extension/annotationHolderExt.kt b/kt/plugins/godot-intellij-plugin/src/main/kotlin/godot/intellij/plugin/extension/annotationHolderExt.kt index e7a9fefabc..45b4e5b0a1 100644 --- a/kt/plugins/godot-intellij-plugin/src/main/kotlin/godot/intellij/plugin/extension/annotationHolderExt.kt +++ b/kt/plugins/godot-intellij-plugin/src/main/kotlin/godot/intellij/plugin/extension/annotationHolderExt.kt @@ -7,9 +7,10 @@ import com.intellij.lang.annotation.AnnotationHolder import com.intellij.lang.annotation.HighlightSeverity import com.intellij.psi.PsiElement -fun AnnotationHolder.registerProblem(message: String, errorLocation: PsiElement, quickFix: LocalQuickFix? = null, problemHighlightType: ProblemHighlightType = ProblemHighlightType.GENERIC_ERROR) { +fun AnnotationHolder.registerProblem(message: String, errorLocation: PsiElement, vararg quickFixes: LocalQuickFix = arrayOf(), problemHighlightType: ProblemHighlightType = ProblemHighlightType.GENERIC_ERROR) { val annotationBuilder = newAnnotation(highlightSeverityFromHighlightType(problemHighlightType), message) - if (quickFix != null) { + + quickFixes.forEach { quickFix -> annotationBuilder .newLocalQuickFix( quickFix, @@ -17,6 +18,7 @@ fun AnnotationHolder.registerProblem(message: String, errorLocation: PsiElement, ) .registerFix() } + annotationBuilder .range(errorLocation) .highlightType(problemHighlightType) diff --git a/kt/plugins/godot-intellij-plugin/src/main/kotlin/godot/intellij/plugin/quickfix/TargetFunctionHasNoRpcAnnotationQuickFix.kt b/kt/plugins/godot-intellij-plugin/src/main/kotlin/godot/intellij/plugin/quickfix/TargetFunctionHasNoRpcAnnotationQuickFix.kt new file mode 100644 index 0000000000..d32736d1fa --- /dev/null +++ b/kt/plugins/godot-intellij-plugin/src/main/kotlin/godot/intellij/plugin/quickfix/TargetFunctionHasNoRpcAnnotationQuickFix.kt @@ -0,0 +1,24 @@ +package godot.intellij.plugin.quickfix + +import com.intellij.codeInspection.LocalQuickFix +import com.intellij.codeInspection.ProblemDescriptor +import com.intellij.openapi.project.Project +import godot.intellij.plugin.GodotPluginBundle +import godot.intellij.plugin.data.model.RPC_ANNOTATION +import org.jetbrains.kotlin.idea.util.addAnnotation +import org.jetbrains.kotlin.name.FqName +import org.jetbrains.kotlin.nj2k.postProcessing.resolve +import org.jetbrains.kotlin.psi.KtCallableReferenceExpression +import org.jetbrains.kotlin.psi.KtNamedFunction + +class TargetFunctionHasNoRpcAnnotationQuickFix : LocalQuickFix { + override fun getFamilyName(): String = GodotPluginBundle.message("quickFix.function.connectedFunctionHasNoRpcAnnotationRegistered.familyName") + + override fun applyFix(project: Project, descriptor: ProblemDescriptor) { + val ktNamedFunction = (descriptor.psiElement as? KtCallableReferenceExpression) + ?.callableReference + ?.resolve() as? KtNamedFunction + + ktNamedFunction?.addAnnotation(FqName(RPC_ANNOTATION)) + } +} diff --git a/kt/plugins/godot-intellij-plugin/src/main/kotlin/godot/intellij/plugin/quickfix/TargetFunctionsRpcAnnotationHasRpcModeDisabled.kt b/kt/plugins/godot-intellij-plugin/src/main/kotlin/godot/intellij/plugin/quickfix/TargetFunctionsRpcAnnotationHasRpcModeDisabled.kt new file mode 100644 index 0000000000..6491e63081 --- /dev/null +++ b/kt/plugins/godot-intellij-plugin/src/main/kotlin/godot/intellij/plugin/quickfix/TargetFunctionsRpcAnnotationHasRpcModeDisabled.kt @@ -0,0 +1,35 @@ +package godot.intellij.plugin.quickfix + +import com.intellij.codeInspection.LocalQuickFix +import com.intellij.codeInspection.ProblemDescriptor +import com.intellij.openapi.project.Project +import godot.intellij.plugin.GodotPluginBundle +import godot.intellij.plugin.data.model.RPC_ANNOTATION +import org.jetbrains.kotlin.idea.util.findAnnotation +import org.jetbrains.kotlin.name.FqName +import org.jetbrains.kotlin.nj2k.postProcessing.resolve +import org.jetbrains.kotlin.psi.KtCallableReferenceExpression +import org.jetbrains.kotlin.psi.KtNamedFunction + +class TargetFunctionsRpcAnnotationHasRpcModeDisabled : LocalQuickFix { + override fun getFamilyName(): String = GodotPluginBundle.message("quickFix.function.connectedFunctionsRpcAnnotationHasRpcModeDisabled.familyName") + + override fun applyFix(project: Project, descriptor: ProblemDescriptor) { + val ktNamedFunction = (descriptor.psiElement as? KtCallableReferenceExpression) + ?.callableReference + ?.resolve() as? KtNamedFunction + + val rpcAnnotationValueArgumentList = ktNamedFunction + ?.findAnnotation(FqName(RPC_ANNOTATION)) + ?.valueArgumentList + + val rpcModeValueArgument = rpcAnnotationValueArgumentList + ?.arguments + ?.firstOrNull { it.isNamed() && it.getArgumentName()?.text == "rpcMode" } // named; so position is not relevant + ?: rpcAnnotationValueArgumentList + ?.arguments + ?.getOrNull(0) // not named; so getting by argument position + + rpcModeValueArgument?.let { rpcAnnotationValueArgumentList?.removeArgument(it) } + } +} diff --git a/kt/plugins/godot-intellij-plugin/src/main/kotlin/godot/intellij/plugin/quickfix/TransferModeIgnoresChannelQuickFix.kt b/kt/plugins/godot-intellij-plugin/src/main/kotlin/godot/intellij/plugin/quickfix/TransferModeIgnoresChannelQuickFix.kt new file mode 100644 index 0000000000..99ec8c812a --- /dev/null +++ b/kt/plugins/godot-intellij-plugin/src/main/kotlin/godot/intellij/plugin/quickfix/TransferModeIgnoresChannelQuickFix.kt @@ -0,0 +1,17 @@ +package godot.intellij.plugin.quickfix + +import com.intellij.codeInspection.LocalQuickFix +import com.intellij.codeInspection.ProblemDescriptor +import com.intellij.openapi.project.Project +import godot.intellij.plugin.GodotPluginBundle +import org.jetbrains.kotlin.psi.KtValueArgument +import org.jetbrains.kotlin.psi.KtValueArgumentList + +class TransferModeIgnoresChannelQuickFix : LocalQuickFix { + override fun getFamilyName(): String = GodotPluginBundle.message("quickFix.function.rpcTransferModeIgnoresChannel.familyName") + + override fun applyFix(project: Project, descriptor: ProblemDescriptor) { + val channelValueArgument = descriptor.psiElement as? KtValueArgument ?: return + (channelValueArgument.parent as? KtValueArgumentList)?.removeArgument(channelValueArgument) + } +} diff --git a/kt/plugins/godot-intellij-plugin/src/main/resources/META-INF/plugin.xml b/kt/plugins/godot-intellij-plugin/src/main/resources/META-INF/plugin.xml index 8e82ddac47..bf049512d8 100644 --- a/kt/plugins/godot-intellij-plugin/src/main/resources/META-INF/plugin.xml +++ b/kt/plugins/godot-intellij-plugin/src/main/resources/META-INF/plugin.xml @@ -23,6 +23,7 @@ + diff --git a/kt/plugins/godot-intellij-plugin/src/main/resources/messages/generalLabels.properties b/kt/plugins/godot-intellij-plugin/src/main/resources/messages/generalLabels.properties index 3d0499bb83..10c3029e9c 100644 --- a/kt/plugins/godot-intellij-plugin/src/main/resources/messages/generalLabels.properties +++ b/kt/plugins/godot-intellij-plugin/src/main/resources/messages/generalLabels.properties @@ -35,6 +35,7 @@ problem.function.notificationFunctionNotRegistered=Overridden notification funct Using notification functions for other purposes than to be called from Godot is considered a bad practise.\n\ Either register it or move your logic to a custom function you defined problem.function.overriddenAbstractFunctionNotRegistered=Overrides registered abstract function without registering itself. Without explicit @RegisterFunction annotation on overridden functions, they cannot be called from godot. +problem.function.rpcChannelSetWhenTransferTypeIgnoresIt=Other values than 0 will be ignored if \"transferMode\" is not set to UNRELIABLE_ORDERED problem.property.hint.wrongType=Property must be of type {0} problem.property.hint.notRegistered=Property has a type hint but is not registered problem.property.hint.notExported=Property has a type hint but is not exported. This type hint will do nothing @@ -49,9 +50,8 @@ problem.signal.mutability=Registered signals have to be mutable problem.signal.wrongType=Not of type signal. Properties annotated with @RegisterSignal have to be of type signal. Consider using one of the "by signal" delegates problem.signal.connection.connectedFunctionNotRegistered=Function not registered. Functions used as target for signal emission have to be registered problem.rpc.calledFunctionNotRegistered=Function not registered. Functions called by rpc have to be registered -problem.rpc.calledPropertyNotRegistered=Property not registered. Properties set with rset have to be registered +problem.rpc.calledFunctionHasNoRpcAnnotation=Function has no Rpc Annotation. Functions called by rpc have to be configured problem.rpc.calledFunctionNotAccessible=Function not accessible. Functions called by rpc cannot have RPCMode.DISABLED -problem.rpc.calledPropertyNotAccessible=Property not accessible. Properties set with rset cannot have RPCMode.DISABLED problem.general.calledFunctionNotRegistered=Target function not registered problem.general.modificationOfCoreTypeCopy=You're modifying a copy of a CoreType. Either re assign this copy to it's parent or use it elsewhere after the modification.\ For more information's, visit the documentation.\ @@ -63,7 +63,10 @@ quickFix.property.notRegistered.familyName=Add @RegisterProperty annotation quickFix.property.notExported.familyName=Add @Export annotation quickFix.property.removeExportAnnotation.familyName=Remove @Export annotation quickFix.function.notificationFunctionNotRegistered.familyName=Add @RegisterFunction annotation +quickFix.function.rpcTransferModeIgnoresChannel.familyName=Remove channel parameter quickFix.function.connectedFunctionNotRegistered.familyName=Add @RegisterFunction annotation +quickFix.function.connectedFunctionHasNoRpcAnnotationRegistered.familyName=Add @Rpc annotation +quickFix.function.connectedFunctionsRpcAnnotationHasRpcModeDisabled.familyName=Remove RpcMode.DISABLED from target's @Rpc annotation quickFix.property.connectedPropertyNotRegistered.familyName=Add @RegisterProperty annotation quickFix.property.mutability.familyName=Make property mutable notification.property.mutability.error.title=@RegisterProperty Quick Fix