mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-04 16:17:54 +02:00
IDE: moved code to find hint for source position to helpmanager
git-svn-id: trunk@12987 -
This commit is contained in:
parent
6874d3b117
commit
9c3ea995b8
@ -116,10 +116,10 @@ type
|
||||
function AsString: string;
|
||||
function GetDesc: TCodeTreeNodeDesc;
|
||||
constructor Create(NewCompatibility: TIdentifierCompatibility;
|
||||
NewHasChilds: boolean; NewHistoryIndex: integer;
|
||||
NewIdentifier: PChar; NewLevel: integer;
|
||||
NewNode: TCodeTreeNode; NewTool: TFindDeclarationTool;
|
||||
NewDefaultDesc: TCodeTreeNodeDesc);
|
||||
NewHasChilds: boolean; NewHistoryIndex: integer;
|
||||
NewIdentifier: PChar; NewLevel: integer;
|
||||
NewNode: TCodeTreeNode; NewTool: TFindDeclarationTool;
|
||||
NewDefaultDesc: TCodeTreeNodeDesc);
|
||||
function IsProcNodeWithParams: boolean;
|
||||
function IsPropertyWithParams: boolean;
|
||||
function CheckHasChilds: boolean;
|
||||
|
@ -101,6 +101,9 @@ type
|
||||
var ErrMsg: string): TShowHelpResult; override;
|
||||
procedure ShowHelpForMessage(Line: integer); override;
|
||||
procedure ShowHelpForObjectInspector(Sender: TObject); override;
|
||||
function GetHintForSourcePosition(const ExpandedFilename: string;
|
||||
const CodePos: TPoint;
|
||||
out Hint: string): TShowHelpResult;
|
||||
|
||||
function ConvertSourcePosToPascalHelpContext(const CaretPos: TPoint;
|
||||
const Filename: string): TPascalHelpContextList; override;
|
||||
@ -873,6 +876,19 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function THelpManager.GetHintForSourcePosition(const ExpandedFilename: string;
|
||||
const CodePos: TPoint; out Hint: string): TShowHelpResult;
|
||||
var
|
||||
Code: TCodeBuffer;
|
||||
begin
|
||||
Hint:='';
|
||||
Code:=CodeToolBoss.LoadFile(ExpandedFilename,true,false);
|
||||
if Code=nil then exit;
|
||||
Hint:=CodeToolBoss.FindSmartHint(Code,CodePos.X,CodePos.Y);
|
||||
CodeToolBoss.Abortable:=false;
|
||||
|
||||
end;
|
||||
|
||||
function THelpManager.ConvertSourcePosToPascalHelpContext(
|
||||
const CaretPos: TPoint; const Filename: string): TPascalHelpContextList;
|
||||
var
|
||||
|
@ -11999,9 +11999,10 @@ begin
|
||||
writeln('[TMainIDE.OnSrcNotebookShowHintForSource] ************ ',ActiveUnitInfo.Source.Filename,' X=',CaretPos.X,' Y=',CaretPos.Y);
|
||||
{$ENDIF}
|
||||
{$IFDEF IDE_MEM_CHECK}CheckHeapWrtMemCnt('TMainIDE.OnSrcNotebookShowHintForSource A');{$ENDIF}
|
||||
SmartHintStr:=CodeToolBoss.FindSmartHint(ActiveUnitInfo.Source,
|
||||
CaretPos.X,CaretPos.Y);
|
||||
CodeToolBoss.Abortable:=false;
|
||||
{$IFDEF EnableLazDocHint}
|
||||
THelpManager(HelpBoss).GetHintForSourcePosition(ActiveUnitInfo.Filename,
|
||||
CaretPos,SmartHintStr);
|
||||
{$ENDIF}
|
||||
{$IFDEF IDE_MEM_CHECK}CheckHeapWrtMemCnt('TMainIDE.OnSrcNotebookShowHintForSource B');{$ENDIF}
|
||||
end;
|
||||
itDebugger: begin
|
||||
|
Loading…
Reference in New Issue
Block a user