-
Notifications
You must be signed in to change notification settings - Fork 74
@main and ContentView Problem #1556
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
Comments
I have tried adding .vscode/setting.json and .buildServer.json but all failed. I can basically determine that the code problem should be related to the computer environment. This happens on my m3 air regardless of vscode or trae, but it does not happen on my m2 pro. @main does not prompt an error and ContentView is indexed normally. But I still can't find a solution successfully. |
But in my Xcode everything works fine |
Unfortunately the VS Code extension only supports Package.swift based projects, not .xcodeproj based projects. |
Hmmm……However, I did install the same configuration on other computers with the same xcodeproj based project, but there was no such error. I don't think the type of project is important. I would like to know the really reason and some methods that only change configuration without changing the code for this problem. |
In order to determine symbol information the extension needs to know what and where your dependencies are, and it uses SwiftPM and sourcekit-lsp to determine that, both of which work with Package.swift based projects. If you load a .xcodeproj based project in the VS Code Swift extension it cannot determine what your dependencies are and so you'll get missing symbols like what you're seeing. |
I created a new project with my Xcode and planned to write subsequent code in VScode, but at this time I found that @main and ContentView are always in an error state. How can I solve this problem?
The text was updated successfully, but these errors were encountered: