Function: bazel-find-module-file

bazel-find-module-file is an interactive and natively compiled function defined in bazel.el.

Signature

(bazel-find-module-file)

Documentation

Find the MODULE.bazel file for the current Bazel workspace.

Key Bindings

This command is not in any keymaps.

Source Code

;; Defined in /nix/store/ws8pkszjvcad1rgzqw6wja7qxacylfhn-emacs-packages-deps/share/emacs/site-lisp/elpa/bazel-20261002.1510/bazel.el
(defun bazel-find-module-file ()
  "Find the MODULE.bazel file for the current Bazel workspace."
  (declare (ftype (function () null)))
  (interactive)
  (let* ((source-file
          (or buffer-file-name default-directory
              (user-error "Buffer doesn’t visit a file or directory")))
         (root (or (bazel--repository-root source-file)
                   (user-error "File is not in a Bazel workspace")))
         (module-file (or (bazel--locate-file "MODULE.bazel" (list root))
                          (user-error "No MODULE.bazel file found"))))
    (find-file module-file))
  nil)