Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax-highlight #inst and #uuid #975

Closed
mfikes opened this issue Jun 13, 2019 · 2 comments · Fixed by #987

Comments

@mfikes
Copy link
Member

commented Jun 13, 2019

image

Syntax highlight the strings that follow #inst and #uuid.

@pyrmont

This comment has been minimized.

Copy link
Member

commented Jun 14, 2019

Did you have an idea for the appropriate colours?

@mfikes

This comment has been minimized.

Copy link
Member Author

commented Jun 14, 2019

@pyrmont Yeah, I was thinking that the strings would simply be rendered in the same color that strings currently get rendered as. (I'm color blind... assuming it is green.)

But, the solution is probably just an extra branch or two in here for these types

(visit-unknown [this x]
(cond
(instance? Atom x)
(pretty-coll this "#object [" ['cljs.core.Atom {:val @x}] :line "]" visit)
(instance? Volatile x)
(pretty-coll this "#object [" ['cljs.core.Volatile {:val @x}] :line "]" visit)
(instance? Delay x)
(pretty-coll this "#object[" ['cljs.core.Delay {:status (if (nil? (.-f x)) :ready :pending),
:val (.-value x)}
] :line "]" visit)
(satisfies? IPrintWithWriter x)
(visit-default x)
(instance? Eduction x)
(if print-length
(fipp.visit/visit-seq this (into [] (take (inc print-length)) x))
(visit this (sequence x)))
(array? x)
(pretty-coll this "#js [" x :line "]" visit)
(object? x)
(let [kvs (map (fn [k]
[(cond-> k (some? (re-matches #"[A-Za-z_\*\+\?!\-'][\w\*\+\?!\-']*" k)) keyword)
(gobj/get x k)])
(js-keys x))]
(pretty-coll this "#js {" kvs [:span "," :line] "}"
(fn [printer [k v]]
[:span (visit printer k) " " (visit printer v)])))
:else
(visit-default x)))

@mfikes mfikes self-assigned this Jul 6, 2019

mfikes added a commit that referenced this issue Jul 6, 2019

@mfikes mfikes closed this in #987 Jul 7, 2019

mfikes added a commit that referenced this issue Jul 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.