Home > database >  name space highlighting is not working in visual studio when using modules declaration instead of he
name space highlighting is not working in visual studio when using modules declaration instead of he

Time:01-26

i'm working on C 20 standard but a weird scenario happens when I started using import statement instead of #include suddenly namespace highlighting is not working properly.

working: working highlight

not working: not working highlight

I don't know what is going on here I suspect it highlights according to a different thing now

CodePudding user response:

This should be a bug of Visual Studio. When using import, the intellisense will not work. You could report the problem to Developer Community. Related issues have also been reported.

CodePudding user response:

after some investigation visual studio directed me to this page which explains it all : https://developercommunity.visualstudio.com/t/When-importing-a-C20-module-or-header-/1550846

the intellisense may stop working or show many errors (this includes colorization, code completion)

in my case it stopped in visual studio 2022 and shows errors in visual studio 2019

they suggests this code:

#if __INTELLISENSE__
#include <iostream>
#else
import <iostream>;
#endif
  •  Tags:  
  • Related