mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-08 11:58:12 +02:00
IDE: source help: show by default only one identifier per unit, ignoring overloads, avoiding to show the select dialog for e.g. "format"
git-svn-id: branches/fixes_1_6@53879 -
This commit is contained in:
parent
e6e37ab21a
commit
a9c33ff941
@ -51,6 +51,8 @@ type
|
||||
{ TBaseHelpManager }
|
||||
|
||||
TBaseHelpManager = class(TComponent)
|
||||
private
|
||||
FCombineSameIdentifiersInUnit: boolean;
|
||||
public
|
||||
procedure ConnectMainBarEvents; virtual; abstract;
|
||||
procedure LoadHelpOptions; virtual; abstract;
|
||||
@ -75,6 +77,9 @@ type
|
||||
ResolveIncludeFiles: Boolean;
|
||||
out AnOwner: TObject// a package or a project or LazarusHelp or nil for user defined
|
||||
): string; virtual; abstract;
|
||||
|
||||
property CombineSameIdentifiersInUnit: boolean
|
||||
read FCombineSameIdentifiersInUnit write FCombineSameIdentifiersInUnit;
|
||||
end;
|
||||
|
||||
|
||||
|
@ -1358,6 +1358,7 @@ begin
|
||||
HelpViewers:=THelpViewers.Create;
|
||||
RegisterIDEHelpDatabases;
|
||||
RegisterDefaultIDEHelpViewers;
|
||||
CombineSameIdentifiersInUnit:=true;
|
||||
|
||||
CodeHelpBoss:=TCodeHelpManager.Create(Self);
|
||||
|
||||
@ -1475,6 +1476,7 @@ function TIDEHelpManager.ShowHelpForSourcePosition(const Filename: string;
|
||||
ListOfPCodeXYPosition: TFPList;
|
||||
CurCodePos: PCodeXYPosition;
|
||||
i: Integer;
|
||||
Flags: TFindDeclarationListFlags;
|
||||
begin
|
||||
Complete:=false;
|
||||
Result:=shrHelpNotFound;
|
||||
@ -1482,8 +1484,12 @@ function TIDEHelpManager.ShowHelpForSourcePosition(const Filename: string;
|
||||
PascalHelpContextLists:=nil;
|
||||
try
|
||||
// get all possible declarations of this identifier
|
||||
debugln(['CollectDeclarations ',CodeBuffer.Filename,' line=',CodePos.Y,' col=',CodePos.X]);
|
||||
Flags:=[fdlfWithoutEmptyProperties,fdlfWithoutForwards];
|
||||
if CombineSameIdentifiersInUnit then
|
||||
Include(Flags,fdlfOneOverloadPerUnit);
|
||||
if CodeToolBoss.FindDeclarationAndOverload(CodeBuffer,CodePos.X,CodePos.Y,
|
||||
ListOfPCodeXYPosition,[fdlfWithoutEmptyProperties,fdlfWithoutForwards])
|
||||
ListOfPCodeXYPosition,Flags)
|
||||
then begin
|
||||
if ListOfPCodeXYPosition=nil then exit;
|
||||
debugln('TIDEHelpManager.ShowHelpForSourcePosition Success, number of declarations: ',dbgs(ListOfPCodeXYPosition.Count));
|
||||
|
Loading…
Reference in New Issue
Block a user