Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions libs/indexBuild.ml
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ let lookup_parents (parents:parents) path sig_path =
let rec lookup = function
| [] ->
if debug_enabled then
debug "WARN: Module or sig reference %s not found a %s\n"
debug "WARN: Module or sig reference %s not found at %s\n"
(modpath_to_string sig_path)
(modpath_to_string path);
IndexTrie.empty
Expand Down Expand Up @@ -1336,7 +1336,7 @@ let fully_open_module ?(cleanup_path=false) ~qualify t path =
if not (Sys.file_exists f) then mod_trie
else
let dir,base = Filename.dirname f, Filename.basename f in
let t = load_files ~qualify IndexTrie.empty [dir,base] in
let t = load_files ~qualify t [dir,base] in
let t = IndexTrie.sub t tpath in
IndexTrie.merge ~values:merge mod_trie t
| Cmt _ -> mod_trie
Expand Down
4 changes: 3 additions & 1 deletion libs/indexMisc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ let key_to_modpath l =
in
List.rev_map (fun l -> key_to_string (List.rev l)) (aux [] [] l)

let modpath_to_string path = String.concat "." path
let modpath_to_string = function
| [] -> "."
| path -> String.concat "." path

let parent_type id =
match id.IndexTypes.kind with
Expand Down
14 changes: 7 additions & 7 deletions src/indexOptions.ml
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,13 @@ let common_opts ?(default_filter = default_filter) () : t Term.t =
LibIndex.Misc.unique_subdirs ~skip dirs
in
let info = LibIndex.load ~qualify:true dirs in
let info =
List.fold_left (LibIndex.open_module ~cleanup_path:true) info opens
in
let info =
List.fold_left (LibIndex.fully_open_module ~qualify:true ~cleanup_path:true)
info full_opens
in
let info = match context with
| None -> info
| Some (use_stdin,file,line,column) ->
Expand Down Expand Up @@ -336,13 +343,6 @@ let common_opts ?(default_filter = default_filter) () : t Term.t =
in
info
in
let info =
List.fold_left (LibIndex.open_module ~cleanup_path:true) info opens
in
let info =
List.fold_left (LibIndex.fully_open_module ~qualify:true ~cleanup_path:true)
info full_opens
in
info
in
Term.(
Expand Down
10 changes: 5 additions & 5 deletions tools/ocp-index.el
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
;; (https://github.com/auto-complete/auto-complete) and ocp-index

(provide 'ocp-index)
(require 'cl)
(require 'cl-lib)

;; Customize defs

Expand Down Expand Up @@ -108,14 +108,14 @@
(name (file-name-sans-extension file))
(current-module (concat (upcase (substring name 0 1))
(substring name 1)))
(cmd (list* cmd ocp-index-options
(cmd (cl-list* cmd ocp-index-options
"--full-open" current-module
"--context" (concat file ":-")
args)))
(when ocp-index-debug
(message "%s" (mapconcat
(lambda (s) (format "%S" s))
(list* ocp-index-path cmd) " ")))
(cl-list* ocp-index-path cmd) " ")))
cmd))

(defun ocp-index-run (cmd &rest args)
Expand All @@ -126,7 +126,7 @@
(apply 'call-process-region (point-min) (point)
shell-file-name
nil (list standard-output nil) nil
(list* shell-command-switch shell-command
(cl-list* shell-command-switch shell-command
ocp-index-path args))))
(when (= 127 ret)
(error "Could not find the Ocp-index program %S" ocp-index-path))))))
Expand Down Expand Up @@ -386,7 +386,7 @@ and greps in any OCaml source files from there. "
(ocp-index-jump-to-loc (car locs) other-window)
(cdr locs))))
(let ((next (ocp-index-jump-to-definition (ocp-index-symbol-at-point) sig other-window)))
(setq this-command (list* name next)))))
(setq this-command (cl-list* name next)))))

(defun ocp-index-jump-to-definition-at-point ()
(interactive nil) (ocp-index-jump 'ocp-index-jump-to-definition-at-point nil nil))
Expand Down
Loading