codetools: fixed initial search flags for local var completion

git-svn-id: trunk@32467 -
This commit is contained in:
mattias 2011-09-23 09:30:06 +00:00
parent 71f1c25189
commit ae67ba05c7
3 changed files with 6 additions and 4 deletions

View File

@ -1917,7 +1917,7 @@ begin
// find declaration of parameter list
Params.ContextNode:=Context.Node;
Params.SetIdentifier(Self,@Src[ProcNameAtom.StartPos],nil);
Params.Flags:=fdfGlobals+[fdfSearchInAncestors,fdfFindVariable];
Params.Flags:=fdfDefaultForExpressions+[fdfSearchInAncestors,fdfFindVariable];
if Context.Node=CursorNode then
Params.Flags:=Params.Flags+[fdfSearchInParentNodes,fdfIgnoreCurContextNode];
CleanPosToCodePos(VarNameAtom.StartPos,IgnorePos);

View File

@ -173,11 +173,13 @@ type
TFindDeclarationFlags = set of TFindDeclarationFlag;
const
// masks to pass flags to sub searches
fdfGlobals = [fdfExceptionOnNotFound, fdfTopLvlResolving,
fdfExtractOperand, fdfPropertyResolving];
fdfGlobalsSameIdent = fdfGlobals+[fdfExceptionOnPredefinedIdent,
fdfIgnoreMissingParams, fdfIgnoreUsedUnits, fdfDoNotCache,
fdfOnlyCompatibleProc, fdfSearchInAncestors, fdfCollect];
// initial flags for searches
fdfDefaultForExpressions = [fdfSearchInParentNodes, fdfSearchInAncestors,
fdfExceptionOnNotFound];

View File

@ -2608,14 +2608,14 @@ begin
Params:=TFindDeclarationParams.Create;
Params.ContextNode:=CursorNode;
Params.Flags:=fdfGlobals+fdfDefaultForExpressions+[fdfFunctionResult];
Params.Flags:=fdfDefaultForExpressions+[fdfFunctionResult];
ExprType:=FindExpressionTypeOfTerm(CaseAtom.EndPos,EndPos,Params,true);
//DebugLn(['TIdentCompletionTool.GetValuesOfCaseVariable Type=',ExprTypeToString(ExprType)]);
if ExprType.Desc=xtContext then begin
// resolve aliases and properties
Params.Clear;
Params.Flags:=fdfGlobals+fdfDefaultForExpressions;
Params.Flags:=fdfDefaultForExpressions;
ExprType.Context:=ExprType.Context.Tool.FindBaseTypeOfNode(Params,
ExprType.Context.Node);
end;