diff --git a/crates/tinymist-query/src/fixtures/docs/raw.typ b/crates/tinymist-query/src/fixtures/docs/raw.typ new file mode 100644 index 00000000..6e6825f8 --- /dev/null +++ b/crates/tinymist-query/src/fixtures/docs/raw.typ @@ -0,0 +1,11 @@ +/// Docs for f. +/// +/// ```typst +/// #show raw: it => it { +/// it +/// } +/// ``` +/// +#let /* ident after */ f(a) = { + show it: it => it; +}; \ No newline at end of file diff --git a/crates/tinymist-query/src/fixtures/docs/snaps/test@raw.typ.snap b/crates/tinymist-query/src/fixtures/docs/snaps/test@raw.typ.snap new file mode 100644 index 00000000..fa586d69 --- /dev/null +++ b/crates/tinymist-query/src/fixtures/docs/snaps/test@raw.typ.snap @@ -0,0 +1,12 @@ +--- +source: crates/tinymist-query/src/analysis.rs +expression: result +input_file: crates/tinymist-query/src/fixtures/docs/raw.typ +--- + Docs for f. + + ```typst + #show raw: it => it { + it + } + ``` diff --git a/crates/tinymist-query/src/syntax/comment.rs b/crates/tinymist-query/src/syntax/comment.rs index f68b2d30..51c02f73 100644 --- a/crates/tinymist-query/src/syntax/comment.rs +++ b/crates/tinymist-query/src/syntax/comment.rs @@ -38,7 +38,7 @@ fn extract_document_between(node: &LinkedNode, rng: Range) -> Option { @@ -61,7 +61,18 @@ fn extract_document_between(node: &LinkedNode, rng: Range) -> Option()) + .collect::>() + .join("\n"); + + Some(docs) } pub fn find_document_before(src: &Source, cursor: usize) -> Option {