ç§ã¯ãiOS/Objective-Cã®ã³ã¼ãã£ã³ã°ã«ã¯å°ãEmacsã使ã£ã¦ãã¾ããä¸è¨ããã°ã®ãããã§ããªãå¿«é©ãªObjective-Cã®ã³ã¼ãã£ã³ã°ç°å¢ãæã«å ¥ãã¾ããã
(1) Emacs 㧠iPhone ã¢ããªéçºãå¿«é©ã«ããããã®è¨å®
ãã è¥å¹²æ°ã«ãªãã¨ããã¨ãã¦ãauto-complete-modeã®è£å®åè£ã®ç²¾åº¦ãXcodeã®ããã¨æ¯ã¹ã¦è¥å¹²è½ã¡ããã¨ãããã¾ãã
Xcodeã ã¨ããã¨ãã°ã
Foo a; [a xx
ã¯ã©ã¹Fooã®aãªãã¸ã§ã¯ãã®ã¡ã½ããå¼ã³åºãã®æèã§ã¯ãFooãå®è£ ãã"xx"ã§å§ã¾ãã¡ã½ããã®åè£ããµã¸ã§ã¹ããã¦ããã¾ããemacsã§ãæèã«å¿ããè£å®ãå®ç¾ããããã®ã§ãã
ããã§ãGoogleå çã«èãã¦ã¿ãã¨ããã
(2) Clang Completion Source for AutoComplete in Emacs
ã¨ããã®ãè¦ã¤ãã¾ããã(â»ãªã³ã¯åãã¦ã¾ãããã½ã¼ã¹ã¯ããããåå¾ã§ãã¾ããï¼
Clangã¨ããã®ã¯LLVMã³ã³ãã¤ã©ããã¸ã§ã¯ãã®ææã®ä¸ã¤ã§ãCè¨èªç³»ã®ããã°ã©ãã³ã°è¨èªã®æ§æ解æã¨ã³ã¸ã³ã®ããã³ãã¨ã³ãã¨ãã¦åä½ããã½ã¼ã¹ã³ã¼ãã®éç解æãè¡ããã¨ã§ãã·ã³ãã«ã®è£å®ãã½ã¼ã¹ã®ã¤ã³ãã¯ã·ã³ã°ãæä¾ãããã®ã¨è¨ããã¨ã§ãã
ä¸ã®ãã¼ã¸ã§å ¬éãã¦ããauto-comple-clang.elã¯ãauto-complete-modeã®è£å®ã½ã¼ã¹ã¨ãã¦ãclangã®è§£æçµæã使ãã¨ãããã®ã§ãã
Xcodeãã¤ã³ã¹ãã¼ã«ãããMacOSXã«ã¯clangã³ãã³ãããã§ã«ã¤ã³ã¹ãã¼ã«æ¸ã¿ã¨è¨ããã¨ã§ãæ©éä¸ã®ãã¼ã¸ããauto-comple-clang.elããã¦ã³ãã¼ããã¦ã試ãã¦ã¿ã¾ããã
ã¾ããauto-comple-clang.elãload-pathä¸ã®ãã£ã¬ã¯ããªã«ç½®ãã¦ãobjc-modeç·¨éæã®è£å®ã½ã¼ã¹ãclangã«è¨å®ãã¾ãã
(require 'auto-complete-clang) (add-hook 'objc-mode-hook (lambda () (push 'ac-source-clang-complete ac-sources) ... ))
次ã«ãclangã«æ¸¡ãã¤ã³ã¯ã«ã¼ããã¡ã¤ã«ã®ãã¹ãªã©ãè¨å®ãã¾ãã
(setq clang-completion-flags (list "-Wall" "-Wextra" "-fsyntax-only" "-ObjC" "-std=c99" "-isysroot" "/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0.sdk" "-I." "-D__IPHONE_OS_VERSION_MIN_REQUIRED=30200"))
ãªãã(1)ã®ãµã¤ããåèã«ãã¦flymakeãè¨å®ãã¦ãã人ã¯ãflymake-objc-compile-default-optionsããflymake-objc-compile-optionsã®å 容ãè¨å®ããã°ãããã¨æãã¾ãã
(setq clang-completion-flags (append flymake-objc-compile-default-options flymake-objc-compile-options ))
iOSããã°ã©ãã§ãããã¾ã§èªãã§ããã ããæ¹ã«ã¯ç³ã訳ãªãã®ã§ãããå®ã¯ãã©ãããææ°ã®ãã¼ã¸ã§ã³2.8ã«ããã¦ããobjective-cã®ã¯ã©ã¹ãã¡ã½ãããèªèããæ©è½ãå®è£ ããã¦ããªãããã§ãCè¨èªã®é¢æ°ããè£å®åè£ã«ç¾ãã¾ããã
ãªã®ã§ç¾ç¶ã¯ãç§ãæ±ãã¦ããçµæã¯å¾ããã¦ãã¾ããããã(2)ã®ãµã¤ãã«ããã¨ãC++ãªããã³ãã¬ã¼ãã¯ã©ã¹ãå«ãã°ã£ã¡ãè£å®ãã¦ããããããã®ã§ãå°ãC++ãæ¸ãããæ¹ã«ã¯ç¸å½ä¾¿å©ãªæ©è½ã§ã¯ç¡ããããã¨æãã¾ãã
2010/11/1è£è¨ï¼
ã©ãããobjective-Cã¯ã©ã¹/ã¡ã½ãããèªèãã¦ããããã§ããç§ã®åéãã§ãããä»ã®auto-completeæ
å ±æºã¨ä½µãã¦è¨å®ããã試è¡é¯èª¤ãã¦ããããããããã¾ããããããªãã¨ãç¾ç¶ãac-sourcesã«ac-source-clang-completeã®ã¿ãè¨å®ããéãã«ããã¦ã¯ãã¾ãè£å®ã§ããããã«ãªãã¾ããã
ã¡ãªã¿ã«ãclangãç´æ¥ãããã¦ãç¾ç¶ã®åä½ã確èªããã«ã¯ãä¸è¨ã®ãããªå¼æ°ã§å®è¡ãã¾ãã
clang -cc1 -D__IPHONE_OS_VERSION_MIN_REQUIRED=30200 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0.sdk -I. -fblocks -std=c99 -code-completion-at test.m:23:13 test.m 2
- code-completion-at ã®å¾ã®å¼æ°ã«ã対象ã¨ãªãã½ã¼ã¹ãã¡ã¤ã«åã¨ãè£å®ãããã«ã¼ã½ã«ä½ç½®ã®è¡çªå·ãã«ã©ã ãæå®ãã¾ãã-fblocksãã¤ããªãã¨iOS4ã§å°å ¥ãããblocksãç¨ãããããã®ç®æãã³ã³ãã¤ã«ã¨ã©ã¼ã¨ãã¦èªèããã¦ãã¾ãã¾ãã