mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-20 05:09:05 +02: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;
|
||||
ReadNextAtom;
|
||||
if CurPos.StartPos<CleanPos then
|
||||
exit;
|
||||
break;
|
||||
// first atom of node is behind CleanPos => try prior node
|
||||
Node:=Node.Prior;
|
||||
until false;
|
||||
|
@ -1726,6 +1726,7 @@ procedure TIdentCompletionTool.ParseSourceTillCollectionStart(
|
||||
out CursorNode: TCodeTreeNode; out IdentStartPos, IdentEndPos: integer);
|
||||
var
|
||||
StartContext: TFindContext;
|
||||
ContextPos: Integer;
|
||||
begin
|
||||
CleanCursorPos:=0;
|
||||
CursorNode:=nil;
|
||||
@ -1740,7 +1741,19 @@ begin
|
||||
[btSetIgnoreErrorPos]);
|
||||
|
||||
// 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
|
||||
StartContext:=CurrentIdentifierList.StartContext;
|
||||
StartContext.Node:=CursorNode;
|
||||
|
Loading…
Reference in New Issue
Block a user