MCPcopy Create free account
hub / github.com/beefytech/Beef / IsAutocompleteNode

Method IsAutocompleteNode

IDEHelper/Compiler/BfAutoComplete.cpp:304–330  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

302}
303
304bool BfAutoComplete::IsAutocompleteNode(BfAstNode* node, int lengthAdd, int startAdd)
305{
306 if (mModule == NULL)
307 return false;
308 if (node == NULL)
309 return false;
310
311// if (!node->IsFromParser(mCompiler->mResolvePassData->mParser))
312// return false;
313
314 if (node->IsTemporary())
315 return false;
316 auto bfParser = node->GetSourceData()->ToParser();
317 if (bfParser == NULL)
318 return false;
319 if ((bfParser->mParserFlags & ParserFlag_Autocomplete) == 0)
320 return false;
321
322 //if (mCompiler->mResolvePassData->mResolveType != BfResolveType_Autocomplete)
323 lengthAdd++;
324
325 int cursorIdx = bfParser->mCursorCheckIdx;
326 int nodeSrcStart = node->GetSrcStart();
327 if ((cursorIdx < nodeSrcStart + startAdd) || (cursorIdx >= node->GetSrcEnd() + lengthAdd))
328 return false;
329 return true;
330}
331
332bool BfAutoComplete::IsAutocompleteNode(BfAstNode* startNode, BfAstNode* endNode, int lengthAdd, int startAdd)
333{

Callers 15

VisitCodeBlockMethod · 0.80
GetCustomAttributesMethod · 0.80
GetLocalMethodDefMethod · 0.80
DoMethodDeclarationMethod · 0.80
VisitMethod · 0.80
ResolveTypeResultMethod · 0.80
VisitMethod · 0.80

Calls 5

GetSourceDataMethod · 0.80
IsTemporaryMethod · 0.45
ToParserMethod · 0.45
GetSrcStartMethod · 0.45
GetSrcEndMethod · 0.45

Tested by

no test coverage detected