Namespace inference when clojure project root is not git repo root

Đang mở
#143 0 bình luận 1 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 3 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Ít trao đổi
Công nghệ
emacs, emacs-lisp

Hướng nghiên cứu

Bắt đầu bằng việc xem xét hành vi suy luận namespace và thiết lập clojure-ts-directory-prefixes đối với các dự án có deps.edn nằm dưới clj/. Tái hiện bố cục dự án lồng nhau được mô tả ở đây và xác minh rằng suy luận namespace hoạt động mà không thay đổi hành vi project-root được Eglot sử dụng.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

I have a mixed Clojure/Rust project. My Clojure code is in clj, which means deps.edn is found at clj/deps.edn relative to repo root, and my top-level application namespace is at clj/src/limabean.clj.

To make namespace inference work I had to tweak just one thing in fact, adding src/ to the clojure-ts-directory-prefixes, like this:

(use-package clojure-ts-mode
  :custom
  (clojure-ts-directory-prefixes '("^\\(?:[^/]+/\\)*clj[csxd]*/" "src/")))

My earlier approach of using locate-dominating-file to define the Clojure project root as where the deps.edn file lived turned out to break Eglot, which had a different idea of the project root. It turns out that these prefixes are all that was required to fix namespace inference.

Anyway, thanks for clojure-ts-mode, and hoping this helps someone.

Ngôn ngữ chính
Emacs Lisp
Star
192
Fork
21
Merge trung bình
2 ngày 14 giờ
Pull request đã merge (30 ngày)
23

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của clojure-emacs/clojure-ts-mode

Tất cả issue của clojure-emacs/clojure-ts-mode

Issue tương tự

Thêm issue về DevTools

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.