mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-14 09:20:23 +02:00
codetools: method jump: error on class without procs
git-svn-id: trunk@35049 -
This commit is contained in:
parent
22e07332cc
commit
cfad485584
@ -325,6 +325,7 @@ var CursorNode, ClassNode, ProcNode, StartNode, TypeSectionNode,
|
||||
SearchedClassname, SearchedProcName, SearchedParamList: string;
|
||||
SearchForNodes, SearchInNodes: TAVLTree;
|
||||
BodyAVLNode, DefAVLNode: TAVLTreeNode;
|
||||
ProcName: String;
|
||||
begin
|
||||
Result:=false;
|
||||
RevertableJump:=false;
|
||||
@ -549,7 +550,11 @@ begin
|
||||
{$IFDEF CTDEBUG}
|
||||
DebugLn('TMethodJumpingCodeTool.FindJumpPoint 4D ',dbgs(StartNode<>nil));
|
||||
{$ENDIF}
|
||||
if StartNode=nil then exit;
|
||||
if StartNode=nil then begin
|
||||
ProcName:=ExtractProcName(ProcNode,[]);
|
||||
MoveCursorToNodeStart(ClassNode);
|
||||
RaiseException('method "'+ProcName+'" has no declaration');
|
||||
end;
|
||||
StartNode:=StartNode.FirstChild;
|
||||
// search method with same name and param list
|
||||
Result:=FindBestProcNode(ProcNode,[phpWithoutClassName,phpInUpperCase],
|
||||
@ -576,7 +581,11 @@ begin
|
||||
{$IFDEF CTDEBUG}
|
||||
DebugLn('TMethodJumpingCodeTool.FindJumpPoint 4G DiffNodes=',dbgs(SearchInNodes.Count));
|
||||
{$ENDIF}
|
||||
if SearchInNodes.Count=0 then exit;
|
||||
if SearchInNodes.Count=0 then begin
|
||||
ProcName:=ExtractProcName(ProcNode,[]);
|
||||
MoveCursorToNodeStart(ClassNode);
|
||||
RaiseException('method "'+ProcName+'" has no declaration');
|
||||
end;
|
||||
// search for a method with same name but different param list
|
||||
ProcNode:=FindProcNodeInTreeWithName(SearchInNodes,
|
||||
ExtractProcName(ProcNode,[phpWithoutClassName,phpInUpperCase]));
|
||||
|
Loading…
Reference in New Issue
Block a user