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

Intellisense Not Autocompleting C Code On M1 Mac #11315

Closed
Ghostkwebb opened this issue Aug 12, 2023 · 15 comments
Closed

Intellisense Not Autocompleting C Code On M1 Mac #11315

Ghostkwebb opened this issue Aug 12, 2023 · 15 comments
Labels
external Feature: Configuration An issue related to configuring the extension or IntelliSense investigate: repro This issue's repro steps needs to be investigated/confirmed Language Service

Comments

@Ghostkwebb
Copy link

Ghostkwebb commented Aug 12, 2023

Environment

  • OS and Version: macOS Sonoma beta 14.0 (23A5301h)
  • VS Code Version: 1.81.1
  • C/C++ Extension Version: v1.16.3
  • If using SSH remote, specify OS of remote machine:

Bug Summary and Steps to Reproduce

Bug Summary:
Intellisense doesn't show up when writing C code.

Screen.Recording.2023-08-12.at.1.57.27.PM.mp4

Configuration and Logs

{
    "configurations": [
        {
            "name": "Mac",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [],
            "macFrameworkPath": [
                "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks"
            ],
            "compilerPath": "/opt/homebrew/bin/gcc",
            "cStandard": "c17",
            "cppStandard": "c++17",
            "intelliSenseMode": "macos-gcc-arm64"
        }
    ],
    "version": 4
}

Other Extensions

image

Additional context

No response

@Manishchauhan7
Copy link

the same thing is happening in the window for C++ it's not auto-completing
for loop, if while, and other kinds of stuff
can anybody help me

@sean-mcmanus sean-mcmanus self-assigned this Aug 14, 2023
@sean-mcmanus sean-mcmanus added Language Service more info needed The issue report is not actionable in its current state not reproing We're not able to reproduce the issue (it's unlikely to get fixed until we find one). Feature: Configuration An issue related to configuring the extension or IntelliSense labels Aug 14, 2023
@sean-mcmanus
Copy link
Contributor

I'm not reproing the issue. What is the result of running /opt/homebrew/bin/gcc --version? Can you run C/C++: Log Diagnostics from the Command Palette and look for an incorrect configuration or provide the results from that?

@Ghostkwebb
Copy link
Author

image

-------- Diagnostics - 15/08/2023, 10:07:03
Version: 1.16.3
Current Configuration:
{
"name": "Mac",
"includePath": [
"/Users/ghostkwebb/Desktop/C++ Prgrams/"
],
"defines": [],
"macFrameworkPath": [
"/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks"
],
"compilerPath": "/usr/bin/clang",
"cStandard": "c17",
"cppStandard": "c++17",
"intelliSenseMode": "macos-clang-arm64",
"compilerPathInCppPropertiesJson": "/usr/bin/clang",
"intelliSenseModeIsExplicit": false,
"cStandardIsExplicit": false,
"cppStandardIsExplicit": false,
"mergeConfigurations": false,
"compilerPathIsExplicit": false,
"browse": {
"path": [
"${workspaceFolder}/
"
],
"limitSymbolsToIncludedHeaders": true
}
}
cpptools version (native): 1.16.3.0
Translation Unit Mappings:
[ /Users/ghostkwebb/Desktop/C++ Prgrams/Learnin1.cpp ]:
/Users/ghostkwebb/Desktop/C++ Prgrams/Learnin1.cpp
[ /Users/ghostkwebb/Desktop/C++ Prgrams/Learnin2.cpp ]:
/Users/ghostkwebb/Desktop/C++ Prgrams/Learnin2.cpp
[ /Users/ghostkwebb/Desktop/C++ Prgrams/Learnin3.cpp ]:
/Users/ghostkwebb/Desktop/C++ Prgrams/Learnin3.cpp
[ /Users/ghostkwebb/Desktop/C++ Prgrams/Learnin4.cpp ]:
/Users/ghostkwebb/Desktop/C++ Prgrams/Learnin4.cpp
Translation Unit Configurations:
[ /Users/ghostkwebb/Desktop/C++ Prgrams/Learnin1.cpp ]: not ready
Process ID: 68495
Memory Usage: 0 MB
Compiler Path: /usr/bin/clang
Includes:
/usr/local/include
/Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/usr/include/c++/v1
/Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include
/Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/usr/include
/Library/Developer/CommandLineTools/usr/include
Frameworks:
/Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/System/Library/Frameworks
Standard Version: c++17
IntelliSense Mode: macos-clang-arm64
Other Flags:
--clang
--clang_version=150000
[ /Users/ghostkwebb/Desktop/C++ Prgrams/Learnin2.cpp ]: not ready
Process ID: 69755
Memory Usage: 0 MB
Compiler Path: /usr/bin/clang
Includes:
/usr/local/include
/Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/usr/include/c++/v1
/Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include
/Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/usr/include
/Library/Developer/CommandLineTools/usr/include
Frameworks:
/Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/System/Library/Frameworks
Standard Version: c++17
IntelliSense Mode: macos-clang-arm64
Other Flags:
--clang
--clang_version=150000
[ /Users/ghostkwebb/Desktop/C++ Prgrams/Learnin3.cpp ]: not ready
Process ID: 71513
Memory Usage: 0 MB
Compiler Path: /usr/bin/clang
Includes:
/usr/local/include
/Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/usr/include/c++/v1
/Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include
/Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/usr/include
/Library/Developer/CommandLineTools/usr/include
Frameworks:
/Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/System/Library/Frameworks
Standard Version: c++17
IntelliSense Mode: macos-clang-arm64
Other Flags:
--clang
--clang_version=150000
[ /Users/ghostkwebb/Desktop/C++ Prgrams/Learnin4.cpp ]: not ready
Process ID: 74316
Memory Usage: 0 MB
Compiler Path: /usr/bin/clang
Includes:
/usr/local/include
/Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/usr/include/c++/v1
/Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include
/Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/usr/include
/Library/Developer/CommandLineTools/usr/include
Frameworks:
/Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/System/Library/Frameworks
Standard Version: c++17
IntelliSense Mode: macos-clang-arm64
Other Flags:
--clang
--clang_version=150000
Total Memory Usage: 0 MB

------- Workspace parsing diagnostics -------
Number of files discovered (not excluded): 9133

@Ghostkwebb
Copy link
Author

This is also happening for C++ as well

@sean-mcmanus
Copy link
Contributor

There appears to be some problem with the cpptools-srv process launching correctly, i.e. the logging "Total Memory Usage: 0 MB". Do you still repro this with 1.17.2 that was released yesterday?

I'll check with the team see if anyone else might have an idea what could be going wrong...

@sean-mcmanus sean-mcmanus added investigate: repro This issue's repro steps needs to be investigated/confirmed and removed more info needed The issue report is not actionable in its current state labels Aug 15, 2023
@sean-mcmanus
Copy link
Contributor

@Ghostkwebb What OS are you on?

Our current hypothesis is that it's an issue related to the OS version: macOS Sonoma beta 14.0, possibly a bug with that OS or the Mac build tools might have a bug in regards to the code generated for that OS. Is anyone able to repro the bug with a non-Beta OS?

@Ghostkwebb
Copy link
Author

@Ghostkwebb What OS are you on?

Our current hypothesis is that it's an issue related to the OS version: macOS Sonoma beta 14.0, possibly a bug with that OS or the Mac build tools might have a bug in regards to the code generated for that OS. Is anyone able to repro the bug with a non-Beta OS?

I'm on macOS Sonoma beta 14.0 (23A5301h)

@sean-mcmanus
Copy link
Contributor

@Ghostkwebb Since the only 2 repros we've seen is with that OS, that re-enforces our belief that it's a bug or incompatibility with that OS. You may want to file a bug on Apple and mention the bug doesn't repro with the non-Beta OS? But we'll still try to look into it ourselves to see if it's possible for us to fix.

@Ghostkwebb
Copy link
Author

@Ghostkwebb Since the only 2 repros we've seen is with that OS, that re-enforces our belief that it's a bug or incompatibility with that OS. You may want to file a bug on Apple and mention the bug doesn't repro with the non-Beta OS? But we'll still try to look into it ourselves to see if it's possible for us to fix.

Thank you very much for the help

@sean-mcmanus sean-mcmanus added external and removed not reproing We're not able to reproduce the issue (it's unlikely to get fixed until we find one). labels Aug 16, 2023
@SimonKagstrom
Copy link

Could it be related to #10789 ? In my case (with Ventura), I could workaround that with setting C_Cpp.intelliSenseCacheSize to 0 as per that bug.

@sean-mcmanus
Copy link
Contributor

Yes, if setting C_Cpp.intelliSenseCacheSize to 0 fixes the issue for anyone, then that should be done. We haven't figured out the cause or repro conditions of this failure with the cache yet. I'm guessing some issue with the memory mapping.

@Ghostkwebb
Copy link
Author

Could it be related to #10789 ? In my case (with Ventura), I could workaround that with setting C_Cpp.intelliSenseCacheSize to 0 as per that bug.

How do I do this?

@SimonKagstrom
Copy link

@Ghostkwebb Run "Preferences: Open User Settings (JSON)" and add

"C_Cpp.intelliSenseCacheSize": 0,

somewhere in that file.

@Ghostkwebb
Copy link
Author

BRO WTF IT ACTUALLY STARTED WORKING!?!?!?! HUHHHHHHHHHHH

@Colengms
Copy link
Contributor

Closing this as a duplicate, as #10789 appears to be the same root cause. It shouldn't technically be necessary to set intelliSenseCacheSize to 0, as arm64 does not support ASLR/PIE, so that feature should be getting correctly disabled internally. The root cause here appears to be that fallback internally failing.

@Colengms Colengms closed this as not planned Won't fix, can't repro, duplicate, stale Aug 25, 2023
@michelleangela michelleangela removed their assignment Aug 25, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Oct 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
external Feature: Configuration An issue related to configuring the extension or IntelliSense investigate: repro This issue's repro steps needs to be investigated/confirmed Language Service
Projects
None yet
Development

No branches or pull requests

6 participants