From 108b953254e46851130e427b41cd143eee07fd02 Mon Sep 17 00:00:00 2001 From: Zac Pullar-Strecker Date: Sat, 13 Jun 2020 16:13:32 +1200 Subject: Remove local documentation link rewriting --- crates/ra_syntax/src/ast/test.txt | 15 --------------- crates/ra_syntax/src/ast/traits.rs | 36 ------------------------------------ 2 files changed, 51 deletions(-) delete mode 100644 crates/ra_syntax/src/ast/test.txt (limited to 'crates/ra_syntax/src') diff --git a/crates/ra_syntax/src/ast/test.txt b/crates/ra_syntax/src/ast/test.txt deleted file mode 100644 index f746bf1e7..000000000 --- a/crates/ra_syntax/src/ast/test.txt +++ /dev/null @@ -1,15 +0,0 @@ -The context is a general utility struct provided on event dispatches, which -helps with dealing with the current "context" of the event dispatch. -The context also acts as a general high-level interface over the associated -[`Shard`] which received the event, or the low-level [`http`] module. - -The context contains "shortcuts", like for interacting with the shard. -Methods like [`set_activity`] will unlock the shard and perform an update for -you to save a bit of work. - -A context will only live for the event it was dispatched for. After the -event handler finished, it is destroyed and will not be re-used. - -[`Shard`]: ../gateway/struct.Shard.html -[`http`]: ../http/index.html -[`set_activity`]: #method.set_activity diff --git a/crates/ra_syntax/src/ast/traits.rs b/crates/ra_syntax/src/ast/traits.rs index 323d78bbc..a8f2454fd 100644 --- a/crates/ra_syntax/src/ast/traits.rs +++ b/crates/ra_syntax/src/ast/traits.rs @@ -146,39 +146,3 @@ impl Iterator for CommentIter { self.iter.by_ref().find_map(|el| el.into_token().and_then(ast::Comment::cast)) } } - -#[cfg(test)] -mod tests { - use comrak::{parse_document,format_commonmark, ComrakOptions, Arena}; - use comrak::nodes::{AstNode, NodeValue}; - - fn iter_nodes<'a, F>(node: &'a AstNode<'a>, f: &F) - where F : Fn(&'a AstNode<'a>) { - f(node); - for c in node.children() { - iter_nodes(c, f); - } - } - - #[allow(non_snake_case)] - #[test] - fn test_link_rewrite() { - let src = include_str!("./test.txt"); - - let arena = Arena::new(); - let doc = parse_document(&arena, src, &ComrakOptions::default()); - - iter_nodes(doc, &|node| { - match &mut node.data.borrow_mut().value { - &mut NodeValue::Link(ref mut link) => { - link.url = "https://www.google.com".as_bytes().to_vec(); - }, - _ => () - } - }); - - let mut out = Vec::new(); - format_commonmark(doc, &ComrakOptions::default(), &mut out); - panic!("{}", String::from_utf8(out).unwrap()); - } -} -- cgit v1.2.3