 ;;;; (:require-patch "")
 ;;;; HISTORY :
 ;;;; $Log$
+;;;; Revision 3.10  2015/05/12 12:50:36  troche
+;;;; * new classes completion based on kernel
+;;;;
 ;;;; Revision 3.9  2015/05/06 16:24:01  mgautier
 ;;;; - fix auto-complete in js evaluator mode
 ;;;;

  ;; initialize kernel completion
  (ojs-kernel-ac-init)

  ;; dictionary cache
  (setq *ac-dictionary-candidates-cache* (ac-file-dictionary (concat *opx2-network-folder-work-path* "devenv/el/dict/opx2-js-mode")))
  


(ac-define-source "ojs-classes"
    '((candidates . ojs-classes-ac-candidates)
      (symbol . "c ")
      (requires . -1)))

(defvar *ojs-classes-candidates-cache* nil)

;; on reset le cache ds qu'on sauve
;;(ac-clear-variable-after-save '*ojs-classes-candidates-cache*)

;; reset du cache toutes les minutes
;;ac-clear-variable-every-minute '*ojs-functions-candidates-cache*)

(defun ojs-classes-ac-candidates ()
  *ojs-classes-candidates-cache*)

(defun ojs-classes-ac-init ()
  (or *ojs-classes-candidates-cache*
      (setq *ojs-classes-candidates-cache* (when (fi::lep-open-connection-p) 
					     (fi:eval-in-lisp "(when (fboundp 'jvs::list-all-js-classes) (jvs::list-all-js-classes \"[Oo][Pp][Xx][^0-9].*$\"))")))))  

;;; generic ojs dictionary 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
