mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-06 08:39:49 +01:00
codetools: fixed initial search flags for local var completion
git-svn-id: trunk@32467 -
This commit is contained in:
parent
71f1c25189
commit
ae67ba05c7
@ -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);
|
||||
|
||||
@ -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];
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user