Xcode autocompletion doesn't show functions from Objective C headers Jump to Definition doesn't work either

I've just fixed very strange bug / error/ undocumented feature on my Xcode conf.

When I was running the latest Xcode 13.4.1 and highlight / autocompletion stopped working as I believe since macOS Monterey upgrade (before I ran Xcode 12) since I "fixed" some conf values by running defaults write com.apple.dt.Xcode some keys.

Now I fixed It by deleting that edited config and re-running Xcode again and now it shows me autocompletion suggestions and follows headers when I press @@

defaults delete com.apple.dt.Xcode

I just prepared this post with the ending: What should I do to make it possible to work? Appreciate for any help (Show live issues is turned on). Since I solved it I leave these words to let anyone who needs it to fix the issue with this mini tutorial.

It somehow doesn't affect Swift code.

Here's the stripped version of my old broken conf produced by defaults read com.apple.dt.Xcode:

{
    BuildSystemScheduleInherentlyParallelCommandsExclusively = 1;
    CurrentAlertPreferencesSelection = "Xcode.AlertEvent.BuildStart";
    "DTDKCrashLogSortDescriptors4.5" =     (
                {
            NSAscending = 0;
            NSKey = processName;
            NSSelector = "compare:";
        },
                {
            NSAscending = 1;
            NSKey = type;
            NSSelector = "compare:";
        },
                {
            NSAscending = 0;
            NSKey = dateTime;
            NSSelector = "compare:";
        }
    );
    DVTTextAutoSuggestCompletions = 1;
    DVTTextCompletionRecentCompletions =     (
        NSString
        );
    DVTTextIndentCase = 0;
    DVTTextIndentTabWidth = 2;
    DVTTextIndentWidth = 2;
    DVTTextShowMinimap = 0;
    DVTTextSoloBraceIndentWidth = 2;
    DVTTextWrappedLinesIndentWidth = 2;
    IBAppliesAutoResizingRulesWhileResizing = 0;
    IBDesktopImageCacheVersionKey = "12.4-13F17a";
    IBGlobalLastEditorDocumentClassName = IBStoryboardDocument;
    IBGlobalLastEditorTargetRuntime = "IBCocoaTouchFramework-fifteenAndLater";
    IBPreferencesMigrated = 1;
    IBShowingMinimapStoryboard = 0;
    IBViewSizeInspectorPreferredRectTypeName = frame;
    IDEActivityLogShowsAllBuildSteps = 1;
    IDEActivityLogShowsAnalyzerResults = 1;
    IDEActivityLogShowsErrors = 1;
    IDEActivityLogShowsWarnings = 1;
    "IDEAnalyticsMetricsNotifications.AnalyticsMetricsNotificationsController.lastRefreshAttemptDate" = "2022-06-08 04:27:07 +0000";
    IDEAppearance = 0;
    IDEBuildLocationStyle = Unique;
    IDECopyFilesToTargetGroup = 0;
    IDECreateGroupsForFolders = 0;
    IDEDebugSessionShowDisassemblyWhenDebugging = 0;
    IDEDisableGitSupportForNewProjects = 1;
    IDEDisableStateRestoration = 1;
    IDEDocSearchSelectedReferenceIdentifier = occ;
    IDEExtensionsBuiltPriorToXcode12 =     (
    );
    IDEFileExtensionDisplayMode = 1;
    "IDEFileTemplateChooserAssistantSelectedTemplateName_iOS" = "Source/Header File";
    "IDEFileTemplateChooserAssistantSelectedTemplateName_macOS" = "Source/Header File";
    IDEFileTemplateChooserAssistantSelectedTemplateSection = "com.apple.platform.macosx";
    IDEHasConvertedXcode3BuildPrefs = 1;
    IDEIndexDisable = 1;
    IDEIndexShowLog = 0;
    IDEKeyBindingCurrentPreferenceSet = "Default.idekeybindings";
    IDEKeyBindingExcludedPreferenceSet =     (
        Default
    );
    IDELastBreakpointActionClassName = IDESoundBreakpointAction;
    IDELogNavigatorGroupByKey = 0;
    IDEMaxParallelTestingWorkersMac = 0;
    IDEOpenQuicklyPreferSwiftGeneratedInterface = 0;
    "IDEOpenQuicklyWindowController.width" = 454;
    IDEProductsViewControllerSourceListSplitPosition = 215;
    IDEProfileActionSelectedTab = Info;
    IDEProvisioningTeamManagerLastSelectedTeamID = XXXXXXXXXX;
    IDEProvisioningTeams =     {
        "my@email.com" =         (
                        {
                isFreeProvisioningTeam = 1;
                teamID = XXXXXXXXXX;
                teamName = "Larry Moore (Personal Team)";
                teamType = "Personal Team";
            }
        );
    };
    IDEShowPrebuildLogs = 0;
    IDESoundBreakpointActionDefaultNameKey = Pop;
    IDESourceControlPreferencesVersion = 201;
    IDESuppressStandardArchitecturesUpgrade = 0;
    IDESuppressStopExecutionWarning = 1;
    IDESuppressStopExecutionWarningTarget = "IDESuppressStopExecutionWarningTargetValue_Stop";
    IDESwiftPackageAdditionAssistantRecentlyUsedPackages =     (
    );
    IDESwiftPackageCollectionsAddedDefaultCollectionsDVTToolsVersion = "Xcode 13.3.1";
    IDETestActionSelectedTab = Info;
    IDETouchBarSimulatorIsVisible = 0;
    IDEUserWantsToEnableDeveloperSystemPolicyMode = 0;
    LastProcessNameAttachedTo = Riot;
    NSColorPanelMode = 1;
    NSColorPickerPreferredRGBEntryMode = 2;
    NSColorPickerSlidersDefaults = 1;
    NSNavPanelExpandedStateForSaveMode = 1;
    PBXNumberOfParallelBuildSubtasks = 10;
    PMPrintingExpandedStateForPrint2 = 0;
    PegasusMultipleCursorsEnabled = 1;
    ShowBuildOperationDuration = 1;
    Xcode3BuildSettingsEditorDisplayMode = 0;
    Xcode3BuildSettingsEditorMode = 0;
    Xcode3ProjectEditorSourceListVisible = 1;
    "Xcode3ProjectTemplateChooserAssistantSelectedTemplateName_iOS" = "Application/App";
    "Xcode3ProjectTemplateChooserAssistantSelectedTemplateName_macOS" = "Application/App";
    Xcode3ProjectTemplateChooserAssistantSelectedTemplateSection = "com.apple.platform.iphoneos";
    "Xcode3TargetTemplateChooserAssistantSelectedTemplateName_iOS" = "Application/App";
    "Xcode3TargetTemplateChooserAssistantSelectedTemplateName_macOS" = "Application/Command Line Tool";
    Xcode3TargetTemplateChooserAssistantSelectedTemplateSection = "com.apple.platform.macosx";
}

The only suspicious key is DVTTextAutoSuggestCompletions = 1; in this old config that might have stopped autocompletion.

Now XCBBuildService quit unexpectedly. keeps stopping:

System Integrity Protection: enabled

Crashed Thread:        5  Dispatch queue: XCBBuildSystem.BuildManager.buildQueue

Exception Type:        EXC_BREAKPOINT (SIGTRAP)
Exception Codes:       0x0000000000000001, 0x0000000102c41018
Exception Note:        EXC_CORPSE_NOTIFY

Termination Reason:    Namespace SIGNAL, Code 5 Trace/BPT trap: 5
Terminating Process:   exc handler [36741]

Thread 0::  Dispatch queue: XCBBuildService.ServiceHostConnection.receiveQueue
0   libsystem_kernel.dylib                 0x19ec27634 read + 8
1   XCBServiceCore                         0x102bb7d90 closure #1 in ServiceHostConnection.resume() + 96
2   XCBServiceCore                         0x102bb90f4 thunk for @escaping @callee_guaranteed () -> () + 28
3   libdispatch.dylib                      0x19ea9e5f0 _dispatch_call_block_and_release + 32
4   libdispatch.dylib                      0x19eaa01b4 _dispatch_client_callout + 20
5   libdispatch.dylib                      0x19eaa78a8 _dispatch_lane_serial_drain + 668
6   libdispatch.dylib                      0x19eaa8404 _dispatch_lane_invoke + 392
7   libdispatch.dylib                      0x19eab2c98 _dispatch_workloop_worker_thread + 648
8   libsystem_pthread.dylib                0x19ec60360 _pthread_wqthread + 288
9   libsystem_pthread.dylib                0x19ec5f080 start_wqthread + 8

Thread 5 Crashed::  Dispatch queue: XCBBuildSystem.BuildManager.buildQueue
0   XCBBuildSystem                         0x102c41018 DependencyCycleFormatter.filteredCycleOutput() + 3428
1   XCBBuildSystem                         0x102c40c70 DependencyCycleFormatter.filteredCycleOutput() + 2492
2   XCBBuildSystem                         0x102c3fc2c DependencyCycleFormatter.formattedMessage() + 56
3   XCBBuildSystem                         0x102c53530 OperationSystemAdaptor.cycleDetected(rules:) + 272
4   XCBBuildSystem                         0x102c53dc0 protocol witness for BuildSystemDelegate.cycleDetected(rules:) in conformance OperationSystemAdaptor + 20
5   llbuild                                0x10373e678 0x103724000 + 108152
6   llbuild                                0x10372d0a8 (anonymous namespace)::CAPIBuildSystemFrontendDelegate::cycleDetected(std::__1::vector<llbuild::core::Rule*, std::__1::allocator<llbuild::core::Rule*> > const&) + 52
7   llbuild                                0x1037b1cec (anonymous namespace)::BuildEngineImpl::executeTasks(llbuild::core::KeyType const&) + 8364
8   llbuild                                0x1037ad918 llbuild::core::BuildEngine::build(llbuild::core::KeyType const&) + 568
9   llbuild                                0x1037c486c (anonymous namespace)::BuildSystemImpl::build(llbuild::buildsystem::BuildKey) + 164
10  llbuild                                0x1037c47a8 llbuild::buildsystem::BuildSystem::build(llbuild::buildsystem::BuildKey) + 48
11  llbuild                                0x1037bad68 llbuild::buildsystem::BuildSystemFrontend::buildNode(llvm::StringRef) + 104
12  llbuild                                0x10373ea48 0x103724000 + 109128
13  XCBBuildSystem                         0x102c47c70 BuildOperation.build() + 8080
14  XCBBuildSystem                         0x102c60c9c closure #2 in BuildManager.startBuild(_:) + 60
15  XCBBuildSystem                         0x102c602a0 thunk for @escaping @callee_guaranteed () -> () + 28
16  libdispatch.dylib                      0x19eaaefb4 _dispatch_block_async_invoke2 + 148
17  libdispatch.dylib                      0x19eaa01b4 _dispatch_client_callout + 20
18  libdispatch.dylib                      0x19eaa3670 _dispatch_continuation_pop + 500
19  libdispatch.dylib                      0x19eaa2cdc _dispatch_async_redirect_invoke + 584
20  libdispatch.dylib                      0x19eab18e8 _dispatch_root_queue_drain + 396
21  libdispatch.dylib                      0x19eab2104 _dispatch_worker_thread2 + 164
22  libsystem_pthread.dylib                0x19ec60324 _pthread_wqthread + 228
23  libsystem_pthread.dylib                0x19ec5f080 start_wqthread + 8

Binary Images:
       0x19ec25000 -        0x19ec5cfff libsystem_kernel.dylib (*) <03f48dc5-caa7-3678-af61-1a3c7fa8b06e> /usr/lib/system/libsystem_kernel.dylib
       0x102bb0000 -        0x102bbffff com.apple.dt.XCBServiceCore (13.4.1) <8d9dea8c-f0a1-3a95-8cbe-4672b2e3af7a> /Applications/Xcode.app/Contents/SharedFrameworks/XCBuild.framework/Versions/A/PlugIns/XCBBuildService.bundle/Contents/Frameworks/XCBServiceCore.framework/Versions/A/XCBServiceCore
       0x19ea9c000 -        0x19eae2fff libdispatch.dylib (*) <f9300d47-d3db-3349-8a6d-acb68cd9983b> /usr/lib/system/libdispatch.dylib
       0x19ec5d000 -        0x19ec69fff libsystem_pthread.dylib (*) <42166a2c-89a9-3c38-a215-f028544cea23> /usr/lib/system/libsystem_pthread.dylib
       0x102c3c000 -        0x102c6bfff com.apple.dt.XCBBuildSystem (13.4.1) <a160309b-c87c-396a-8a43-9ab52151ccfb> /Applications/Xcode.app/Contents/SharedFrameworks/XCBuild.framework/Versions/A/PlugIns/XCBBuildService.bundle/Contents/Frameworks/XCBBuildSystem.framework/Versions/A/XCBBuildSystem

And after 1st build Xcode refuses to build with the following error Build service could not create build operation: unknown error while handling message: unknownSession

Xcode autocompletion doesn't show functions from Objective C headers Jump to Definition doesn't work either
 
 
Q