mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-09 01:39:32 +01:00
codetools: fixed TIdentCompletionTool.ParseSourceTillCollectionStart check atom in front
git-svn-id: trunk@31318 -
This commit is contained in:
parent
cf32ea0df9
commit
a1d7624a88
@ -1719,7 +1719,7 @@ begin
|
|||||||
until false;
|
until false;
|
||||||
ReadNextAtom;
|
ReadNextAtom;
|
||||||
if CurPos.StartPos<CleanPos then
|
if CurPos.StartPos<CleanPos then
|
||||||
exit;
|
break;
|
||||||
// first atom of node is behind CleanPos => try prior node
|
// first atom of node is behind CleanPos => try prior node
|
||||||
Node:=Node.Prior;
|
Node:=Node.Prior;
|
||||||
until false;
|
until false;
|
||||||
|
|||||||
@ -1726,6 +1726,7 @@ procedure TIdentCompletionTool.ParseSourceTillCollectionStart(
|
|||||||
out CursorNode: TCodeTreeNode; out IdentStartPos, IdentEndPos: integer);
|
out CursorNode: TCodeTreeNode; out IdentStartPos, IdentEndPos: integer);
|
||||||
var
|
var
|
||||||
StartContext: TFindContext;
|
StartContext: TFindContext;
|
||||||
|
ContextPos: Integer;
|
||||||
begin
|
begin
|
||||||
CleanCursorPos:=0;
|
CleanCursorPos:=0;
|
||||||
CursorNode:=nil;
|
CursorNode:=nil;
|
||||||
@ -1740,7 +1741,19 @@ begin
|
|||||||
[btSetIgnoreErrorPos]);
|
[btSetIgnoreErrorPos]);
|
||||||
|
|
||||||
// find node at position
|
// find node at position
|
||||||
CursorNode:=BuildSubTreeAndFindDeepestNodeAtPos(CleanCursorPos,true);
|
ContextPos:=CleanCursorPos;
|
||||||
|
// The context node might be in front of the CleanCursorPos
|
||||||
|
// For example: A.|end; In this case the statement ends at the point.
|
||||||
|
// Check the atom in front
|
||||||
|
ReadPriorAtomSafe(CleanCursorPos);
|
||||||
|
if (CurPos.Flag<>cafNone) then begin
|
||||||
|
ContextPos:=CurPos.EndPos;
|
||||||
|
if (CurPos.Flag in [cafPoint,cafRoundBracketOpen,cafEdgedBracketOpen])
|
||||||
|
or UpAtomIs('INHERITED') then
|
||||||
|
ContextPos:=CurPos.StartPos;
|
||||||
|
end;
|
||||||
|
|
||||||
|
CursorNode:=BuildSubTreeAndFindDeepestNodeAtPos(ContextPos,true);
|
||||||
if CurrentIdentifierList<>nil then begin
|
if CurrentIdentifierList<>nil then begin
|
||||||
StartContext:=CurrentIdentifierList.StartContext;
|
StartContext:=CurrentIdentifierList.StartContext;
|
||||||
StartContext.Node:=CursorNode;
|
StartContext.Node:=CursorNode;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user