[VS Code] [vscode-cpptools plugin] Intellisense - Dim Inactive Regions: Where does vscode-cpptools get the values for variables used in "#IF" e.g. "GTK_CHECK_VERSION"?

Christian Ohrfandl christian.ohrfandl at gmail.com
Sat Dec 11 14:40:58 UTC 2021


Hi there,

tl;dr see the discussion I created here 
https://github.com/microsoft/vscode-cpptools/discussions/8523. However, 
I wanted to discuss that topic here aswell, because it may not be a 
generic problem of the plugin, but maybe be dependent only on the LO 
project. Additionally, users buovjaga and mikekaganski on 
#libreoffice-dev pointed out that sending to the mailing list would be a 
good idea.

I have the problem that vscode-cpptools "dim inactive regions" option 
dims the region in the statement
`#if GTK_CHECK_VERSION(4,0,0)`
and additionally Intellisense also does not work in that region.

When changing the statement to
`#if GTK_CHECK_VERSION(3,0,0)`
the respective region is not dimmed anymore and also IntelliSense works 
again.

However when running the application, the following code
`cout << gtk_get_major_version() << "." << gtk_get_minor_version() << 
"." << gtk_get_micro_version() << endl;`
returns `4.5.0`
Therefore, I know for a fact that at compile time level my application 
uses GTK 4.5.0.

So where does the vscode-cpptools know the GTK version from and 
therefore is able to judge `GTK_CHECK_VERSION(4,0,0)`?

I also looked into my project's `.vscode` folder into the 
`c_cpp_properties.json` file and added the GTK4 library install dir 
`"/usr/local/include/gtk-4.0"` as follows:
```
{
     "configurations": [
         {
             "name": "Linux",
             "includePath": [
                 "${default}",
                 "/usr/local/include/gtk-4.0",
                 "/usr/include/gtk-3.0",
                 "/usr/include/glib-2.0",
                 "/usr/lib/x86_64-linux-gnu/glib-2.0/include",
                 "/usr/include/pango-1.0"
             ],
             "defines": [],
             "cStandard": "c17",
             "intelliSenseMode": "linux-clang-x64"
         }
     ],
     "version": 4
}
```
But this did not have the desired effect; still the respective code 
block is dimmed and Intellisense does not work.

"So why not turn off the feature "Dim inactive regions"?", I thought. 
Well, this makes the code undimmed (yay) BUT IntelliSense STILL does not 
work (nay), which is a major problem for me.

Can you help me out or is it a bug that IntelliSense does not work EVEN 
if the "dim inactive regions" option is disabled?


Kind regards,

Christian



More information about the LibreOffice mailing list