mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-02 11:20:32 +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;
|
SearchedClassname, SearchedProcName, SearchedParamList: string;
|
||||||
SearchForNodes, SearchInNodes: TAVLTree;
|
SearchForNodes, SearchInNodes: TAVLTree;
|
||||||
BodyAVLNode, DefAVLNode: TAVLTreeNode;
|
BodyAVLNode, DefAVLNode: TAVLTreeNode;
|
||||||
|
ProcName: String;
|
||||||
begin
|
begin
|
||||||
Result:=false;
|
Result:=false;
|
||||||
RevertableJump:=false;
|
RevertableJump:=false;
|
||||||
@ -549,7 +550,11 @@ begin
|
|||||||
{$IFDEF CTDEBUG}
|
{$IFDEF CTDEBUG}
|
||||||
DebugLn('TMethodJumpingCodeTool.FindJumpPoint 4D ',dbgs(StartNode<>nil));
|
DebugLn('TMethodJumpingCodeTool.FindJumpPoint 4D ',dbgs(StartNode<>nil));
|
||||||
{$ENDIF}
|
{$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;
|
StartNode:=StartNode.FirstChild;
|
||||||
// search method with same name and param list
|
// search method with same name and param list
|
||||||
Result:=FindBestProcNode(ProcNode,[phpWithoutClassName,phpInUpperCase],
|
Result:=FindBestProcNode(ProcNode,[phpWithoutClassName,phpInUpperCase],
|
||||||
@ -576,7 +581,11 @@ begin
|
|||||||
{$IFDEF CTDEBUG}
|
{$IFDEF CTDEBUG}
|
||||||
DebugLn('TMethodJumpingCodeTool.FindJumpPoint 4G DiffNodes=',dbgs(SearchInNodes.Count));
|
DebugLn('TMethodJumpingCodeTool.FindJumpPoint 4G DiffNodes=',dbgs(SearchInNodes.Count));
|
||||||
{$ENDIF}
|
{$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
|
// search for a method with same name but different param list
|
||||||
ProcNode:=FindProcNodeInTreeWithName(SearchInNodes,
|
ProcNode:=FindProcNodeInTreeWithName(SearchInNodes,
|
||||||
ExtractProcName(ProcNode,[phpWithoutClassName,phpInUpperCase]));
|
ExtractProcName(ProcNode,[phpWithoutClassName,phpInUpperCase]));
|
||||||
|
Loading…
Reference in New Issue
Block a user