Namespace inference when clojure project root is not git repo root

オープン
#143 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

メンテナーはふだん 3 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
静か
技術スタック
emacs, emacs-lisp

調査の方向性

まず、deps.edn が clj/ 配下にあるプロジェクトについて、namespace 推論の動作と clojure-ts-directory-prefixes 設定を確認します。ここで説明されているネストされたプロジェクトのレイアウトを再現し、Eglot が使用する project-root の動作を変更せずに namespace 推論が機能することを検証します。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Emacs Lisp
スター
192
フォーク
21
平均マージ
2日 14時間
マージ済み PR(30日)
23

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

clojure-emacs/clojure-ts-mode のほかの issue

clojure-emacs/clojure-ts-mode の issue をすべて見る

似ている issue

DevTools の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。