resharper/resharper-unity/src/Unity/Odin/Feature/Services/CodeCompletion/GroupingAttributes/OdinLayoutAttributesCodeCompletionProvider.cs [34:76]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - protected override bool IsAvailable(CSharpCodeCompletionContext context) { var solution = context.NodeInFile.GetSolution(); if (!OdinAttributeUtil.HasOdinSupport(solution)) return false; var stringLiteral = context.StringLiteral(); if (stringLiteral == null) return false; if (context.NodeInFile.GetContainingNode() == null) return false; var isUnityProject = context.BasicContext.CodeCompletionType == CodeCompletionType.BasicCompletion && context.PsiModule is IProjectPsiModule projectPsiModule && projectPsiModule.Project.IsUnityProject(); return isUnityProject; } protected override bool AddLookupItems(CSharpCodeCompletionContext context, IItemsCollector collector) { var stringLiteral = context.StringLiteral(); if (stringLiteral == null) return false; var nodeInFile = context.NodeInFile; var argument = nodeInFile.GetContainingNode(); var attribute = AttributeNavigator.GetByArgument(argument); if (attribute == null) return false; var declaration = attribute.GetContainingNode(); var classLikeDeclaredElement = declaration?.DeclaredElement; if (classLikeDeclaredElement == null) return false; var type = attribute.TypeReference?.Resolve().Result.DeclaredElement as ITypeElement; if (type == null) return false; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - resharper/resharper-unity/src/Unity/Odin/Feature/Services/CodeCompletion/GroupingAttributes/OdinTabGroupAttributeCodeCompletionProvider.cs [34:76]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - protected override bool IsAvailable(CSharpCodeCompletionContext context) { var solution = context.NodeInFile.GetSolution(); if (!OdinAttributeUtil.HasOdinSupport(solution)) return false; var stringLiteral = context.StringLiteral(); if (stringLiteral == null) return false; if (context.NodeInFile.GetContainingNode() == null) return false; var isUnityProject = context.BasicContext.CodeCompletionType == CodeCompletionType.BasicCompletion && context.PsiModule is IProjectPsiModule projectPsiModule && projectPsiModule.Project.IsUnityProject(); return isUnityProject; } protected override bool AddLookupItems(CSharpCodeCompletionContext context, IItemsCollector collector) { var stringLiteral = context.StringLiteral(); if (stringLiteral == null) return false; var nodeInFile = context.NodeInFile; var argument = nodeInFile.GetContainingNode(); var attribute = AttributeNavigator.GetByArgument(argument); if (attribute == null) return false; var declaration = attribute.GetContainingNode(); var classLikeDeclaredElement = declaration?.DeclaredElement; if (classLikeDeclaredElement == null) return false; var type = attribute.TypeReference?.Resolve().Result.DeclaredElement as ITypeElement; if (type == null) return false; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -