IDE: lazdoc: fixed showing hints for procedures

git-svn-id: trunk@13023 -
This commit is contained in:
mattias 2007-11-25 15:01:26 +00:00
parent c8b5bd4bd5
commit e2a6763357
2 changed files with 18 additions and 9 deletions

View File

@ -3788,12 +3788,17 @@ begin
// find node
ANode:=FindDeepestNodeAtPos(CleanCursorPos,true);
if (ANode=nil) then exit;
if (ANode.Desc=ctnProcedureHead)
and (ANode.Parent<>nil) and (ANode.Parent.Desc=ctnProcedure) then
ANode:=ANode.Parent;
NextNode:=ANode.Next;
if NextNode<>nil then
EndPos:=NextNode.StartPos
else
EndPos:=ANode.EndPos;
//DebugLn(['TStandardCodeTool.GetPasDocComments ',copy(Src,ANode.StartPos,ANode.EndPos-ANode.StartPos)]);
// read comments (start in front of node)
p:=FindLineEndOrCodeInFrontOfPosition(ANode.StartPos,true);
while p<EndPos do begin

View File

@ -678,6 +678,9 @@ begin
end;
// use only definition nodes
if (Node.Desc=ctnProcedureHead)
and (Node.Parent<>nil) and (Node.Parent.Desc=ctnProcedure) then
Node:=Node.Parent;
if not (Node.Desc in
(AllIdentifierDefinitions+[ctnProperty,ctnProcedure,ctnEnumIdentifier]))
then begin
@ -784,15 +787,16 @@ begin
Item:=Chain[i];
ItemAdded:=false;
DebugLn(['TLazDocManager.GetHint ',i,' Element=',Item.ElementName]);
if Item.ElementNode=nil then continue;
NodeValues:=Item.FPDocFile.GetValuesFromNode(Item.ElementNode);
for f:=Low(TFPDocItem) to High(TFPDocItem) do
DebugLn(['TLazDocManager.GetHint ',FPDocItemNames[f],' ',NodeValues[f]]);
if NodeValues[fpdiShort]<>'' then begin
Hint:=Hint+#13#13
+Item.ElementName+#13
+NodeValues[fpdiShort];
ItemAdded:=true;
if Item.ElementNode<>nil then begin
NodeValues:=Item.FPDocFile.GetValuesFromNode(Item.ElementNode);
for f:=Low(TFPDocItem) to High(TFPDocItem) do
DebugLn(['TLazDocManager.GetHint ',FPDocItemNames[f],' ',NodeValues[f]]);
if NodeValues[fpdiShort]<>'' then begin
Hint:=Hint+#13#13
+Item.ElementName+#13
+NodeValues[fpdiShort];
ItemAdded:=true;
end;
end;
// Add comments