mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 00:39:44 +02:00
IDE: lazdoc: fixed showing hints for procedures
git-svn-id: trunk@13023 -
This commit is contained in:
parent
c8b5bd4bd5
commit
e2a6763357
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user