From b66c203a3cb34a4616c57584f35e1af217413d4f Mon Sep 17 00:00:00 2001 From: mattias Date: Thu, 18 Jan 2007 11:53:08 +0000 Subject: [PATCH] added debugging information git-svn-id: trunk@10466 - --- components/codetools/codecompletiontool.pas | 18 ++++++++++++++++-- examples/designerbaseclass/example/unit1.lrs | 2 -- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/components/codetools/codecompletiontool.pas b/components/codetools/codecompletiontool.pas index e555a9d942..8f48deccf3 100644 --- a/components/codetools/codecompletiontool.pas +++ b/components/codetools/codecompletiontool.pas @@ -1009,14 +1009,25 @@ var OldCodePos: TCodePosition; begin Result:=false; - + + {$IFDEF VerboseCompleteMethod} + DebugLn(['TCodeCompletionCodeTool.CompleteMethod A ',ProcNode<>nil]); + {$ENDIF} // check if cursor in a method ProcNode:=CursorNode.GetNodeOfType(ctnProcedure); + {$IFDEF VerboseCompleteMethod} + DebugLn(['TCodeCompletionCodeTool.CompleteMethod B ',ProcNode<>nil]); + {$ENDIF} if (ProcNode=nil) and (CursorNode.Desc=ctnProcedure) then ProcNode:=CursorNode; + {$IFDEF VerboseCompleteMethod} + DebugLn(['TCodeCompletionCodeTool.CompleteMethod C ',ProcNode<>nil]); + {$ENDIF} if (ProcNode=nil) or (ProcNode.Desc<>ctnProcedure) - or ((ProcNode.SubDesc and ctnsForwardDeclaration)<>0) or (not NodeIsMethodBody(ProcNode)) then begin + {$IFDEF VerboseCompleteMethod} + DebugLn(['TCodeCompletionCodeTool.CompleteMethod node is not a method body ',ProcNode<>nil]); + {$ENDIF} exit; end; @@ -1051,6 +1062,9 @@ begin ProcCode:=ExtractProcHead(ProcNode, [phpWithStart,phpWithoutClassName,phpWithVarModifiers,phpWithParameterNames, phpWithDefaultValues,phpWithResultType,phpWithCallingSpecs]); + {$IFDEF VerboseCompleteMethod} + DebugLn(['TCodeCompletionCodeTool.CompleteMethod Adding ProcName="',ProcName,'"']); + {$ENDIF} AddClassInsertion(CleanProcCode,ProcCode,ProcName,ncpPrivateProcs); // apply changes diff --git a/examples/designerbaseclass/example/unit1.lrs b/examples/designerbaseclass/example/unit1.lrs index 3cea34ab00..00579df2b0 100644 --- a/examples/designerbaseclass/example/unit1.lrs +++ b/examples/designerbaseclass/example/unit1.lrs @@ -1,5 +1,3 @@ -{ This is an automatically generated lazarus resource file } - LazarusResources.Add('TMyComponent1','FORMDATA',[ 'TPF0'#13'TMyComponent1'#12'MyComponent1'#4'left'#3'.'#1#3'top'#3'R'#2#0#11'T' +'OpenDialog'#11'OpenDialog1'#5'Title'#6#18'Open existing file'#11'FilterInde'