Hints for method name missing comments lazarus / 9-Editor ---------------------------------------------------------------------- dbannon · 2025-06-19 11:09 I have just noticed a rather sad change between Lazarus_4_0 and its predecessors.  I'm hoping I'm doing something silly. See the attached images, one taken in Lazarus 3.6, one in Lazarus 4.0, same code, same project etc. In both cases, the mouse pointer is over a method name under implementation. I have a few lines of comments immediately above the method declaration. Lazarus 4.0 has declined to show the comments. I cannot see a relevant setting (and why would we want one ?). Any thoughts ? ---------------------------------------------------------------------- Martin_fr · 2025-06-19 12:52 Maybe https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/14384 Though yours don't seem to have fpdoc info... ---------------------------------------------------------------------- bobby100 · 2025-06-19 14:06 It seems related to https://forum.lazarus.freepascal.org/index.php/top ic,70369.msg548794.html#msg548794 Previous Lazarus versions used the comments from source files as info ---------------------------------------------------------------------- MarkMLl · 2025-06-19 14:13 I might be barking (and slavering up the wrong tree :-) but in the past (v2 and older, v3 untested) I've noticed that inline comments weren't presented as hints if the first line of the unit was formatted unexpectedly. I mention this because there's a possibility that a change in the way that the v4 IDE is processing the start of the unit might have inadvertently messed up the hinting: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i // unit THIS LINE NEEDED FOR DECLARATION HINTING TO WORK(* Return either a static or a dynamic representation of the Asound embedding  library (libasound.a or similar). In this case it is static.*)unit test; (**** ********************************************************************** ******)(*                                                                            *)(* WARNING: This is a machine-generated file and manual changes will be lost.   *)(*                                                                            *)(************************* *******************************************************) {$mode objfpc}{$H+}{$packrecords C}...  What's happening there is that the unit (a .pas file) was generated from a .inc, and there was a comment at the start of the .inc saying what it was intended to do... which for reasons which were perfectly sensible at the time I was keeping as early as possible rather than shuffling the mechanically-generated unit line right to the start. Updated: I almost certainly did it like that so that the unit name itself had a comment, which potentially showed up as a hint. MarkMLl ---------------------------------------------------------------------- dsiders · 2025-06-19 15:32 Quote from: dbannon on June 19, 2025, 01:09:15 pmI have just noticed a rather sad change between Lazarus_4_0 and its predecessors.  I'm hoping I'm doing something silly. See the attached images, one taken in Lazarus 3.6, one in Lazarus 4.0, same code, same project etc. In both cases, the mouse pointer is over a method name under implementation. I have a few lines of comments immediately above the method declaration. Lazarus 4.0 has declined to show the comments. I cannot see a relevant setting (and why would we want one ?). Any thoughts ? We do not see the comments which you expect in the pop-up. Is there any blank lines after the comment and before the symbol? That breaks the association with the following identifier. ---------------------------------------------------------------------- dbannon · 2025-06-20 01:40 Thanks folks. I must emphasize this is not an issue with whats in my source. There is a clear difference between Lazarus 3.6 and Lazarus 4.0. Same source. It could be an IDE setting but  cannot find anything like it. Attached are two new images, again 3.6 and 4.0. Its just a "new Application" form, one event, FormClick added, a comment applied to the method definition, it shows in 3.6 but not 4.  (Whitespace removed to make for smaller images). No Don, the comments have no whitespace between comment and declaration line. See new images. Mark, I copied and pasted the comments from your example to the top of my simple test. No better. Hmm, Bobby100, that apears similar. But I do have a space between '//' and text of comment, as seen in attached mages. Martin no, I am not using fpdoc. And my problem is not duplicate comments, its no comments ! Attached two simplistic demos. Also a third image that shows it working correctly on a comment consisting of the declaration ! How weird is that ? Are other people not experiencing this ? Davo ---------------------------------------------------------------------- MarkMLl · 2025-06-20 12:17 Does this only affect method names (i.e. being declared in the context of a class) or does it also apply to ordinary functions? MarkMLl ---------------------------------------------------------------------- CM630 · 2025-06-20 14:03 Quote from: bobby100 on June 19, 2025, 04:06:48 pmIt seems related to https://forum.lazarus.freepascal.org/index.php/topic,70369.msg548794.h tml#msg548794 Previous Lazarus versions used the comments from source files as info I am still interested in that. ---------------------------------------------------------------------- dbannon · 2025-06-21 00:54 Quote from: MarkMLl on June 20, 2025, 02:17:23 pmDoes this only affect method names (i.e. being declared in the context of a class) or does it also apply to ordinary functions? Yes Mark, applies to ordinary functions too. So, a function implemented in  implementation  section, declared and commented in interface section will not show the comment when mouse is hovered over the starting line of the function implementation.  Now, interesting, if I add "//" in front of that starting line of the function implementation, so it becomes a comment, mouse hover shows what it should. But I have to remember to remove those "//" before compiling ! (Class method or stand alone function). It is so very easy to demonstrate, I take it no one else can replicate this problem ?  Please say so ! I am starting to question my sanity. Start Lazarus 4.0 Choose a new Project, Application (no need to save or compile). Add an event to the form, eg OnClick In the Interface, where the type is declared, add a comment immediately above the declaration of the event -Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i     TForm1 = class(TForm)                         // This is FormClick                      << add this comment !        procedure FormClick(Sender: TObject);    private Now, hover the mouse over the "procedure TForm1.FormClick(Sender: TObject);" in implementation - do you see the comment ? Davo ---------------------------------------------------------------------- dsiders · 2025-06-21 01:56 There are situations where it works, and some where it does not. Case in point: TStrings.TrailingLineBreak. This topic does not exist in the 3.2.2 help file, so there is no XML content, It has an in-source comment. If you try to hover over it in the classesh.inc file where it is found... the comment does not appear in the code help. If you hover over a statement (in another unit) which uses that identifier, the comment does appear in the Code Help. See attachments. [ This is using the main branch ] ---------------------------------------------------------------------- dbannon · 2025-06-21 02:10 Quote from: dsiders on June 21, 2025, 03:56:15 amThere are situations where it works, and some where it does not. Case in point: TStrings.TrailingLineBreak. This topic does not exist in the 3.2.2 help file, so there is no XML content, It has an in-source comment. If you try to hover over it in the classesh.inc file where it is found... the comment does not appear in the code help. If you hover over a statement (in another unit) which uses that identifier, the comment does appear in the Code Help. See attachments. Thanks Don, its not my imagination !  I'll check its a problem in trunk, try a few other platforms and log a bug report.  Seems to be limited to in source comments (good), I think its cute when looking at a method in my code, I cannot see my comments. But if the method name is used in a comment or debug statement (I do that a lot) I can see it ! Anyway, thats for that confirmation. Davo ---------------------------------------------------------------------- dsiders · 2025-06-21 02:13 Quote from: dbannon on June 21, 2025, 04:10:24 amQuote from: dsiders on June 21, 2025, 03:56:15 amThere are situations where it works, and some where it does not. Case in point: TStrings.TrailingLineBreak. This topic does not exist in the 3.2.2 help file, so there is no XML content, It has an in-source comment. If you try to hover over it in the classesh.inc file where it is found... the comment does not appear in the code help. If you hover over a statement (in another unit) which uses that identifier, the comment does appear in the Code Help. See attachments. Thanks Don, its not my imagination !  I'll check its a problem in trunk, try a few other platforms and log a bug report.  Seems to be limited to in source comments (good), I think its cute when looking at a method in my code, I cannot see my comments. But if the method name is used in a comment or debug statement (I do that a lot) I can see it ! Anyway, thats for that confirmation. Davo IMO, hovering on something in the same unit seems to be the snag. ---------------------------------------------------------------------- cdbc · 2025-06-21 07:54 Hi QuoteIMO, hovering on something in the same unit seems to be the snag. +1 I've noticed that too. Regards Benny ---------------------------------------------------------------------- JuhaManninen · 2025-06-21 15:36 There was an uninitialized variable that may have prevented showing the source comments. I fixed it in 95eaa30d4e. Please test. I merged it to fixes_4. ---------------------------------------------------------------------- dbannon · 2025-06-22 00:31 Yep, you have fixed it Juha, now works as it should !  Once again, I thank you ! Lets hear from CM630 ? Thanks to all involved here, feels heaps better !  I guess I'll use fixes 4 for now, makes no difference to output files but my workflow is a lot more comfortable. Davo edit : wow, that issue has a history !  Your persistence paid off Juha. ---------------------------------------------------------------------- dsiders · 2025-06-22 00:34 Glad it's solved... but I'm confused. Why does a variable declared as Boolean not default to False? ---------------------------------------------------------------------- CM630 · 2025-06-22 06:01 Quote from: dbannon on June 22, 2025, 02:31:35 amYep, you have fixed it Juha, now works as it should !  Once again, I thank you ! Lets hear from CM630 ? ... Sorry, I did not understand what I shall say or do? ---------------------------------------------------------------------- dbannon · 2025-06-22 06:38 Sorry, I did not understand what I shall say or do? [/quote] I'm wondering if that solves https://forum.lazarus.freepascal.org/inde x.php/topic,70369.msg548794.html#msg548794 Davo ---------------------------------------------------------------------- dbannon · 2025-06-22 06:44 Quote from: dsiders on June 22, 2025, 02:34:35 am Glad it's solved... but I'm confused. Why does a variable declared as Boolean not default to False? No default is applied if its declared in a method as I understand it. Davo ---------------------------------------------------------------------- CM630 · 2025-06-22 08:35 Quote from: dbannon on June 22, 2025, 08:38:35 amI'm wondering if that solves https://forum.lazarus.freepascal.org/index.php/topic,70369.msg5 48794.html#msg548794 Hm, how could I test it? Run FCUPDeluxe, select FPC Version = Trunk, Lazarus Version = fixes-4.0 , the press Install / update FPC + Lazarus? Quote from: JuhaManninen on June 21, 2025, 05:36:46 pm... I fixed it in 95eaa30d4e. Please test. I merged it to fixes_4. No idea what the bold things mean, so I am guessing. ---------------------------------------------------------------------- dbannon · 2025-06-22 10:50 Sorry CM, was not trying to get you to do things outside your comfort zone. Yep, fpupdeluxe would work if you like that. Would you consider using that rather than your existing install in future ?   If not, maybe its not worth the effort ?  Your call. Davo ---------------------------------------------------------------------- CM630 · 2025-06-23 05:55 Lazarus 4.1 (rev lazarus_4_0-77-gc52a98dba2) FPC 3.3.1 i386-win32-win32/win64 Trying to compile my control, that builds in Lazarus 4.0. I get : scales.pas(99,31) Error: This kind of property cannot be published for   Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   property Format : TFormat read FDisplayFormat write SetDisplayFormat;in: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i TDisplayFormat = class(TPersistent)  private    FParent : TWinControl;     FDisplayFormat: TFormat;    FPrecision : UInt8;  public    constructor Create(aParent: TWinControl); //override;    destructor Destroy; override;    procedure SetDisplayFormat(Value: TFormat);    procedure SetPrecision(Value: UInt8);  published    property Format : TFormat read FDisplayFormat write SetDisplayFormat;    property Precision : UInt8 read FPrecision write SetPrecision;end;   TFormat is  Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i TFormat =            (FloatingPoint = 0, Scientific = 1, Binary = 3, Octal = 4, Hexadecimal = 5, RelativeTime = 6, AbsoluteTime = 7, SINotattion = 8, AutomaticFormatting = 9, Decimal = 9); Then I tried TLazSerial, added comments for two properties (one with a space after // and another without a space), and they are shown, so the issue seems to be fixed (see the image attached). Another oddity that I noticed is that loading APKs is very slow (the time from selecting an LPK from the file dialogue until the LPK window is shown). ---------------------------------------------------------------------- MarkMLl · 2025-06-24 19:41 Quote from: dbannon on June 22, 2025, 02:31:35 amedit : wow, that issue has a history !  Your persistence paid off Juha. Regrettably, I'll have to leave my unit generator at https://github.com/MarkMLl/dynamod unchanged since it is going to be a very long time before it's safe to assume that the average Github user is on a fully-fixed v4. I know that I'm being reactionary (or something) here, but if I publish Pascal code I want it to be usable by anybody, not just by those committed enough to ignore the version of Lazarus made available by their distro/store and work out how to use the very latest version published by the Lazarus project itself. MarkMLl ---------------------------------------------------------------------- MarkMLl · 2025-06-24 19:46 Quote from: dbannon on June 20, 2025, 03:40:28 amMartin no, I am not using fpdoc. And my problem is not duplicate comments, its no comments ! OK, particularly noting the machine-generated example at https://forum .lazarus.freepascal.org/index.php/topic,71559.msg558705/topicseen.html this looks like something I need to be aware of. Where is the markup format documented? MarkMLl ---------------------------------------------------------------------- dsiders · 2025-06-24 20:17 Quote from: MarkMLl on June 24, 2025, 09:46:04 pmQuote from: dbannon on June 20, 2025, 03:40:28 amMartin no, I am not using fpdoc. And my problem is not duplicate comments, its no comments ! OK, particularly noting the machine-generated example at https://forum .lazarus.freepascal.org/index.php/topic,71559.msg558705/topicseen.html this looks like something I need to be aware of. Where is the markup format documented? MarkMLl What markup format? It's a comment. The example you point to is not fpdoc tagging... even though it says it is. It pidgin PasDoc, and fpdoc knows nothing about PasDoc. So unless you're using PasDoc and not FPDoc to generate help... there is no markup for in-source comments. ---------------------------------------------------------------------- JuhaManninen · 2025-06-25 04:09 Quote from: CM630 on June 22, 2025, 10:35:52 amQuote from: JuhaManninen on June 21, 2025, 05:36:46 pmI fixed it in 95eaa30d4e. Please test. I merged it to fixes_4. No idea what the bold things mean, so I am guessing. https://gitlab.com/freepascal.org/lazarus/lazarus/- /commit/95eaa30d4e183636f12e791128ea983d5605cfb0 https://gitlab.com/freepascal.org/lazarus/lazarus/- /commit/59d8be35fd76497695f64d2722a4ec499bcbbadd Quote from: MarkMLl on June 24, 2025, 09:41:41 pmRegrettably, I'll have to leave my unit generator at https://github.com/MarkMLl/dynamod unchanged since it is going to be a very long time before it's safe to assume that the average Github user is on a fully-fixed v4. How is that related to the comment hints? ---------------------------------------------------------------------- MarkMLl · 2025-06-25 07:35 Quote from: JuhaManninen on June 25, 2025, 06:09:29 amQuote from: MarkMLl on June 24, 2025, 09:41:41 pmRegrettably, I'll have to leave my unit generator at https://github.com/MarkMLl/dynamod unchanged since it is going to be a very long time before it's safe to assume that the average Github user is on a fully-fixed v4. How is that related to the comment hints? An earlier posting queried fpdoc Quote from: Martin_fr on June 19, 2025, 02:52:53 pmMaybe https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/14384 Though yours don't seem to have fpdoc info... which I assumed related to markup in comments relating to parameters and return value. MarkMLl ---------------------------------------------------------------------- JuhaManninen · 2025-06-25 08:37 Quote from: MarkMLl on June 25, 2025, 09:35:04 amwhich I assumed related to markup in comments relating to parameters and return value. Ah, OK. No markup there. The comment shown in a hint is kind of a fallback plan when there is no fpdoc XML documentation. ---------------------------------------------------------------------- MarkMLl · 2025-06-25 08:54 Quote from: JuhaManninen on June 25, 2025, 10:37:41 amNo markup there. The comment shown in a hint is kind of a fallback plan when there is no fpdoc XML documentation. The comment-used-as-hint I obviously knew about. But from the link I posted https://forum.lazarus.freepascal.org/index.php/topic,71559.msg5 58705/topicseen.html I assumed that there was a very small amount of internal markup... or was that related strictly to his project? MarkMLl