We need to be aware of the startNode because the reducer adds specifiers like 'static' and 'public' AFTER the method has already been handled, so we need to ignore that space while determining if we're "inside" this method or not during autocompletion
| 154 | // already been handled, so we need to ignore that space while determining if we're "inside" this method or not during |
| 155 | // autocompletion |
| 156 | bool BfDefBuilder::WantsNode(BfAstNode* wholeNode, BfAstNode* startNode, int addLen) |
| 157 | { |
| 158 | if ((mResolvePassData == NULL) || (!mResolvePassData->mHasCursorIdx)) |
| 159 | return true; |
| 160 | |
| 161 | auto parser = wholeNode->GetParser(); |
| 162 | if (parser->mCursorIdx == -1) |
| 163 | return true; |
| 164 | |
| 165 | // We need to get all nodes when we get fixits because the cursor could be either before or after fields with |
| 166 | // warnings, but still on the correct line |
| 167 | //if (mResolvePassData->mResolveType == BfResolveType_GetFixits) |
| 168 | //return true; |
| 169 | |
| 170 | addLen++; |
| 171 | if ((parser->mCursorIdx >= wholeNode->GetSrcStart()) && (parser->mCursorIdx < wholeNode->GetSrcEnd() + addLen)) |
| 172 | { |
| 173 | if ((startNode == NULL) || (parser->mCursorIdx >= startNode->GetSrcStart())) |
| 174 | return true; |
| 175 | } |
| 176 | return false; |
| 177 | } |
| 178 | |
| 179 | static int sGenericParamIdx = 0; |
| 180 |
nothing calls this directly
no test coverage detected