mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-07 12:55:56 +02:00
codetools: refactoring
git-svn-id: trunk@20971 -
This commit is contained in:
parent
ff0557c43f
commit
a070a6a7e9
@ -1495,7 +1495,7 @@ const
|
||||
// find start of proc expression (e.g. Button1.Constrains.DoSomething)
|
||||
IsFunction:=false;
|
||||
FuncType:='';
|
||||
ProcExprStartPos:=FindStartOfVariable(ProcNameAtom.EndPos);
|
||||
ProcExprStartPos:=FindStartOfTerm(ProcNameAtom.EndPos);
|
||||
if ProcExprStartPos<0 then exit;
|
||||
MoveCursorToCleanPos(ProcExprStartPos);
|
||||
ReadPriorAtom;
|
||||
|
@ -1214,7 +1214,7 @@ type
|
||||
begin
|
||||
Result:=false;
|
||||
// find start of variable
|
||||
VarStartPos:=FindStartOfVariable(CurPos.StartPos);
|
||||
VarStartPos:=FindStartOfTerm(CurPos.StartPos);
|
||||
if (IgnoreIdentifiers<>nil) then begin
|
||||
if not CleanPosToCaret(VarStartPos,NewCodePos) then exit;
|
||||
if IgnoreIdentifiers.Find(@NewCodePos)<>nil then exit(true);
|
||||
|
@ -625,7 +625,7 @@ type
|
||||
function GetCurrentAtomType: TVariableAtomType;
|
||||
function FindEndOfVariable(StartPos: integer;
|
||||
ExceptionIfNoVariableStart, WithAsOperator: boolean): integer;
|
||||
function FindStartOfVariable(EndPos: integer): integer;
|
||||
function FindStartOfTerm(EndPos: integer): integer;
|
||||
function FindExpressionTypeOfVariable(StartPos, EndPos: integer;
|
||||
Params: TFindDeclarationParams; WithAsOperator: boolean): TExpressionType;
|
||||
function FindEndOfExpression(StartPos: integer): integer;
|
||||
@ -5853,7 +5853,7 @@ begin
|
||||
Result:=CurPos.EndPos;
|
||||
end;
|
||||
|
||||
function TFindDeclarationTool.FindStartOfVariable(EndPos: integer): integer;
|
||||
function TFindDeclarationTool.FindStartOfTerm(EndPos: integer): integer;
|
||||
{ a variable can be combinations of
|
||||
1. A.B
|
||||
2. A().B
|
||||
@ -5976,7 +5976,7 @@ var
|
||||
begin
|
||||
Result:=false;
|
||||
if StartPos<1 then
|
||||
StartPos:=FindStartOfVariable(EndPos)
|
||||
StartPos:=FindStartOfTerm(EndPos)
|
||||
else if EndPos<1 then
|
||||
EndPos:=FindEndOfVariable(StartPos,true,WithAsOperator);
|
||||
if (StartPos<1) then
|
||||
|
@ -1516,7 +1516,7 @@ procedure TIdentCompletionTool.FindCollectionContext(
|
||||
ReadPriorAtom;
|
||||
if (CurPos.Flag=cafPoint)
|
||||
or (UpAtomIs('INHERITED')) then begin
|
||||
Result:=FindStartOfVariable(IdentStartPos);
|
||||
Result:=FindStartOfTerm(IdentStartPos);
|
||||
if Result<ContextNode.StartPos then
|
||||
Result:=ContextNode.StartPos;
|
||||
end else
|
||||
@ -1809,7 +1809,7 @@ begin
|
||||
end;
|
||||
|
||||
// context in front of
|
||||
StartPosOfVariable:=FindStartOfVariable(IdentStartPos);
|
||||
StartPosOfVariable:=FindStartOfTerm(IdentStartPos);
|
||||
if StartPosOfVariable>0 then begin
|
||||
if StartPosOfVariable=IdentStartPos then begin
|
||||
// cursor is at start of an operand
|
||||
|
Loading…
Reference in New Issue
Block a user