Function: bazel--complete-files

bazel--complete-files is a natively compiled function defined in bazel.el.

Signature

(bazel--complete-files PREFIX)

Documentation

Return file names in the current directory starting with PREFIX.

Exclude files that are normally not Bazel targets, such as directories and BUILD files.

The returned file names have a ‘bazel-target-kind’ property of
"source file".

Source Code

;; Defined in /nix/store/ws8pkszjvcad1rgzqw6wja7qxacylfhn-emacs-packages-deps/share/emacs/site-lisp/elpa/bazel-20261002.1510/bazel.el
(defun bazel--complete-files (prefix)
  "Return file names in the current directory starting with PREFIX.
Exclude files that are normally not Bazel targets, such as
directories and BUILD files.

The returned file names have a ‘bazel-target-kind’ property of
\"source file\"."
  (declare (ftype (function (string) list)))
  (cl-check-type prefix string)
  (let ((files ()))
    (dolist (filename (file-name-all-completions prefix default-directory))
      (and (not (directory-name-p filename))
           (not (member filename '("BUILD" "BUILD.bazel"
                                   "WORKSPACE" "WORKSPACE.bazel"
                                   "MODULE.bazel" "REPO.bazel" "VENDOR.bazel")))
           (not (equal (file-name-extension filename) "BUILD"))
           (not (string-prefix-p "bazel-" filename))
           (file-regular-p filename)
           (push (propertize filename 'bazel-target-kind "source file") files)))
    (sort files #'string-lessp)))