Reader conditional confuses indentation

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

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

評価

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

調査の方向性

align-arguments と always-align を使用して clojure-mode のインデントの違いを再現し、次に #?@ reader conditional のインデント処理を追跡します。提供されている reify の例で修正を確認し、Clojure と ClojureScript の両方の分岐が期待されるインデントになるようにします。

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

説明

bug help wanted indentation

Expected behavior

(reify
  Object    

  #?@(:clj
      [(equals
         [this other])

       (hashCode
         [_]
         (hash 1))]

      :cljs
      [(toJSON
         [this]
         (throw (ex-info "error" {})))

       IEquiv

       (-equiv
         [this other]
         true)]))

Actual behavior


(reify
  Object    

  #?@(:clj
      [(equals
           [this other]) ; <------

       (hashCode
         [_]
         (hash 1))]

      :cljs
      [(toJSON
           [this] ; <------
         (throw (ex-info "error" {})))

       IEquiv

       (-equiv
         [this other]
         true)]))

Steps to reproduce the problem

(setq clojure-indent-style 'align-arguments)
(But the problem is the same with 'always-align.)

Paste in a buffer and indent.

(C-x h TAB)

Environment & Version information

clojure-mode version

M-x clojure-mode-display-version

clojure-mode (version nil)

When checking in packages:
20220418.2015

Emacs version

28.1

Operating system

Ubuntu 18.04.6 LTS

主要言語
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 を短くまとめたダイジェスト。