Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect preprocessor macro highlighting (with Chinese comment) #12928

Closed
Gornerrrrr opened this issue Nov 5, 2024 · 2 comments
Closed

Incorrect preprocessor macro highlighting (with Chinese comment) #12928

Gornerrrrr opened this issue Nov 5, 2024 · 2 comments

Comments

@Gornerrrrr
Copy link

Environment

  • OS and Version: Windows11 23H2
  • VS Code Version: v1.95.1
  • C/C++ Extension Version: v1.22.10

Bug Summary and Steps to Reproduce

Bug Summary:
Preprocessor macro directives are not highlighted correctly.
Image

Steps to reproduce:
Change the test file extension to '.h' and open it with VSCode.
test_IntelliSense.txt

Expected behavior:
Highlight the areas where the condition is true, and darken the areas where the condition is false.
Image

Configuration and Logs

//
// !!! WARNING !!! AUTO-GENERATED FILE!
// PLEASE DO NOT MODIFY IT AND USE "platformio.ini":
// https://docs.platformio.org/page/projectconf/section_env_build.html#build-flags
//
{
"configurations": [
{
"name": "PlatformIO",
"includePath": [
"P:/Printer/HIM_SLA/Marlin",
"S:/Work/platformIO/packages/[email protected]/libraries/Wire/src",
"S:/Work/platformIO/packages/[email protected]/libraries/SoftwareSerial/src",
"S:/Work/platformIO/packages/[email protected]/libraries/Servo/src",
"S:/Work/platformIO/packages/[email protected]/libraries/SPI/src",
"S:/Work/platformIO/packages/[email protected]/libraries/IWatchdog/src",
"P:/Printer/HIM_SLA/Marlin/model_cfg",
"P:/Printer/HIM_SLA/Marlin/src/module/lcd",
"S:/Work/platformIO/packages/[email protected]/cores/arduino/avr",
"S:/Work/platformIO/packages/[email protected]/cores/arduino/stm32",
"S:/Work/platformIO/packages/[email protected]/cores/arduino/stm32/LL",
"S:/Work/platformIO/packages/[email protected]/cores/arduino/stm32/usb",
"S:/Work/platformIO/packages/[email protected]/cores/arduino/stm32/OpenAMP",
"S:/Work/platformIO/packages/[email protected]/cores/arduino/stm32/usb/hid",
"S:/Work/platformIO/packages/[email protected]/cores/arduino/stm32/usb/cdc",
"S:/Work/platformIO/packages/[email protected]/system/Drivers/STM32F4xx_HAL_Driver/Inc",
"S:/Work/platformIO/packages/[email protected]/system/Drivers/STM32F4xx_HAL_Driver/Src",
"S:/Work/platformIO/packages/[email protected]/system/STM32F4xx",
"S:/Work/platformIO/packages/[email protected]/system/Middlewares/ST/STM32_USB_Device_Library/Core/Inc",
"S:/Work/platformIO/packages/[email protected]/system/Middlewares/ST/STM32_USB_Device_Library/Core/Src",
"S:/Work/platformIO/packages/[email protected]/system/Middlewares/OpenAMP",
"S:/Work/platformIO/packages/[email protected]/system/Middlewares/OpenAMP/open-amp/lib/include",
"S:/Work/platformIO/packages/[email protected]/system/Middlewares/OpenAMP/libmetal/lib/include",
"S:/Work/platformIO/packages/[email protected]/system/Middlewares/OpenAMP/virtual_driver",
"S:/Work/platformIO/packages/[email protected]/CMSIS/Core/Include",
"S:/Work/platformIO/packages/[email protected]/system/Drivers/CMSIS/Device/ST/STM32F4xx/Include",
"S:/Work/platformIO/packages/[email protected]/system/Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/gcc",
"S:/Work/platformIO/packages/[email protected]/CMSIS/DSP/Include",
"S:/Work/platformIO/packages/[email protected]/cores/arduino",
"S:/Work/platformIO/packages/[email protected]/variants/HIM_16INCH_F407",
"S:/Work/platformIO/packages/[email protected]/libraries/CMSIS_DSP/src",
"S:/Work/platformIO/packages/[email protected]/libraries/EEPROM/src",
"S:/Work/platformIO/packages/[email protected]/libraries/Keyboard/src",
"S:/Work/platformIO/packages/[email protected]/libraries/Mouse/src",
"S:/Work/platformIO/packages/[email protected]/libraries/SrcWrapper/src",
""
],
"browse": {
"limitSymbolsToIncludedHeaders": true,
"path": [
"P:/Printer/HIM_SLA/Marlin",
"S:/Work/platformIO/packages/[email protected]/libraries/Wire/src",
"S:/Work/platformIO/packages/[email protected]/libraries/SoftwareSerial/src",
"S:/Work/platformIO/packages/[email protected]/libraries/Servo/src",
"S:/Work/platformIO/packages/[email protected]/libraries/SPI/src",
"S:/Work/platformIO/packages/[email protected]/libraries/IWatchdog/src",
"P:/Printer/HIM_SLA/Marlin/model_cfg",
"P:/Printer/HIM_SLA/Marlin/src/module/lcd",
"S:/Work/platformIO/packages/[email protected]/cores/arduino/avr",
"S:/Work/platformIO/packages/[email protected]/cores/arduino/stm32",
"S:/Work/platformIO/packages/[email protected]/cores/arduino/stm32/LL",
"S:/Work/platformIO/packages/[email protected]/cores/arduino/stm32/usb",
"S:/Work/platformIO/packages/[email protected]/cores/arduino/stm32/OpenAMP",
"S:/Work/platformIO/packages/[email protected]/cores/arduino/stm32/usb/hid",
"S:/Work/platformIO/packages/[email protected]/cores/arduino/stm32/usb/cdc",
"S:/Work/platformIO/packages/[email protected]/system/Drivers/STM32F4xx_HAL_Driver/Inc",
"S:/Work/platformIO/packages/[email protected]/system/Drivers/STM32F4xx_HAL_Driver/Src",
"S:/Work/platformIO/packages/[email protected]/system/STM32F4xx",
"S:/Work/platformIO/packages/[email protected]/system/Middlewares/ST/STM32_USB_Device_Library/Core/Inc",
"S:/Work/platformIO/packages/[email protected]/system/Middlewares/ST/STM32_USB_Device_Library/Core/Src",
"S:/Work/platformIO/packages/[email protected]/system/Middlewares/OpenAMP",
"S:/Work/platformIO/packages/[email protected]/system/Middlewares/OpenAMP/open-amp/lib/include",
"S:/Work/platformIO/packages/[email protected]/system/Middlewares/OpenAMP/libmetal/lib/include",
"S:/Work/platformIO/packages/[email protected]/system/Middlewares/OpenAMP/virtual_driver",
"S:/Work/platformIO/packages/[email protected]/CMSIS/Core/Include",
"S:/Work/platformIO/packages/[email protected]/system/Drivers/CMSIS/Device/ST/STM32F4xx/Include",
"S:/Work/platformIO/packages/[email protected]/system/Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/gcc",
"S:/Work/platformIO/packages/[email protected]/CMSIS/DSP/Include",
"S:/Work/platformIO/packages/[email protected]/cores/arduino",
"S:/Work/platformIO/packages/[email protected]/variants/HIM_16INCH_F407",
"S:/Work/platformIO/packages/[email protected]/libraries/CMSIS_DSP/src",
"S:/Work/platformIO/packages/[email protected]/libraries/EEPROM/src",
"S:/Work/platformIO/packages/[email protected]/libraries/Keyboard/src",
"S:/Work/platformIO/packages/[email protected]/libraries/Mouse/src",
"S:/Work/platformIO/packages/[email protected]/libraries/SrcWrapper/src",
""
]
},
"defines": [
"PLATFORMIO=60116",
"STM32F407xx",
"MARLIN_FIRMWARE",
"NDEBUG",
"HAL_STM32",
"USBCON",
"USBD_USE_CDC",
"TIM_IRQ_PRIO=13",
"ADC_RESOLUTION=12",
"VECT_TAB_OFFSET=0x10000",
"ARDUINO_BLACK_F407VE",
"PIO_FRAMEWORK_ARDUINO_NANOLIB_FLOAT_PRINTF",
"PIO_FRAMEWORK_ARDUINO_ENABLE_CDC",
"USBCON",
"USBD_USE_CDC",
"HAVE_HWSERIAL1",
"HAVE_HWSERIAL2",
"HAVE_HWSERIAL3",
"HAVE_HWSERIAL6",
"SERIAL_RX_BUFFER_SIZE=512",
"SERIAL_TX_BUFFER_SIZE=512",
"STM32F4xx",
"ARDUINO=10808",
"ARDUINO_ARCH_STM32",
"ARDUINO_HIM_16INCH_F407",
"BOARD_NAME="HIM_16INCH_F407"",
"HAL_UART_MODULE_ENABLED",
"USBD_USE_CDC",
"HAL_PCD_MODULE_ENABLED",
""
],
"cStandard": "gnu11",
"cppStandard": "gnu++14",
"compilerPath": "S:/Work/platformIO/packages/[email protected]/bin/arm-none-eabi-gcc.exe",
"compilerArgs": [
"-mfpu=fpv4-sp-d16",
"-mfloat-abi=hard",
"-mcpu=cortex-m4",
"-mthumb",
""
]
}
],
"version": 4
}

Other Extensions

No response

Additional context

I have been using the Marlin project to control my 3D printer. This project uses a large number of preprocessor directives, and I often encounter some jumping or display issues. Have any good suggestions?

@Gornerrrrr
Copy link
Author

This issue has already been fixed in the pre-release version.

@sean-mcmanus
Copy link
Contributor

@Gornerrrrr Yes, it was fixed from #12879 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants