Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2014-09

Help system questions

7 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Reinier Olislagers

Hi list (and Laz devs),

I'm working on fixing some things in the help system.

1. function TChmHelpViewer.ShowNode(Node: THelpNode; var ErrMsg: string
  ): TShowHelpResult;
in
components\chmhelp\packages\idehelp\lazchmhelp.pas
has
  if Pos('file://', Node.URL) = 1 then
  begin
    Result := PassTheBuck(Node, ErrMsg);
    Exit;
  end;

Is ignoring the results of the PassTheBuck (nice name ;) ) call on purpose or should it be changed to Exit(Result)?

2. My patch in
http://bugs.freepascal.org/view.php?id=26079
seems to work ok: for context-sensitive lhelp is started, hidden, loads .chm files and then is shown once the files are loaded. Then it shows the help for the requested item.

However, after a couple of seconds (which suggests a timeout error in the IPC communication) the IDE starts the Code Browser, looking for the identifier.

Getting a bit tired, so perhaps somebody can tell me where the fallback to showing the code browser is coded...

Thanks,
Reinier

Reply by email

Rik van Kekem
to Reinier Olislagers
Reinier Olislagers wrote 13 lines
1. function TChmHelpViewer.ShowNode(Node: THelpNode; var ErrMsg: string ): TShowHelpResult; in components\chmhelp\packages\idehelp\lazchmhelp.pas has if Pos('file://', Node.URL) = 1 then begin Result := PassTheBuck(Node, ErrMsg); Exit; end; Is ignoring the results of the PassTheBuck (nice name ;) ) call on purpose or should it be changed to Exit(Result)?

Just above Exit the "Result" of the function is already set in Result so there is no need for the parameter in Exit (it's already set). (Even the ErrMsg is given back via the var-parameter of ShowNode)

(You were probably really tired :))

Reply by email

Reinier Olislagers
to Rik van Kekem
Rik van Kekem wrote 6 lines
On 13-09-2014 07:00, Reinier Olislagers wrote: Just above Exit the "Result" of the function is already set in Result so there is no need for the parameter in Exit (it's already set). (Even the ErrMsg is given back via the var-parameter of ShowNode) (You were probably really tired :))

Thanks, yes, you're right.

Not surprisingly, fiddling with the code did not change my main problem: the Code Browser still pops up even after succesfully showing help.... but enabling the lazarus log did show this:
TIDEHelpManager.ShowHelpForSourcePosition no declaration found, trying keywords ...
TChmHelpViewer.ShowNode Filename="ref.chm"
SearchPath="D:\Docs\Pascal\LazarusHelp"
Found="D:\Docs\Pascal\LazarusHelp\ref.chm"
LHelpControl: WaitForMsgResponse: hit timeout (10) TIDEHelpManager.ShowHelpForSourcePosition "not" is not a FPC keyword, search via code browser ...

which gives me something to work with (after a good night's sleep :) ): I get a timeout message which shouldn't happen so either a response is still not received in time (too early or too late) or not the main reason why I started this patch ;)

Ah well...

Reply by email

Reinier Olislagers
to Reinier Olislagers: I'm working on fixing some things in the help system. 1. function…
Reinier Olislagers wrote
However, after a couple of seconds (which suggests a timeout error in the IPC communication) the IDE starts the Code Browser, looking for the identifier.

Posting for reference:
After a good night's sleep, some logging found this probable location: ide\idehelpmanager.pas
function TIDEHelpManager.ShowHelpForSourcePosition(const Filename: string;

  const CodePos: TPoint; var ErrMsg: string): TShowHelpResult;

which tries to show context-sensitive help, and on failure shows the code browser

Reply by email

Reinier Olislagers
to Reinier Olislagers: I'm working on fixing some things in the help system. 1. function…
Reinier Olislagers wrote 6 lines
I'm working on fixing some things in the help system. 2. My patch in http://bugs.freepascal.org/view.php?id=26079 seems to work ok: for context-sensitive lhelp is started, hidden, loads .chm files and then is shown once the files are loaded. Then it shows the help for the requested item.

Just implemented a fix for this that works for me on FPC trunk x86, Lazarus trunk, Windows.
Menu Help/Help should also show help contents (after starting up lhelp).

Would appreciate people on other platforms to test and tell me if it doesn't work.
Thanks.

Reply by email

Richard Mace
to Reinier Olislagers

Excellent, is this likely to get into 1.26?

Richard

Reinier Olislagers wrote 23 lines
On 13/09/2014 07:00, Reinier Olislagers wrote: > I'm working on fixing some things in the help system. > 2. My patch in > http://bugs.freepascal.org/view.php?id=26079 > seems to work ok: for context-sensitive lhelp is started, hidden, loads > .chm files and then is shown once the files are loaded. > Then it shows the help for the requested item. Just implemented a fix for this that works for me on FPC trunk x86, Lazarus trunk, Windows. Menu Help/Help should also show help contents (after starting up lhelp). Would appreciate people on other platforms to test and tell me if it doesn't work. Thanks. -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140919/304b2a7c/attachment.html>

Reply by email

Reinier Olislagers
to Richard Mace
Richard Mace wrote 22 lines
Excellent, is this likely to get into 1.26? Richard On 19 September 2014 12:42, Reinier Olislagers < <mailto:>> wrote: On 13/09/2014 07:00, Reinier Olislagers wrote: > I'm working on fixing some things in the help system. > 2. My patch in > http://bugs.freepascal.org/view.php?id=26079 > seems to work ok: for context-sensitive lhelp is started, hidden, loads > .chm files and then is shown once the files are loaded. > Then it shows the help for the requested item. Just implemented a fix for this that works for me on FPC trunk x86, Lazarus trunk, Windows. Menu Help/Help should also show help contents (after starting up lhelp). Would appreciate people on other platforms to test and tell me if it doesn't work. Thanks.

Please don't top-post when others bottom-post, thanks.

I would first like to see this tested out well across a range of machines as the lhelp simpleIPC code seems to be timing-sensitive, so no, I don't think so.

Thanks.

Reply by email