3 ms·
We had a similar experience. This article [1] was an absolute godsend. Autocomplete is working again and it is, as billed, a bit more reliable and snappier. I h
by saltypal 9y ago
We had a similar experience. This article [1] was an absolute godsend. Autocomplete is working again and it is, as billed, a bit more reliable and snappier. I hope this helps you.
That said, it's absolutely ludicrous that fixing autocomplete is this difficult and involved. I would much rather see the Xcode team put their efforts towards building a great command-line toolchain and compiler daemon, and let the community plug it into various editors.
[1]: https://miqu.me/blog/2017/06/16/fixing-autocompletion-on-mixed-objective-c-and-swift-projects/ https://miqu.me/blog/2017/06/16/fixing-autocompletion-on-mix...
- xenadu02 9y agoThe ShowDVTDebugMenu setting no longer works for public releases. Run "defaults write com.apple.dt.Xcode IDESourceKitServiceLogLevel 3" then clean your project and allow it to re-index. The log will be written to /tmp. Locate the failing invocations in the log. Copy and paste them to terminal and run manually (in some cases you may need to substitute libclang for clang, etc). You should see the full error output. The majority of autocomplete/indexer failures are actually sloppy includes, bad module maps, and other errors where the build system or compiler is more forgiving of the bad input. In some cases switching to the new build system will expose the errors. * Make sure your includes are correct (frameworks should be using angle brackets and include the framework name). * Make sure you don't have non-modular headers in modules (CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO). * Make sure you aren't relying on implicit imports, eg: If a header references CGSize make sure you're importing <Foundation/Foundation.h>. If using uint8_t, import <stdint.h>. Sometimes you can get away with being sloppy here and build but it still breaks the indexer. * Make sure you have clean well-defined module maps. Use explicit @import syntax in Objective-C - you might find that your module map was broken (Swift requires modular frameworks)