Author Topic: Code incorrectly showing as comment block instead of code  (Read 1960 times)

Offline AndrewCot

  • Almost regular
  • **
  • Posts: 192
Code incorrectly showing as comment block instead of code
« on: July 14, 2021, 08:41:13 am »
I loaded debuggersettingsdlg.cpp and scrolled down a small amount where line 35 (DebuggerSettingsDlg::DebuggerSettingsDlg(wxWindow* parent) function is showing and it looks like lines 37 through  74 are comments due to the "//(*" on line 37, BUT only lines 37 and 74 should be shown as comments. There are a number of other files using the

The code for the "//(*" and "//*)" was add in the following change when I used github's blame functionality:
    git-svn-id: https://svn.code.sf.net/p/codeblocks/code/[email protected]
    https://github.com/obfuscated/codeblocks_sf/commit/8c7af98cea43f2368d5f3a4c793f3471e7745084

I searched the wiki and Code::Blocks manual 2.0.1 and only found a reference to "//(*" on the following page and after reading it it looks like the code should not be shown as a comment block as it was generated by wxSmith, which uses the "//(*" and "//*)" for the start and end of the generated code.
  https://wiki.codeblocks.org/index.php/WxSmith_tutorial:_Working_with_multiple_resources

I cannot see where I can set the options.highlightWxSmith in the LexCPP.cxx to false. I do not have time to chase this issue at the moment to see if it is a bug or if I have miss configured something.

A such is this a bug or if you open the debuggersettingsdlg.cpp does it displays lines 37 through 74 correctly? If it's a bug I will raise a ticket.

Offline Miguel Gimenez

  • Lives here!
  • ****
  • Posts: 801
Re: Code incorrectly showing as comment block instead of code
« Reply #1 on: July 14, 2021, 09:54:43 am »
The highlighting of the block indicates that the block should not be edited.

You can change highlighting using Settings -> Editor -> Syntax highlighting -> wxSmith generated code

Offline AndrewCot

  • Almost regular
  • **
  • Posts: 192
Re: Code incorrectly showing as comment block instead of code
« Reply #2 on: July 15, 2021, 01:22:49 pm »
Miguel, Thanks very much for the post. It helped allot.

Do you think the wiki page should include a note or text that "You can change highlighting using Settings -> Editor -> Syntax highlighting -> wxSmith generated code", so that in the future other devs don't fall into the same hole as I did?

Offline Miguel Gimenez

  • Lives here!
  • ****
  • Posts: 801
Re: Code incorrectly showing as comment block instead of code
« Reply #3 on: July 15, 2021, 04:12:34 pm »
The page does not mentoin highlighting at all, so IMHO if you want to say that you should first say something like "The whole block is hilghlighted differently to remark it must not be modified. You can change...".