Incorrect indentation of `core.match/match` macro

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

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
clojure, emacs-lisp
領域
tooling

調査の方向性

まず、Clojure(Script)ファイルで例を再現し、TABを使ってindent-for-tab-commandを実行します。結果をcider-format-regionとlsp-format-regionで示されているフォーマットと比較し、報告者が言及した関連するインデントテストを追加してください。matchフォームが期待されるアラインメントになることを確認できたら、このIssueは完了と考えます。

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

説明

Expected behavior

clojure-mode should indent match forms (from core.match) the same as M-x cider-format-region or M-x lsp-format-region.

For example:

(doseq [n (range 1 101)]
  (println
   (match [(mod n 3) (mod n 5)]
     [0 0] "FizzBuzz"
     [0 _] "Fizz"
     [_ 0] "Buzz"
     :else n)))

Actual behavior

clojure-mode indents match forms incorrectly.

(doseq [n (range 1 101)]
  (println
   (match [(mod n 3) (mod n 5)]
          [0 0] "FizzBuzz"
          [0 _] "Fizz"
          [_ 0] "Buzz"
          :else n)))

Steps to reproduce the problem

Use the code from the above example in a Clojure(Script) file and run indent-for-tab-command using TAB.

Environment & Version information

clojure-mode version
clojure-mode (version 5.13.0)
Emacs version

27.1

Operating system

macOS 11.5.2 (Big Sur)

Commentary

I'm happy to submit a PR with relevant indentation tests to fix this, but just wanted to make sure it's something that should be added to clojure-mode.

主要言語
Emacs Lisp
スター
1k
フォーク
249
平均マージ
1日 6時間
マージ済み PR(30日)
6

環境構築

はじめの一歩

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

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

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

似ている issue

DevTools の issue をもっと見る

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

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