View Issue Details

IDProjectCategoryView StatusLast Update
0030302LazarusIDEpublic2021-03-03 11:26
ReporterAnton Assigned ToMattias Gaertner  
Status resolvedResolutionfixed 
Summary0030302: IDE Help: ChmHelp do not show help for ordinary procedures/functions
DescriptionChmHelp package should be installed.
When query help for some procedure (e.g. from RTL: sockets.fpconnect, crt.readkey etc.) code browser opens. When trying to query help for such RTL procedures as Pos, Delete help is shown but it is accidentally, because this is from help section for Keywords.
Little modification of FindDeclaration tool (see not_a.patch) fix situation, but I'm not so sure that the proposed solution is not a hack and do not break something. Some one more familiar with CT should check this.
TagsNo tags attached.
Fixed in Revision64733.
Attached Files


related to 0030303 closedMattias Gaertner Patches IDE help: directories for rtl-extra etc. 



2016-06-21 22:22


not_a.patch (545 bytes)   
Index: components/codetools/finddeclarationtool.pas
--- components/codetools/finddeclarationtool.pas	(revision 52519)
+++ components/codetools/finddeclarationtool.pas	(working copy)
@@ -5172,9 +5172,6 @@
       and NewTool.NodeIsForwardDeclaration(NewNode)
-      if (NewNode.Desc=ctnProcedure)
-      and ((NewNode.SubDesc and ctnsForwardDeclaration)>0) then
-        exit;
not_a.patch (545 bytes)   

Juha Manninen

2020-12-14 14:06

developer   ~0127607

Last edited: 2021-03-01 11:45

View 3 revisions

> "When query help for some procedure (...) code browser opens."
Do you mean you press F1 and the Code Browser opens.

Pessing F1 on Pos() opens LHelp with the right topic but not so with Delete().
The old patch is for nested procedure AddPos in function TFindDeclarationTool.FindDeclarationAndOverload, now around line 5740.
It makes no difference because AddPos did not skip anything.

Juha Manninen

2021-03-01 11:37

developer   ~0129269

Last edited: 2021-03-01 11:50

View 2 revisions

I defined VerboseFindDeclarationAndOverload in unit FindDeclarationTool.
This is the output for getting help for Delete() and Pos().
The former gives a message :
  No help found for "/home/juha/SW/lazarus_trunk/ide/main.pp" at (12591,7)
The latter opens lHelp as expected.
Pos() is a library function, Delete() is built in system somehow.

----------------------------------------- Pressing F1 on Delete() -----------------------

TCodeHelpManager.GetFPDocFilenameForSource Hint: Owner (package CodeTools) has no fpdoc file for: /home/juha/SW/lazarus_trunk/components/codetools/finddeclarationtool.pas
TIDEHelpManager.ShowHelpForSourcePosition A Filename=/home/juha/SW/lazarus_trunk/ide/main.pp (x=7,y=12591)
CollectDeclarations /home/juha/SW/lazarus_trunk/ide/main.pp line=12591 col=7
TFindDeclarationTool.FindDeclarationAndOverload START
TIDEHelpManager.ShowHelpForSourcePosition no declaration found, trying keywords...
TIDEHelpManager.ShowHelpForSourcePosition "Delete" is not an FPC keyword
TCodeHelpManager.GetFPDocFilenameForSource Hint: file without owner: /usr/lib/fpc/src/packages/rtl-objpas/src/inc/strutils.pp

----------------------------------------- Pressing F1 on Pos() -----------------------

TIDEHelpManager.ShowHelpForSourcePosition A Filename=/home/juha/SW/lazarus_trunk/ide/main.pp (x=6,y=12587)
CollectDeclarations /home/juha/SW/lazarus_trunk/ide/main.pp line=12587 col=6
TFindDeclarationTool.FindDeclarationAndOverload START
TFindDeclarationTool.FindDeclarationAndOverload Self="/home/juha/SW/lazarus_trunk/ide/main.pp"
  CurCursorPos=/usr/lib/fpc/src/rtl/inc/ 11,1228
AddPos skip, because in same unit
TFindDeclarationTool.FindDeclarationAndOverload Self="/home/juha/SW/lazarus_trunk/ide/main.pp"
  CurCursorPos=/usr/lib/fpc/src/rtl/inc/ 11,1227
AddPos skip, because in same unit
TFindDeclarationTool.FindDeclarationAndOverload Self="/home/juha/SW/lazarus_trunk/ide/main.pp"
  CurCursorPos=/usr/lib/fpc/src/rtl/inc/ 11,1176
AddPos skip, because in same unit
TFindDeclarationTool.FindDeclarationAndOverload Self="/home/juha/SW/lazarus_trunk/ide/main.pp"
  CurCursorPos=/usr/lib/fpc/src/rtl/inc/ 11,1173
TIDEHelpManager.ShowHelpForSourcePosition Success, number of declarations: 1
TIDEHelpManager.ShowHelpForSourcePosition Declaration at 00007F7D26D36280
TIDEHelpManager.ShowHelpForSourcePosition PascalHelpContextLists.Count=1 calling ShowHelpForPascalContexts...
THelpDatabase.GetNodesForPascalContexts C ID="RTLUnits" 1/1 FileItem.ClassName=THelpDBISourceDirectories Filename=/usr/lib/fpc/src/rtl/linux/system.pp 1
TFPDocHTMLHelpDatabase.ShowHelp A Unitname=system NewNode.HelpType=1 NewNode.Title=RTL - Free Pascal Run Time Library Units NewNode.URL=file://index.html
TFPDocHTMLHelpDatabase.ShowHelp Filename="pos." UnitName="system"
TFPDocHTMLHelpDatabase.ShowHelp BaseURL of Node.URL=""
TFPDocHTMLHelpDatabase.ShowHelp GetEffectiveBaseURL="rtl.chm://"
THTMLHelpDatabase.ShowURL B URL=rtl.chm://system/pos.html URLType=rtl.chm URLPath=system/pos.html URLParams=
TChmHelpViewer.ShowNode Filename="rtl.chm" SearchPath="/home/juha/SW/lazarus_trunk/docs/chm;/home/juha/SW/lazarus_trunk/docs/html;/home/juha/SW/lazarus_trunk/docs/html/lcl" Found="/home/juha/SW/lazarus_trunk/docs/chm/rtl.chm"
got BeginUpdate
got rturl, filename /home/juha/SW/lazarus_trunk/docs/chm/rtl.chm, url /system/pos.html
got EndUpdate
got rtmisc/mrShow
mrShow OpenUrl file:///home/juha/SW/lazarus_trunk/docs/chm/rtl.chm:///system/pos.html

Mattias Gaertner

2021-03-02 15:04

manager   ~0129321

Delete is a built-in function in FPC.
The IDE needs a list of built-in functions and the corresponding help paths.

Juha Manninen

2021-03-02 17:23

developer   ~0129325

> The IDE needs a list of built-in functions and the corresponding help paths.

Codetools already has them, hasn't it?
At least there are function parameter in-place hints for Delete().

Mattias Gaertner

2021-03-03 11:26

manager   ~0129341

Turns out, the chmhelp code needed an update due to changes in FPC chm units.

Issue History

Date Modified Username Field Change
2016-06-21 22:22 Anton New Issue
2016-06-21 22:22 Anton File Added: not_a.patch
2016-06-21 23:28 Juha Manninen Relationship added related to 0030303
2020-12-14 14:06 Juha Manninen Note Added: 0127607
2021-02-28 14:02 Juha Manninen Assigned To => Juha Manninen
2021-02-28 14:02 Juha Manninen Status new => assigned
2021-02-28 20:12 Juha Manninen Note Edited: 0127607 View Revisions
2021-03-01 11:37 Juha Manninen Note Added: 0129269
2021-03-01 11:45 Juha Manninen Note Edited: 0127607 View Revisions
2021-03-01 11:50 Juha Manninen Note Edited: 0129269 View Revisions
2021-03-02 15:04 Mattias Gaertner Note Added: 0129321
2021-03-02 17:23 Juha Manninen Note Added: 0129325
2021-03-03 11:26 Mattias Gaertner Assigned To Juha Manninen => Mattias Gaertner
2021-03-03 11:26 Mattias Gaertner Status assigned => resolved
2021-03-03 11:26 Mattias Gaertner Resolution open => fixed
2021-03-03 11:26 Mattias Gaertner Fixed in Revision => 64733.
2021-03-03 11:26 Mattias Gaertner LazTarget => -
2021-03-03 11:26 Mattias Gaertner Note Added: 0129341