Skip to content

c/c++ Confuse the macro and prepress #8600

@heartacker

Description

@heartacker
#ifndef __AC7840X_ANA_REG_H__
#define __AC7840X_ANA_REG_H__
/*====================================================================================================================**
                                                        ANA start
**====================================================================================================================*/

#define _ANA_Base 0x40008800 /*!< Analog Registers */

#define _ANA_SYSLDO_CFG0_Addr (_ANA_Base + 0x0000) /*!< (@0x40008800) SYSLDO CONFIGURATION 0 REGISTER */
#define _ANA_SYSLDO_CFG1_Addr (_ANA_Base + 0x0004) /*!< (@0x40008804) SYSLDO Configuration Register1 */
#endif
  • can any body tell me what is the diffenence between macro and preprocess?

  • with the setteing and disable c/c++ externion

     "editor.tokenColorCustomizations": {
         "textMateRules": [
             {
                 "scope": [
                     "entity.name.function.preprocessor",
                     "entity.name.variable.preprocessor.symbol.cs",
                 ],
                 "settings": {
                     "foreground": "#be5c44",
                     "fontStyle": ""
                 }
             },
             {
                 "scope": [
                     "meta.preprocessor.macro",
                 ],
                 "settings": {
                     "foreground": "#c70060",
                     "fontStyle": ""
                 }
             },
         ]
     }

    it shows as: Orange(preprocess) and red (macro)
    image

  • but enable c/c++ extension; it shows as: all orange( why all is preprocess?)
    image

  • then enable semanticTokenColorCustomizations

      "editor.semanticTokenColorCustomizations": {
          "enabled": true,
          "rules": {
              "macro": {
                  "foreground": "#0d5f14",
                  "bold": false,
                  "italic": false,
                  "fontStyle": "",
                  "underline": false
              },
              "preprocessor": {
                  "foreground": "#ec3011",
                  "bold": false,
                  "italic": false,
                  "fontStyle": "",
                  "underline": false
              },
          }
      }

all green(macro)*why all is preprocess?):
image

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions