| 3292 | } |
| 3293 | |
| 3294 | void BfAutoComplete::CheckLabel(BfIdentifierNode* identifierNode, BfAstNode* precedingNode, BfScopeData* scopeData) |
| 3295 | { |
| 3296 | String filter; |
| 3297 | if (identifierNode != NULL) |
| 3298 | { |
| 3299 | if ((mModule->mCompiler->mResolvePassData != NULL) && (scopeData != NULL)) |
| 3300 | { |
| 3301 | auto rootMethodState = mModule->mCurMethodState->GetRootMethodState(); |
| 3302 | mModule->mCompiler->mResolvePassData->HandleLocalReference(identifierNode, rootMethodState->mMethodInstance->GetOwner()->mTypeDef, rootMethodState->mMethodInstance->mMethodDef, scopeData->mScopeLocalId); |
| 3303 | } |
| 3304 | |
| 3305 | if (!IsAutocompleteNode(identifierNode)) |
| 3306 | return; |
| 3307 | |
| 3308 | if (scopeData != NULL) |
| 3309 | { |
| 3310 | if (mResolveType == BfResolveType_GoToDefinition) |
| 3311 | { |
| 3312 | SetDefinitionLocation(scopeData->mLabelNode); |
| 3313 | } |
| 3314 | else if (mResolveType == BfResolveType_GetSymbolInfo) |
| 3315 | { |
| 3316 | auto rootMethodInstance = mModule->mCurMethodState->GetRootMethodState()->mMethodInstance; |
| 3317 | if (rootMethodInstance == NULL) |
| 3318 | return; |
| 3319 | |
| 3320 | mDefType = mModule->mCurTypeInstance->mTypeDef; |
| 3321 | |
| 3322 | mReplaceLocalId = scopeData->mScopeLocalId; |
| 3323 | mDefMethod = rootMethodInstance->mMethodDef; |
| 3324 | if (mInsertStartIdx == -1) |
| 3325 | { |
| 3326 | mInsertStartIdx = identifierNode->GetSrcStart(); |
| 3327 | mInsertEndIdx = identifierNode->GetSrcEnd(); |
| 3328 | } |
| 3329 | } |
| 3330 | |
| 3331 | if (scopeData->mLabelNode == identifierNode) |
| 3332 | return; |
| 3333 | } |
| 3334 | |
| 3335 | filter = identifierNode->ToString(); |
| 3336 | mInsertStartIdx = identifierNode->GetSrcStart(); |
| 3337 | mInsertEndIdx = identifierNode->GetSrcEnd(); |
| 3338 | } |
| 3339 | else |
| 3340 | { |
| 3341 | if (precedingNode == NULL) |
| 3342 | return; |
| 3343 | |
| 3344 | int expectSpacing = 1; |
| 3345 | if (auto precedingToken = BfNodeDynCast<BfTokenNode>(precedingNode)) |
| 3346 | if (precedingToken->GetToken() == BfToken_Colon) |
| 3347 | expectSpacing = 0; |
| 3348 | |
| 3349 | if (!IsAutocompleteNode(precedingNode, expectSpacing)) |
| 3350 | return; |
| 3351 |
no test coverage detected