diff --git a/components/ideintf/idehelpintf.pas b/components/ideintf/idehelpintf.pas index 1a90ee1376..d2b4283ba6 100644 --- a/components/ideintf/idehelpintf.pas +++ b/components/ideintf/idehelpintf.pas @@ -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; diff --git a/ide/idehelpmanager.pas b/ide/idehelpmanager.pas index ad0b37dbdd..761aa546b2 100644 --- a/ide/idehelpmanager.pas +++ b/ide/idehelpmanager.pas @@ -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));