Is there a crate to do Rust-style syntax error highlighting? Like with the ^^^^^ squiggles but as a standalone crate for use with any string? I could've sworn there was, but wondering if I'm just thinking of quote_spanned! for proc macros https://docs.rs/quote/1.0.2/quote/macro.quote_spanned.html#example …
-
Show this thread
-
Replying to @yoshuawuyts
I'm using codespan in Gleamhttps://github.com/brendanzab/codespan …
1 reply 1 retweet 2 likes -
-
-
Replying to @louispilfold
Actually, do you maybe have an example of where you're using it? I'm wondering how to map this back to Error / ErrorKind pairs to get better log output. E.g. it'd be cool if we could go from TOML errors like on the left to clearer errors like on the right.pic.twitter.com/wOvIvNSV2y
1 reply 0 retweets 0 likes -
Replying to @yoshuawuyts
I'm definitely not using it the way it is intended to be used but I don't understand the API and just wanted to get something working quickly https://github.com/gleam-lang/gleam/blob/3e570e683fb53855dda88ba59d55d184d76aca7f/src/error.rs#L698-L712 …
1 reply 0 retweets 1 like
yosh Retweeted #[clippy::phansch]
Yeah, struggling with the API as well. https://twitter.com/philhansch/status/1203979755009323008 … seems very promising too!
yosh added,
-
-
Replying to @yoshuawuyts
that looks very nice! Having to slide up the source code yourself seems a bit annoying but otherwise seems straightforward. I was originally trying to find out if I could reuse rustc's diagnostics but it didn't seem to be possible back then.
0 replies 0 retweets 0 likesThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.