xavierd / clang_complete

Vim plugin that use clang for completing C/C++ code.
http://www.vim.org/scripts/script.php?script_id=3302
1.96k stars 308 forks source link

Foundation & Cocoa class can not be completed #536

Open orklann opened 7 years ago

orklann commented 7 years ago

My .clang_complete file is:

-x objective-c
-arch x86_64
-fmessage-length=0
-fdiagnostics-show-note-include-stack
-fmacro-backtrace-limit=0
-std=gnu99
-fobjc-arc
-fmodules
-gmodules
-fmodules-cache-path=/Users/aaron/tmp/Hello/.clang_driveddata/ModuleCache
-fmodules-prune-interval=86400
-fmodules-prune-after=345600
-fbuild-session-file=/var/folders/gv/dfzb5cvd3m5bzjgv8y8961zm0000gn/C/org.llvm.clang/ModuleCache/Session.modulevalidation
-fmodules-validate-once-per-build-session
-Wnon-modular-include-in-framework-module
-Werror=non-modular-include-in-framework-module
-Wno-trigraphs
-fpascal-strings
-O0
-fno-common
-Wno-missing-field-initializers
-Wno-missing-prototypes
-Werror=return-type
-Wdocumentation
-Wunreachable-code
-Wno-implicit-atomic-properties
-Werror=deprecated-objc-isa-usage
-Werror=objc-root-class
-Wno-arc-repeated-use-of-weak
-Wduplicate-method-match
-Wno-missing-braces
-Wparentheses
-Wswitch
-Wunused-function
-Wno-unused-label
-Wno-unused-parameter
-Wunused-variable
-Wunused-value
-Wempty-body
-Wconditional-uninitialized
-Wno-unknown-pragmas
-Wno-shadow
-Wno-four-char-constants
-Wno-conversion
-Wconstant-conversion
-Wint-conversion
-Wbool-conversion
-Wenum-conversion
-Wshorten-64-to-32
-Wpointer-sign
-Wno-newline-eof
-Wno-selector
-Wno-strict-selector-match
-Wundeclared-selector
-Wno-deprecated-implementations
-DDEBUG=1
-DOBJC_OLD_DISPATCH_PROTOTYPES=0
-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk
-fasm-blocks
-fstrict-aliasing
-Wprotocol
-Wdeprecated-declarations
-mmacosx-version-min=10.12
-g
-Wno-sign-conversion
-Winfinite-recursion
-iquote /Users/aaron/tmp/Hello/.clang_driveddata/Hello.build/Debug/Hello.build/Hello-generated-files.hmap
-I/Users/aaron/tmp/Hello/.clang_driveddata/Hello.build/Debug/Hello.build/Hello-own-target-headers.hmap
-I/Users/aaron/tmp/Hello/.clang_driveddata/Hello.build/Debug/Hello.build/Hello-all-target-headers.hmap
-iquote /Users/aaron/tmp/Hello/.clang_driveddata/Hello.build/Debug/Hello.build/Hello-project-headers.hmap
-I/Users/aaron/tmp/Hello/.clang_driveddata/Debug/include
-I/Users/aaron/tmp/Hello/.clang_driveddata/Hello.build/Debug/Hello.build/DerivedSources/x86_64
-I/Users/aaron/tmp/Hello/.clang_driveddata/Hello.build/Debug/Hello.build/DerivedSources
-F/Users/aaron/tmp/Hello/.clang_driveddata/Debug
-I/Users/aaron/tmp/Hello/Hello
-I/Users/aaron/tmp/Hello/HelloTests
-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
-F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks
-resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/8.0.0
-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers

Works code:

#import <Foundation/Foundation.h>
#import "AppDelegate.h"
@interface AppDelegate ()

@property (weak) IBOutlet NSWindow *window;
@end

@implementation AppDelegate

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
    // Insert code here to initialize your application
   [self applic*
}

- (void)applicationWillTerminate:(NSNotification *)aNotification {
    // Insert code here to tear down your application
}
@end

Not work code:

#import <Foundation/Foundation.h>
#import "AppDelegate.h"
@interface AppDelegate ()

@property (weak) IBOutlet NSWindow *window;
@end

@implementation AppDelegate

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
    // Insert code here to initialize your application
   [NSString stri*
}

- (void)applicationWillTerminate:(NSNotification *)aNotification {
    // Insert code here to tear down your application
}
@end

where * is the cursor.

All Foundation & Cocoa class does not work.

Just installed the newest version of this plugin.

Any help?