From 4a2efb2f42494f62891ac801e0a27d246bd36684 Mon Sep 17 00:00:00 2001 From: Leander Tentrup Date: Tue, 28 Apr 2020 11:01:51 +0200 Subject: Implement syntax highlighting for doctests --- crates/ra_ide/src/snapshots/highlight_doctest.html | 70 ++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 crates/ra_ide/src/snapshots/highlight_doctest.html (limited to 'crates/ra_ide/src/snapshots') diff --git a/crates/ra_ide/src/snapshots/highlight_doctest.html b/crates/ra_ide/src/snapshots/highlight_doctest.html new file mode 100644 index 000000000..2f2d8c900 --- /dev/null +++ b/crates/ra_ide/src/snapshots/highlight_doctest.html @@ -0,0 +1,70 @@ + + +
impl Foo {
+    /// Constructs a new `Foo`.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// # #![allow(unused_mut)]
+    /// let mut foo: Foo = Foo::new();
+    /// ```
+    pub const fn new() -> Foo {
+        Foo { }
+    }
+
+    /// `bar` method on `Foo`.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// let foo = Foo::new();
+    ///
+    /// // calls bar on foo
+    /// assert!(foo.bar());
+    ///
+    /// /* multi-line
+    ///        comment */
+    ///
+    /// let multi_line_string = "Foo
+    ///   bar
+    ///          ";
+    ///
+    /// ```
+    ///
+    /// ```
+    /// let foobar = Foo::new().bar();
+    /// ```
+    pub fn foo(&self) -> bool {
+        true
+    }
+}
\ No newline at end of file -- cgit v1.2.3