clojure-emacs / clojure-emacs/clojure-mode

Reader conditional confuses indentation

オープン
#620 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
bug help wanted indentation
主要言語
Emacs Lisp
スター
1k
フォーク
249
PR マージ指標
30日以内にマージされた PR はありません

説明

## Expected behavior

```clj
(reify
Object

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

(hashCode
[_]
(hash 1))]

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

IEquiv

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

## Actual behavior

```clj

(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

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

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

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

評価

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

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

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