public GenerateUnityEventFunctionsProvider(UnityApi unityApi, UnityVersion unityVersion,
                                            KnownTypesCache knownTypesCache)
 {
     myUnityApi        = unityApi;
     myUnityVersion    = unityVersion;
     myKnownTypesCache = knownTypesCache;
 }
Example #2
0
 public DrawGizmoAttributeProblemAnalyzer([NotNull] UnityApi unityApi, IPredefinedTypeCache predefinedTypeCache,
                                          KnownTypesCache knownTypesCache)
     : base(unityApi)
 {
     myPredefinedTypeCache = predefinedTypeCache;
     myKnownTypesCache     = knownTypesCache;
 }
Example #3
0
 public AttributedMethodSignatureProblemAnalyzer(UnityApi unityApi, IPredefinedTypeCache predefinedTypeCache,
                                                 KnownTypesCache knownTypesCache)
     : base(unityApi)
 {
     myPredefinedTypeCache = predefinedTypeCache;
     myKnownTypesCache     = knownTypesCache;
     myMethodSignatures    = new ConcurrentDictionary <IClrTypeName, MethodSignature[]>();
 }
Example #4
0
        public FormerlySerializedAsAtomicRename(IDeclaredElement declaredElement, string newName,
                                                ISettingsStore settingsStore, KnownTypesCache knownTypesCache)
        {
            myKnownTypesCache = knownTypesCache;
            myModel           = new SerializedFieldRenameModel(settingsStore);

            myPointer = declaredElement.CreateElementPointer();
            OldName   = declaredElement.ShortName;
            NewName   = newName;
        }
Example #5
0
        private static bool HasDifferentParameterLists(
            [NotNull] UnityEventFunction function,
            [NotNull] CSharpCodeCompletionContext context,
            [NotNull] KnownTypesCache knownTypesCache)
        {
            var unterminatedContext = context.UnterminatedContext;
            var methodDeclaration   = unterminatedContext.TreeNode?.GetContainingNode <IMethodDeclaration>();

            if (methodDeclaration == null)
            {
                return(false);
            }

            var functionParameters      = function.Parameters;
            var currentMethodParameters = methodDeclaration.Params;

            if (currentMethodParameters == null)
            {
                return(false);
            }

            if (functionParameters.Length != currentMethodParameters.ParameterDeclarations.Count)
            {
                return(true);
            }

            var typeConversionRule = currentMethodParameters.GetTypeConversionRule();
            var module             = methodDeclaration.GetPsiModule();

            for (var paramIndex = 0; paramIndex < functionParameters.Length; paramIndex++)
            {
                var functionParameter      = functionParameters[paramIndex];
                var currentMethodParameter = currentMethodParameters.ParameterDeclarations[paramIndex];

                var conversion = typeConversionRule.ClassifyImplicitConversion(currentMethodParameter.Type, functionParameter.TypeSpec.AsIType(knownTypesCache, module));
                if (conversion.Kind != ConversionKind.Identity)
                {
                    return(true);
                }
            }

            return(false);
        }
Example #6
0
 public UnityEventFunctionAnalyzer(UnityApi unityApi, KnownTypesCache knownTypesCache)
     : base(unityApi)
 {
     myKnownTypesCache = knownTypesCache;
 }