IDE: Display a HTML hind, even if codetools fails. (for debugger). Issue #40923

This commit is contained in:
Martin 2024-10-03 13:55:17 +02:00
parent ab08a3c959
commit 6e858619fd
2 changed files with 13 additions and 0 deletions

View File

@ -311,6 +311,7 @@ type
function GetElementChain(Code: TCodeBuffer; X, Y: integer; Complete: boolean;
out Chain: TCodeHelpElementChain;
out CacheWasUsed: boolean): TCodeHelpParseResult;
function GetHTMLStub(out BaseURL, HTMLHint: string): TCodeHelpParseResult;
function GetHTMLHint(Code: TCodeBuffer; X, Y: integer; Options: TCodeHelpHintOptions;
out BaseURL, HTMLHint, PropDetails: string;
out CacheWasUsed: boolean): TCodeHelpParseResult;
@ -2441,6 +2442,16 @@ begin
end;
end;
function TCodeHelpManager.GetHTMLStub(out BaseURL, HTMLHint: string): TCodeHelpParseResult;
begin
Result:=chprSuccess;
BaseURL:='lazdoc://';
HTMLHint:='<html><head><link rel="stylesheet" href="lazdoc://lazarus/lazdoc.css" type="text/css">'+LineEnding
+'<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head>'+LineEnding
+'<body>'+ LineEnding
+'</body></html>';
end;
function TCodeHelpManager.GetHTMLHint(Code: TCodeBuffer; X, Y: integer;
Options: TCodeHelpHintOptions;
out BaseURL, HTMLHint, PropDetails: string;

View File

@ -11698,6 +11698,8 @@ begin
HasHint:=true;
{$IFDEF IDE_MEM_CHECK}CheckHeapWrtMemCnt('TMainIDE.SrcNotebookShowHintForSource B');{$ENDIF}
end;
if SmartHintStr = '' then
CodeHelpBoss.GetHTMLStub(BaseURL, SmartHintStr);
if HasHint then
begin