Liking cljdoc? Tell your friends :D

im.ttalk.agent.tools.syntax

「不更糟」语法闸(T-07;出处 Keelson SyntaxGuard.cs / SyntaxCheckers.cs,借鉴 coxswain check.ss)。

判据是更糟不是「不合法」:before 看得了、且 after 的问题数比 before 多才拒(0→1、3→5 拒; 3→1、3→3 放)。只查 after 会退化成「不合法就拒」,把修复它的那次编辑也拦掉,然后彻底卡死。

⚠️ 检查器 check 返回 nil(「看不了」)与返回 [](「看过了,没问题」)是两件事:审批预览对后者 说「✓ 改完之后语法没问题」,对前者一个字都不说。拿不准的写法一律回 nil,⛔ 猜。检查器抛异常等同 nil。

内置:JSON(Jackson,cheshire 带来的)、EDN 与 Clojure 源码(Clojure 读取器)、XML(JDK SAX,禁 DTD)。 BracketScan.cs 不移植——理由见 designs/tools-module.md §6。

「不更糟」语法闸(T-07;出处 Keelson `SyntaxGuard.cs` / `SyntaxCheckers.cs`,借鉴 coxswain `check.ss`)。

判据是**更糟**不是「不合法」:before 看得了、且 after 的问题数比 before 多才拒(0→1、3→5 拒;
3→1、3→3 放)。只查 after 会退化成「不合法就拒」,把修复它的那次编辑也拦掉,然后彻底卡死。

⚠️ 检查器 `check` 返回 nil(「看不了」)与返回 [](「看过了,没问题」)是**两件事**:审批预览对后者
说「✓ 改完之后语法没问题」,对前者一个字都不说。拿不准的写法一律回 nil,⛔ 猜。检查器抛异常等同 nil。

内置:JSON(Jackson,cheshire 带来的)、EDN 与 Clojure 源码(Clojure 读取器)、XML(JDK SAX,禁 DTD)。
BracketScan.cs 不移植——理由见 designs/tools-module.md §6。
raw docstring

built-inclj

内置检查器(各管各的扩展名,互不重叠)。

内置检查器(各管各的扩展名,互不重叠)。
sourceraw docstring

checkerclj

(checker handles-fn check-fn)

用谓词与函数造检查器(宿主接 tree-sitter 等用)。check-fn: (fn [path text]) ⇒ nil | [problem]

用谓词与函数造检查器(宿主接 tree-sitter 等用)。check-fn: (fn [path text]) ⇒ nil | [problem]
sourceraw docstring

edn-checkerclj

.edn 用 clojure.edn(任何 tag 都收);Clojure 源码(.clj .cljs .cljc .bb)用 LispReader (*read-eval* 关、读取器条件允许、任何 tag 都收)。未闭合时报「EOF while reading, starting at line N」。 读取器判不了的写法(::alias/kw、#= …)⇒ nil。

`.edn` 用 clojure.edn(任何 tag 都收);Clojure 源码(.clj .cljs .cljc .bb)用 LispReader
(`*read-eval*` 关、读取器条件允许、任何 tag 都收)。未闭合时报「EOF while reading, starting at line N」。
读取器判不了的写法(`::alias/kw`、`#=` …)⇒ nil。
sourceraw docstring

for-extensionsclj

(for-extensions check-fn & extensions)

按扩展名(带点、不分大小写)挑的检查器。

按扩展名(带点、不分大小写)挑的检查器。
sourceraw docstring

guard-ofclj

(guard-of ws)

工作区的语法闸配置。

工作区的语法闸配置。
sourceraw docstring

ISyntaxCheckercljprotocol

checkclj

(check checker path text)

查一遍:nil ⇒ 看不了;[] ⇒ 没问题;[{:line :column :message} ...] ⇒ 问题(行列从 1 起)。

查一遍:nil ⇒ 看不了;[] ⇒ 没问题;[{:line :column :message} ...] ⇒ 问题(行列从 1 起)。

handles?clj

(handles? checker path)

这个路径归不归它管。第一个说「管」的独家负责。

这个路径归不归它管。第一个说「管」的独家负责。
source

json-checkerclj

.json 严格;.jsonc、tsconfig*.json / jsconfig*.json、devcontainer.json、.vscode/ 下的允许注释与尾逗号。 解析器在第一处错误就停 ⇒ 问题数 0 / 1。

`.json` 严格;`.jsonc`、`tsconfig*.json` / `jsconfig*.json`、`devcontainer.json`、`.vscode/` 下的允许注释与尾逗号。
解析器在第一处错误就停 ⇒ 问题数 0 / 1。
sourceraw docstring

judgeclj

(judge guard path before after)

判一次:before / after 都过一遍。闸关着或 after 看不了 ⇒ nil。 before 为 nil ⇒ 新文件:不判,但预览照常对 after 下结论。 ⇒ {:before [..]|nil :after [..] :worse? bool}

判一次:before / after **都**过一遍。闸关着或 after 看不了 ⇒ nil。
before 为 nil ⇒ 新文件:不判,但预览照常对 after 下结论。
⇒ {:before [..]|nil :after [..] :worse? bool}
sourceraw docstring

max-listedclj

source

patch-file-linesclj

(patch-file-lines verdict shown)
source

patch-rejectionclj

(patch-rejection files)
source

preview-noteclj

(preview-note {:keys [before after worse?] :as v})

审批预览 diff 的尾巴:与执行时拒不拒是同一次判断。

审批预览 diff 的尾巴:与执行时拒不拒是同一次判断。
sourceraw docstring

problemsclj

(problems guard path text)

挑检查器并查;不归任何一个管、检查器回 nil 或抛异常 ⇒ nil。 guard: {:enabled? true :checkers [...]}——宿主给的 :checkers 排在内置前面。

挑检查器并查;不归任何一个管、检查器回 nil 或抛异常 ⇒ nil。
guard: {:enabled? true :checkers [...]}——宿主给的 :checkers 排在内置前面。
sourceraw docstring

rejectionclj

(rejection verdict shown)

edit_file / write_file 的拒绝文案。

edit_file / write_file 的拒绝文案。
sourceraw docstring

without-bomclj

(without-bom s)
source

xml-checkerclj

XML 家族:JDK SAX,禁 DTD、禁外部实体;带 <!DOCTYPE 的回 nil(不处理 DTD 就判不了里面的实体引用)。 第一处错误就停 ⇒ 0 / 1。

XML 家族:JDK SAX,禁 DTD、禁外部实体;带 `<!DOCTYPE` 的回 nil(不处理 DTD 就判不了里面的实体引用)。
第一处错误就停 ⇒ 0 / 1。
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close