| 3012 | } |
| 3013 | |
| 3014 | void BfAutoComplete::CheckProperty(BfPropertyDeclaration* propertyDeclaration) |
| 3015 | { |
| 3016 | if (IsAutocompleteNode(propertyDeclaration->mNameNode)) |
| 3017 | { |
| 3018 | mInsertStartIdx = propertyDeclaration->mNameNode->GetSrcStart(); |
| 3019 | mInsertEndIdx = propertyDeclaration->mNameNode->GetSrcEnd(); |
| 3020 | } |
| 3021 | |
| 3022 | if (propertyDeclaration->mExplicitInterface != NULL) |
| 3023 | { |
| 3024 | BfTypeInstance* typeInst = NULL; |
| 3025 | |
| 3026 | auto type = mModule->ResolveTypeRef(propertyDeclaration->mExplicitInterface, BfPopulateType_Identity); |
| 3027 | if (type != NULL) |
| 3028 | typeInst = type->ToTypeInstance(); |
| 3029 | |
| 3030 | if (typeInst != NULL) |
| 3031 | CheckExplicitInterface(typeInst, propertyDeclaration->mExplicitInterfaceDotToken, propertyDeclaration->mNameNode); |
| 3032 | } |
| 3033 | |
| 3034 | if ((propertyDeclaration->mVirtualSpecifier != NULL) && |
| 3035 | (propertyDeclaration->mVirtualSpecifier->GetToken() == BfToken_Override)) |
| 3036 | { |
| 3037 | if (!mIsAutoComplete) |
| 3038 | return; |
| 3039 | |
| 3040 | auto bfParser = propertyDeclaration->mVirtualSpecifier->GetSourceData()->ToParser(); |
| 3041 | if (bfParser == NULL) |
| 3042 | return; |
| 3043 | int cursorIdx = bfParser->mCursorIdx; |
| 3044 | |
| 3045 | bool isInTypeRef = IsAutocompleteNode(propertyDeclaration->mTypeRef); |
| 3046 | bool isInNameNode = IsAutocompleteNode(propertyDeclaration->mNameNode); |
| 3047 | |
| 3048 | if (((IsAutocompleteNode(propertyDeclaration, 1)) && (cursorIdx == propertyDeclaration->mVirtualSpecifier->GetSrcEnd())) || |
| 3049 | (isInTypeRef) || (isInNameNode)) |
| 3050 | { |
| 3051 | mInsertStartIdx = propertyDeclaration->mVirtualSpecifier->GetSrcStart(); |
| 3052 | |
| 3053 | String filter; |
| 3054 | if ((isInNameNode || isInTypeRef)) |
| 3055 | { |
| 3056 | BfAstNode* defNode = NULL; |
| 3057 | if (isInNameNode) |
| 3058 | defNode = propertyDeclaration->mNameNode; |
| 3059 | else if (isInTypeRef) |
| 3060 | defNode = propertyDeclaration->mTypeRef; |
| 3061 | |
| 3062 | filter = defNode->ToString(); |
| 3063 | mInsertEndIdx = defNode->GetSrcEnd(); |
| 3064 | } |
| 3065 | else if (propertyDeclaration->mTypeRef != NULL) |
| 3066 | { |
| 3067 | // We're just inside 'override' - we may be inserting a new method |
| 3068 | mInsertEndIdx = propertyDeclaration->mVirtualSpecifier->GetSrcEnd(); |
| 3069 | } |
| 3070 | else |
| 3071 | { |
no test coverage detected