mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 02:09:21 +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
|
// find node
|
||||||
ANode:=FindDeepestNodeAtPos(CleanCursorPos,true);
|
ANode:=FindDeepestNodeAtPos(CleanCursorPos,true);
|
||||||
if (ANode=nil) then exit;
|
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;
|
NextNode:=ANode.Next;
|
||||||
if NextNode<>nil then
|
if NextNode<>nil then
|
||||||
EndPos:=NextNode.StartPos
|
EndPos:=NextNode.StartPos
|
||||||
else
|
else
|
||||||
EndPos:=ANode.EndPos;
|
EndPos:=ANode.EndPos;
|
||||||
|
|
||||||
|
//DebugLn(['TStandardCodeTool.GetPasDocComments ',copy(Src,ANode.StartPos,ANode.EndPos-ANode.StartPos)]);
|
||||||
// read comments (start in front of node)
|
// read comments (start in front of node)
|
||||||
p:=FindLineEndOrCodeInFrontOfPosition(ANode.StartPos,true);
|
p:=FindLineEndOrCodeInFrontOfPosition(ANode.StartPos,true);
|
||||||
while p<EndPos do begin
|
while p<EndPos do begin
|
||||||
|
@ -678,6 +678,9 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
// use only definition nodes
|
// 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
|
if not (Node.Desc in
|
||||||
(AllIdentifierDefinitions+[ctnProperty,ctnProcedure,ctnEnumIdentifier]))
|
(AllIdentifierDefinitions+[ctnProperty,ctnProcedure,ctnEnumIdentifier]))
|
||||||
then begin
|
then begin
|
||||||
@ -784,15 +787,16 @@ begin
|
|||||||
Item:=Chain[i];
|
Item:=Chain[i];
|
||||||
ItemAdded:=false;
|
ItemAdded:=false;
|
||||||
DebugLn(['TLazDocManager.GetHint ',i,' Element=',Item.ElementName]);
|
DebugLn(['TLazDocManager.GetHint ',i,' Element=',Item.ElementName]);
|
||||||
if Item.ElementNode=nil then continue;
|
if Item.ElementNode<>nil then begin
|
||||||
NodeValues:=Item.FPDocFile.GetValuesFromNode(Item.ElementNode);
|
NodeValues:=Item.FPDocFile.GetValuesFromNode(Item.ElementNode);
|
||||||
for f:=Low(TFPDocItem) to High(TFPDocItem) do
|
for f:=Low(TFPDocItem) to High(TFPDocItem) do
|
||||||
DebugLn(['TLazDocManager.GetHint ',FPDocItemNames[f],' ',NodeValues[f]]);
|
DebugLn(['TLazDocManager.GetHint ',FPDocItemNames[f],' ',NodeValues[f]]);
|
||||||
if NodeValues[fpdiShort]<>'' then begin
|
if NodeValues[fpdiShort]<>'' then begin
|
||||||
Hint:=Hint+#13#13
|
Hint:=Hint+#13#13
|
||||||
+Item.ElementName+#13
|
+Item.ElementName+#13
|
||||||
+NodeValues[fpdiShort];
|
+NodeValues[fpdiShort];
|
||||||
ItemAdded:=true;
|
ItemAdded:=true;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// Add comments
|
// Add comments
|
||||||
|
Loading…
Reference in New Issue
Block a user