Symbols with ' in them are not font-locked correctly

未關閉
#435 7 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
45/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
clojure, emacs-lisp
領域
tooling

研究方向

在程式碼庫中搜尋 clojure--sym-forbidden-rest-chars,並使用 (defn test'fn []) 在 clojure-mode 中重現該問題。驗證 font-locking 如何解析該符號,並確認修正 bug 後,完整的 test'fn form 會使用單一顏色。

由索引模型根據 Issue 內容生成。

描述

A symbol with ' in it should be font-locked so that the whole symbol has the same color. I'm no expert on font-locking, nor on clojure-mode, but I quickly browsed the code, and this seems wrong:
(defconst clojure--sym-forbidden-rest-chars "][\";\'@\\^`~\(\)\{\}\\,\s\t\n\r"
since https://clojure.org/reference/reader says that ' is allowed in a symbol. I tried to change that but it didn't solve the problem below.

Steps to reproduce the problem

Type (defn test'fn []) in clojure-mode and note the colors.

Expected behavior

All characters of test'fn should be of the same color.

Actual behavior

The characters after and including ' are not of the expected color (they are white, my default text color).

clojure-mode version information

5.7.0-snapshot

主要語言
Emacs Lisp
星號
1k
分支
249
平均合併
1 天 6 小時
30 天內合併 PR
6

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

clojure-emacs/clojure-mode 的其他 Issue

查看 clojure-emacs/clojure-mode 的全部 Issue

相似的 Issue

更多 DevTools Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。