Sample project to reproduce Xcode 13 indexing problems

Overview

Xcode 13 indexing regression for Swift static libraries

Summary:

Currently if you have a project that links a pre-compiled Swift static library (with or without .xcframework), when you try and jump to definition, Xcode fails and shows the question mark pop-up. Syntax highlighting also doesn't work for symbols from the pre-compiled library.

It's a regression from Xcode 13 because everything works as expected in Xcode 12.5.

Steps to Reproduce:

  1. Pre-compile a Swift static library in a project
  2. Create a new project, copy the pre-compiled library into the root of the new project
  3. Add the library path to SWIFT_INCLUDE_PATHS and LIBRARY_SEARCH_PATHS
  4. Reference a symbol from the library
  5. Build (this should be successful)
  6. Jump to definition on either the import declaration or the symbol. Also check syntax highlighting

Expected Results:

You see the generated interface of the Swift module and syntax highlighting

Actual Results:

Xcode shows the question mark modal and syntax highlighting doesn't work

Version:

Xcode 13.0 (13A233) Xcode 13.1 RC (13A1030d)

Tested with macOS Big Sur 11.6 and Intel MacBook Pro.

Sample projects:

There are 3 sample projects in this repository:

  • One to build the Swift static library (named StaticAnimals);

  • One iOS app integrating the static library as .xcframework;

  • One iOS app integrating the static library .a directly, without .xcframework.

  • Run make setup to build de Swift static library (StaticAnimals) for iOS Simulator.

  • Open XCFrameworkRegressionProject/XCFrameworkRegression.xcodeproj with Xcode 13

  • Go to Here.swift

  • Build for simulator (should be succesful)

  • Check syntax highlighting and jump to definition

  • Open SwiftStaticRegressionProject/SwiftStaticRegression.xcodeproj with Xcode 13

  • Go to Here.swift

  • Build for simulator (should be succesful)

  • Check syntax highlighting and jump to definition

  • Note: for this project, only .swiftmodule and .swiftdoc was provided, because AFAIK .swiftinterface and .swiftsourceinfo are optional

Both projects can also be tested with Xcode 12.5 for comparison.

You might also like...
All the reusable code that we need in each project

SwiftyUtils SwiftyUtils groups all the reusable code that we need to ship in each project. This framework contains: Extensions Protocols Structs Subcl

Open Source project for watching YouTube channel playlists.
Open Source project for watching YouTube channel playlists.

YouTube Channel Watcher An open source project build using SwiftUI and Combine that lets you monitor a variety of different YouTube channels and their

A handy collection of Swift method and Tools to build project faster and more efficient.

SwifterKnife is a collection of Swift extension method and some tools that often use in develop project, with them you might build project faster and

Globant iOS Academy Base Project
Globant iOS Academy Base Project

The repository will be used for trainees to save course progress.

This library project contains a few noise generators created in Swift.

SwiftNoiseGenerator This library project contains a few noise generators created in Swift. contains: Perlin Noise Simplex Noise How to use Edit your P

Generates Heroku-style random project names in Swift

RandomProjectName.swift Generates Heroku-style random project names in Swift. Usage Just call String.randomProjectName(), and specify the optional suf

Another Virtualization.framework demo project, with focus to iBoot (WIP)
Another Virtualization.framework demo project, with focus to iBoot (WIP)

Virtual iBoot Fun This is just another Virtualization.framework sample project (WIP), but with focus on iBoot (iOS/macOS/tvOS/etc. bootloader) For a m

All the reusable code that we need in each project

SwiftyUtils SwiftyUtils groups all the reusable code that we need to ship in each project. This framework contains: Extensions Protocols Structs Subcl

Project shows how to unit test asynchronous API calls in Swift using Mocking without using any 3rd party software

UnitTestingNetworkCalls-Swift Project shows how to unit test asynchronous API ca

Comments
  • Thanks for providing this

    Thanks for providing this

    Hey @andre-alves Thanks for providing this! I've also found this issue and it drives me crazy Cool that you also found it and created this sample project. Do you know, is there anything that we could do so Apple would know and fix the issue?

    opened by vysotsky 14
Owner
André Alves
André Alves
Steps and files needed to reproduce a CSP bug in Safari Web Extensions

CSP Safari bug repro There appears to be a discrepancy between how Safari handles CSP policies for extension pages compared to how other browsers do s

Brian Birtles 0 Nov 6, 2021
The sample implementation of zip-archived document for a macOS AppKit platform.

The sample implementation of zip-archived document for a macOS AppKit platform. You can implement NSDocument-based I/O of archived document in your application like .sketch or .key.

usagimaru 4 Nov 12, 2022
This is a command line tool to extract an app icon. this sample will extract the icon 16x16 from Safari app.

?? X-BundleIcon This is a command line tool to extract an app icon. this sample will extract the icon 16x16 from Safari app. xbi com.apple.Safari 16 /

Rui Aureliano 3 Sep 1, 2022
Replace your Xcode icon with colorful variants

XcoatOfPaint Have you ever wished the Xcode icon could get a fresh coat of paint to match the colorful Mac you just bought? Or you want to distinguish

Christian Lobach 163 Dec 20, 2022
XCMetrics is the easiest way to collect Xcode build metrics and improve developer productivity.

XCMetrics is the easiest way to collect Xcode builds metrics and improve your developer productivity. Overview ?? Keep your build times under control

Spotify 989 Jan 2, 2023
MyUtils For Xcode

MyUtils For Xcode App Store Download ##You can 1: \#FFFFFF -> [UIColor colorWithRed:1.00 green:1.00 blue:1.00 alpha:1.00] Use:Select "#FFFFFF" Then Xc

wintelsui 0 Nov 5, 2021
An extension for Xcode to generate builders from structs

Swift Struct Builder Generator Xcode Source Editor Extension An Xcode extension (plugin) to generate struct builders automatically. Install Swift Stru

Marius Wichtner 1 Nov 24, 2021
Working alternative to Xcode previews.

SwiftUIPlaygrounds! A shell project you can use to iterate over SwiftUI interfaces using the HotReloading project. Instead of a "preview" the interfac

John Holdsworth 9 Dec 21, 2021
Enable autocomplete use resources in swift project.

ResourceKit Enable autocomplete use resources in swift project. まだハードコードで消耗してるの? ResourceKitで安全コーディング! How does ResourceKit work? ResouceKit makes you

bannzai 90 Nov 25, 2022
Functional data types and functions for any project

Swiftx Swiftx is a Swift library containing functional abstractions and extensions to the Swift Standard Library. Swiftx is a smaller and simpler way

TypeLift 219 Aug 30, 2022