1

I have three machines running VSCode on Windows 10 set up for C++ with msys2 / mingw64 /gcc.

Via Github they share each other's code. On one Machine i have a problem with intellisense that is annoying:

When I want to retrieve intellisense information, e.g. from an instance of a String object by pressing "." after the instance name, I do get the list of member functions and attributes, but the type information window to the left of it is sparse.

This is how it looks like on other computers (same os, same VSCode version, same gcc compiler, as far as i can tell) enter image description here

This is how it looks on this certain machine. enter image description here

It is exactly the same file. I don't get the meaningful additional information that otherwise appears in the intellisense popup.

Note that the bottom line of file normally says basic_string.h, but on the problem computer it says xstring. In other cases also something else with "X", e.g. xiobase.

I've been suggested that these files could belong to Microsoft C++ header files, but I use gcc here.

gcc --version on these machines gives me

gcc (Rev7, Built by MSYS2 project) 12.2.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

In fact, the Microsoft C compiler is installed on the aforementioned faulty Rachner (but also on the third computer, which I don't have access to at the moment, but which also provides "correct" intellisense).

Here is another interesting fact that may be important: In the VSCode output Console i'm getting a message as C/C++ Configuration Warnings saying

[11.1.2023, 23:40:57] Unable to resolve configuration with compilerPath "c:\Users\Username\.vscode\extensions\bartmanabyss.amiga-debug-1.6.7\bin\win32\opt\bin\m68k-amiga-elf-gcc".  Using "cl.exe" instead.

With cl.exe being the Microsoft compiler. I don't have the slightest idea where this comes from, the bartmanabyss.amiga-debug-1.6.7 directory doesn't even exist in the extensions directory.

Microsoft C/C++ IntelliSense, debugging, and code browsing extension is version v1.13.9 on all machines.

Looks like i have lost some information here. I think there should be some configuration setting, but so far i didn't manage to find a reason for this.

maddes8cht
  • 569
  • 3
  • 16
  • Please show the exact details about those gcc installations (using `gcc -v`). Those documentation details in the suggestions panel are generated from the documentation in the libstdc++ header code that comes with it. It could be that one installation's libstdc++ header code has those doc comments and the other does not. (see also: [Visual Studio Code Intellisense doesn't show function documentation for C++](https://stackoverflow.com/a/73366580/11107541)) – starball Jan 11 '23 at 20:10
  • The file the `begin` function is being found in is different between the screenshots. One is from `basic_string.h`, and one is from [`xstring`](https://stackoverflow.com/a/2418908/11107541). Are you sure that all machines are looking at the exact same copy of the file (from the same git commit with no unstaged changes)? – starball Jan 11 '23 at 20:31
  • Do you have any differences in the settings for the vscode-cpptools extension on the different machines? Do they have any differences in their user settings for settings with names starting with "`C_Cpp`"? – starball Jan 11 '23 at 20:32
  • I'm experiencing a bunch of other problems on this machine, including that some .cpp files do compile but don't give output in regular command window, while they do in msys bash console , and do compile on the other pcs as expected. I don't think these problems fit in this question, so is it okay to ask a new question on these? (I'm starting to formulate it...) – maddes8cht Jan 12 '23 at 16:41
  • i could resolve the other problems (it was a path priority problem), but this here still remains. – maddes8cht Jan 13 '23 at 10:43

1 Answers1

0

The problem has been solved by two things:

On the one hand, it was actually helpful to move the msys entries in the PATH to the front.

On the other hand, it was important to become familiar with c_cpp_properties.json. I was not aware that I should create such a file, in the VS code documentation this is very hidden.

In order not to have to create such a file completely by hand, select the UI version in the Command Pallette (ctrl shift p or F1) C/C++: Edit Configurations. enter image description here

In the meantime I have different configurations for the Mingw / UCRT / Clang compiler, which can be selected comfortably over the status line. enter image description here

maddes8cht
  • 569
  • 3
  • 16