Closed davidalejandroaguilar closed 4 months ago
These macros don't exist in VSCode so not much we can do here. Does wrapping as follows work
#if canImport(PreviewMacros)
#Preview {
ContentView()
}
#endif
Closing this since it isn't an issue with vscode-swift specifically.
@davidalejandroaguilar Could you attach a zipped bundle of the output from the Swift: Capture VS Code Swift Diagnostic Bundle
command? That might help diagnose why this macro can't be found.
Thanks for taking a look at this @plemarquand, appreciate your time.
I tried to get a full diagnostic but got this error Error: Unknown option '--bundle-output-path'
:
Unable to capture diagnostic logs: Error: Command failed: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/sourcekit-lsp diagnose --bundle-output-path /var/folders/l2/q76ntgmn4wb0nvrpc97yl1xr0000gn/T/vscode-diagnostics-2024-07-10T00-00-24+03-00/sourcekit-lsp --toolchain /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr Error: Unknown option '--bundle-output-path' Usage: source-kit-lsp diagnose [--os-log-history <os-log-history>] [--toolchain <toolchain>] [--components <components> ...] See 'source-kit-lsp diagnose --help' for more information.
The minimal diagnostics files are very small:
Also, wrapping it in #if canImport(PreviewMacros)
works to ignore this issue's error!
Ahh damn, but wrapping it in #if canImport(PreviewMacros)
breaks the preview in XCode... sad.
Feel free to dismiss if this only happens in beta, but would be great if someone has encountered this already (no open issues about this).
Also, if it can't be fixed, wondering if there's a way to tell the extension to ignore it.
On:
With this code:
Getting error:
VSCode settings: