Menu

#741 [lexer_cpp] support inactive comment styles

Undefined
applied
lexers (2)
Patch
2018-09-29
2018-09-23
No

This patch adds new styles in lexer_cpp.xml for inactive comments (i.e., those disabled by the preprocessor). Attached are screenshots showing a custom theme making use of these styles, and the patch itself.

Newly added styles:

  • Comment (inactive)
  • Comment line (inactive)
  • Comment (documentation, inactive)
  • Comment line (documentation, inactive)
  • Comment keyword (documentation, inactive)
  • Comment keyword error (documentation, inactive)

By default they use the same values as the active styles.

3 Attachments

Discussion

  • Teodor Petrov

    Teodor Petrov - 2018-09-24

    Can you show the same images without these changes?
    I'm not sure it is a good idea to add them, because the C++ lexer setup is already confusing and there is no way to see visually what these change...

    So to properly implement these you have to modify the sample to use these styles, so people could see the results of their changes. I suppose you need to enable the preprocessor styling for this to work.

     
  • Gokul Krishnan

    Gokul Krishnan - 2018-09-24

    Can you show the same images without these changes?

    I've attached them.

    We already support inactive variants for other styles (see the attached styleslist.png), so I think it'd be nice to have inactive comment styles for completeness.

    We could add a #if 0 ... #endif block to the sample text to help preview these styles. It seems preprocessor styling is always enabled for the sample text window, even if the option is disabled in Editor settings. This should make things easier.

    Another option is to have a checkbox that turns the entire sample text into "inactive" state, but not sure about it yet.

     

    Last edit: Gokul Krishnan 2018-09-24
  • Gokul Krishnan

    Gokul Krishnan - 2018-09-24

    Here's a patch updating lexer_cpp.sample with some inactive code block.

     
  • Teodor Petrov

    Teodor Petrov - 2018-09-24

    I know that we have inactive styles, but I never knew what they affected.

    I don't think a check box is a good idea.
    Also, I'm not 100% sure, but I think it would be better if we have all inactive styles brouped togather. But this is a separate issue...

     
  • Teodor Petrov

    Teodor Petrov - 2018-09-29
    • status: open --> applied
    • assigned_to: Teodor Petrov
     

Log in to post a comment.

MongoDB Logo MongoDB