-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
I just want to know if somebody's vscode for c++ can auto-completion. #4859
Comments
Is your C_Cpp.intelliSenseEngine set to "Default"? Are there any squiggles in the file? Does the configuration info appear correct when you run C/C++: Log Diagnostics? |
C_Cpp.intelliSenseEngine set to "Default" is useless. my project can make && run successful. |
Can you share the log from C/C++: Log Diagnostics or the C/C++ log when you set C_Cpp.loggingLevel to "Debug"? Our extension doesn't automatically process makefiles to extract the correct includes and defines. |
my settings.json
where to find Log Diagnostics |
vscode info:version: 1.41.1 (user setup) I use vscode-ssh for remote develop. remote os is |
C/C++: Log Diagnostics is a command issued from the View->Command Palette. You should have the file that isn't auto-completing correct active when you run the command. |
C/C++: Log Diagnostics
|
Your set /usr/lib64/ccache/clang with C++14 is failing to be queried for includes/defines and is falling back to /usr/bin/clang++ with C++11, which is a very old 3.4 version, which may be causing some issues. The screenshot also shows a squiggle -- looks like a header file can't be found. However, those configuration issues shouldn't normally affect the autocomplete unless there's some unusual parser failure. What happens when you hover over the fin_lin_count variable? |
Looks like our parser is hitting some bad state around the fin_line_count definition, possibly due to the usage of the old clang version (3.4) or the intel compiler extensions. Are you able to provide an isolated repro or code sample, preferably using -E to generate a preprocessed file? Unfortunately, I don't believe we'll be able to fix this without a repro (and we haven't heard from other users hitting a similar issue). |
Also, if you change the C_Cpp.errorSquiggles setting to "Enabled" instead of "EnabledIfIncludesResolve" you could potentially see the errors our parser is hitting which could explain why parsing is failing around that definition. In particular, the missing definitions in data_reader.hpp or it's missing dependency could be leading to the incorrect parsing. |
@stanpcf The headers are missing like data_reader.hpp -- is that available or can you compile with -E to get a preprocessed file? |
that is avaiable to use
|
Can you run the "C++: Log Diagnostics" command? This should tell you what the include path was determined to be. If "omp.h" is not in one of those folders, then that would explain why there is a squiggle. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@flysumo I'm going to create a new issue for your problem. This will help us organize the responses better. @stanpcf, If you can share the "Log Diagnostics" output with us, we can continue to try to help. Otherwise we are unable to proceed and will close the issue. |
-------- Diagnostics - 2020-3-2 15:32:17 |
As I mentioned previously, our extension is failing to query Are you able to locate omp.h? It appears to be an openmp library, which could require a path that is queried from the compiler. However, you might need to add flags to the compilerArgs setting to get gcc to add path to openmp. |
thx for reply, below is log. I can't find omp.h(new to openmp), but code run(cmake && make && run) success with omp.h
|
I see omp.h under Also, your output from directly querying clang doesn't match the Log Diagnostics results. Can you enable logging and look for error messages related to querying the compiler also the configuration provider info that we receive from CMake Tools. |
no omp.h under
|
It looks like g++ is failing to be queried. What does it output when you run This logging is not normal:
|
run
|
Yeah, the failure is caused by the Chinese characters output by gcc: #4542 . Are you able to get gcc to output English text somehow? |
|
Did you change it so that gcc output English when it's invoked from our extension process? i.e. in your C/C++ logs, do you see the new g++ being used instead of clang from before? |
1. log diagnostics results shows
2.run
|
Hey @sean-mcmanus, this issue might need further attention. @stanpcf, you can help us out by closing this issue if the problem no longer exists, or adding more information. |
Type: LanguageService
Describe the bug
what's the fxxk the auto-completion. I use vscode years, never can use auto-completion for cpp
To Reproduce
Expected behavior
Screenshots
Additional context
The text was updated successfully, but these errors were encountered: