mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-25 13:49:16 +02:00
IDE: code hints: add title description
git-svn-id: trunk@31220 -
This commit is contained in:
parent
d56b41022a
commit
d665e635e2
@ -348,6 +348,7 @@ function CompareAnsistringWithLDSrc2DocSrcFile(Key, Data: Pointer): integer;
|
|||||||
function ToUnixLineEnding(const s: String): String;
|
function ToUnixLineEnding(const s: String): String;
|
||||||
function ToOSLineEnding(const s: String): String;
|
function ToOSLineEnding(const s: String): String;
|
||||||
function ReplaceLineEndings(const s, NewLineEnds: string): string;
|
function ReplaceLineEndings(const s, NewLineEnds: string): string;
|
||||||
|
function AppendLineEnding(const s: string): string; // append if not empty and there is not already a line ending
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
@ -431,6 +432,13 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function AppendLineEnding(const s: string): string;
|
||||||
|
begin
|
||||||
|
Result:=s;
|
||||||
|
if (Result='') or (Result[length(Result)] in [#10,#13]) then exit;
|
||||||
|
Result:=Result+LineEnding;
|
||||||
|
end;
|
||||||
|
|
||||||
function CompareLazFPDocFilenames(Data1, Data2: Pointer): integer;
|
function CompareLazFPDocFilenames(Data1, Data2: Pointer): integer;
|
||||||
begin
|
begin
|
||||||
Result:=CompareFilenames(TLazFPDocFile(Data1).Filename,
|
Result:=CompareFilenames(TLazFPDocFile(Data1).Filename,
|
||||||
@ -2401,6 +2409,7 @@ var
|
|||||||
OldCTNode: TCodeTreeNode;
|
OldCTNode: TCodeTreeNode;
|
||||||
n: Integer;
|
n: Integer;
|
||||||
LastOwner: TObject;
|
LastOwner: TObject;
|
||||||
|
s: String;
|
||||||
|
|
||||||
procedure AddLinkToOwner(CurOwner: TObject);
|
procedure AddLinkToOwner(CurOwner: TObject);
|
||||||
var
|
var
|
||||||
@ -2479,9 +2488,13 @@ begin
|
|||||||
//debugln(['TCodeHelpManager.GetHTMLHint2 fpdoc element found "',ElementName,'"']);
|
//debugln(['TCodeHelpManager.GetHTMLHint2 fpdoc element found "',ElementName,'"']);
|
||||||
AddLinkToOwner(AnOwner);
|
AddLinkToOwner(AnOwner);
|
||||||
|
|
||||||
HTMLHint:=HTMLHint+GetFPDocNodeAsHTML(FPDocFile,ElementNode.FindNode(FPDocItemNames[fpdiShort]));
|
s:=AppendLineEnding(GetFPDocNodeAsHTML(FPDocFile,ElementNode.FindNode(FPDocItemNames[fpdiShort])));
|
||||||
// todo elementlink
|
s:=s+AppendLineEnding(GetFPDocNodeAsHTML(FPDocFile,ElementNode.FindNode(FPDocItemNames[fpdiDescription])));
|
||||||
HTMLHint:=HTMLHint+GetFPDocNodeAsHTML(FPDocFile,ElementNode.FindNode(FPDocItemNames[fpdiDescription]));
|
if s<>'' then begin
|
||||||
|
s:='<br>'+LineEnding
|
||||||
|
+'<div class="title">Description</div>'+LineEnding+s;
|
||||||
|
HTMLHint:=HTMLHint+s;
|
||||||
|
end;
|
||||||
HTMLHint:=HTMLHint+GetFPDocNodeAsHTML(FPDocFile,ElementNode.FindNode(FPDocItemNames[fpdiErrors]));
|
HTMLHint:=HTMLHint+GetFPDocNodeAsHTML(FPDocFile,ElementNode.FindNode(FPDocItemNames[fpdiErrors]));
|
||||||
// todo HTMLHint:=HTMLHint+GetFPDocNodeAsHTML(FPDocFile,ElementNode.FindNode(FPDocItemNames[fpdiSeeAlso]));
|
// todo HTMLHint:=HTMLHint+GetFPDocNodeAsHTML(FPDocFile,ElementNode.FindNode(FPDocItemNames[fpdiSeeAlso]));
|
||||||
HTMLHint:=HTMLHint+GetFPDocNodeAsHTML(FPDocFile,ElementNode.FindNode(FPDocItemNames[fpdiExample]));
|
HTMLHint:=HTMLHint+GetFPDocNodeAsHTML(FPDocFile,ElementNode.FindNode(FPDocItemNames[fpdiExample]));
|
||||||
@ -2816,8 +2829,8 @@ begin
|
|||||||
Result:='';
|
Result:='';
|
||||||
if AnOwner=nil then exit;
|
if AnOwner=nil then exit;
|
||||||
if AnOwner is TLazPackage then
|
if AnOwner is TLazPackage then
|
||||||
Result:='<a href="openpackage://'+TLazPackage(AnOwner).Name+'">'
|
Result:='<span class="seealso">Package <a href="openpackage://'+TLazPackage(AnOwner).Name+'">'
|
||||||
+'Package '+TLazPackage(AnOwner).Name+'</a>';
|
+TLazPackage(AnOwner).Name+'</a></span>';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCodeHelpManager.FreeDocs;
|
procedure TCodeHelpManager.FreeDocs;
|
||||||
|
Loading…
Reference in New Issue
Block a user