feat: strictly match module-level comments (#770)

* feat: strictly match module-level comments

* dev: update snapshot
This commit is contained in:
Myriad-Dreamin 2024-11-07 16:18:44 +08:00 committed by GitHub
parent 7dfa0fb498
commit c035f42676
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
109 changed files with 180 additions and 170 deletions

View file

@ -1,4 +1,4 @@
// contains: aa,aab,aac,aabc
/// contains: aa,aab,aac,aabc
#let aa() = 1;
#let aab() = 1;

View file

@ -1,4 +1,4 @@
// path: references.bib
/// path: references.bib
@article{Russell:1908,
Author = {Bertand Russell},
Journal = {American Journal of Mathematics},
@ -16,8 +16,8 @@ Year = 1908}
-----
// contains:Russell:1908,Mathematical logic based on the theory of types
// compile:true
/// contains:Russell:1908,Mathematical logic based on the theory of types
/// compile: true
#set heading(numbering: "1.1")

View file

@ -1,4 +1,4 @@
// path: references.bib
/// path: references.bib
@article{Russell:1908,
Author = {Bertand Russell},
Journal = {American Journal of Mathematics},
@ -15,8 +15,8 @@ Volume = 30,
Year = 1908}
-----
// contains:Russell:1908,Mathematical logic based on the theory of types
// compile:true
/// contains:Russell:1908,Mathematical logic based on the theory of types
/// compile: true
#set heading(numbering: "1.1")

View file

@ -1,4 +1,4 @@
// contains: base
/// contains: base
#let tmpl2(x, y) = {
assert(type(x) in (int, str) and type(y) == int)
x + y

View file

@ -1,10 +1,10 @@
// path: references.bib
/// path: references.bib
@article{t,}
-----
// contains:form,test
// compile:true
/// contains:form,test
/// compile: true
#set heading(numbering: "1.1")

View file

@ -1,2 +1,2 @@
// contains: attach
/// contains: attach
$: /* range -1..0 */$

View file

@ -1,3 +1,3 @@
// contains: attach
// trigger_character: :
/// contains: attach
/// trigger_character: :
$: /* range -1..0 */$

View file

@ -1,2 +1,2 @@
// contains: attach
/// contains: attach
$: /* range -1..0 */$

View file

@ -1,3 +1,3 @@
// contains: attach
// trigger_character: :
/// contains: attach
/// trigger_character: :
$: /* range -1..0 */$

View file

@ -1,3 +1,3 @@
// contains: length
// trigger_character: :
/// contains: length
/// trigger_character: :
#set text(baseline: /* range -1..0 */)

View file

@ -1,5 +1,5 @@
// contains:test
// compile:true
/// contains:test
/// compile: true
#set heading(numbering: "1.1")

View file

@ -1,5 +1,5 @@
// contains:test
// compile:true
/// contains:test
/// compile: true
#set heading(numbering: "1.1")

View file

@ -1,4 +1,4 @@
// path: references.bib
/// path: references.bib
@article{Russell:1908,
Author = {Bertand Russell},
Journal = {American Journal of Mathematics},
@ -8,8 +8,8 @@ Volume = 30,
Year = 1908}
-----
// contains:Russell:1908,Mathematical logic based on the theory of types
// compile:true
/// contains:Russell:1908,Mathematical logic based on the theory of types
/// compile: true
#set heading(numbering: "1.")
== Test <R>

View file

@ -1,4 +1,4 @@
// path: references.bib
/// path: references.bib
@article{Russell:1908,
Author = {Bertand Russell},
Journal = {American Journal of Mathematics},
@ -8,8 +8,8 @@ Volume = 30,
Year = 1908}
-----
// contains:Russell:1908,Mathematical logic based on the theory of types
// compile:true
/// contains:Russell:1908,Mathematical logic based on the theory of types
/// compile: true
#cite(<Russell:1908>)/* range -5..-4 */

View file

@ -1,4 +1,4 @@
// path: references.yaml
/// path: references.yaml
harry:
type: Book
title: Harry Potter and the Order of the Phoenix
@ -15,8 +15,8 @@ electronic:
url: http://www.techno.org/electronic-music-guide/
-----
// contains:harry,Harry Potter and the Order of the Phoenix,electronic,Ishkur's Guide to Electronic Music
// compile:true
/// contains:harry,Harry Potter and the Order of the Phoenix,electronic,Ishkur's Guide to Electronic Music
/// compile: true
#cite(<harry>) /* range -2..-1 */

View file

@ -1,3 +1,3 @@
// contains: caption
/// contains: caption
#figure.where(/* range 0..1 */)

View file

@ -1,4 +1,4 @@
// contains:a,ab,ac,ad
/// contains:a,ab,ac,ad
#let x = (
a: false,

View file

@ -1,4 +1,4 @@
// contains: content,authors,font,class
/// contains: content,authors,font,class
#let tmpl(content, authors: (), font: none, class: "article") = {
if class != "article" and class != "letter" {

View file

@ -1,4 +1,4 @@
// contains: content,authors,font,class
/// contains: content,authors,font,class
#let tmpl(content, authors: (), font: none, class: "article") = {
if class != "article" and class != "letter" {

View file

@ -1,4 +1,4 @@
// contains: content,authors,font,class
/// contains: content,authors,font,class
#let tmpl(content, authors: (), font: none, class: "article") = {
if class != "article" and class != "letter" {

View file

@ -1,4 +1,4 @@
// contains: aa,aab,aac,aabc
/// contains: aa,aab,aac,aabc
#let aa(aab, aac, aabc) = {
aac(/* range -2..0 */)

View file

@ -1,4 +1,4 @@
// contains: content,authors,font,class
/// contains: content,authors,font,class
#let tmpl(content, authors: (), font: none, class: "article") = {
if class != "article" and class != "letter" {

View file

@ -1,3 +1,3 @@
// contains: font
/// contains: font
#set text(fo /* range -2..0 */)

View file

@ -1,4 +1,4 @@
// path: base.typ
/// path: base.typ
#let x = 1;
#x
-----

View file

@ -1,10 +1,10 @@
// path: base.typ
/// path: base.typ
#let aa() = 1;
#let aab() = 1;
#let aac() = 1;
#let aabc() = 1;
-----
// contains: base,aa,aab,aac,aabc,aa.with,aa.where
/// contains: base,aa,aab,aac,aabc,aa.with,aa.where
#import "base.typ": aab, aac
#aac(/* range -2..0 */);

View file

@ -1,10 +1,10 @@
// path: base.typ
/// path: base.typ
#let aa() = 1;
#let aab() = 1;
#let aac() = 1;
#let aabc() = 1;
-----
// contains: base,aa,aab,aac,aabc,aa.with,aa.where
/// contains: base,aa,aab,aac,aabc,aa.with,aa.where
#import "base.typ"
#bac(/* range -2..0 */);

View file

@ -1,10 +1,10 @@
// path: base.typ
/// path: base.typ
#let aa() = 1;
#let aab() = 1;
#let aac() = 1;
#let aabc() = 1;
-----
// contains: base,aa,aab,aac,aabc,aa.with,aa.where
/// contains: base,aa,aab,aac,aabc,aa.with,aa.where
#import "base.typ": *
#bac(/* range -2..0 */);

View file

@ -1,10 +1,10 @@
// path: base.typ
/// path: base.typ
#let aa() = 1;
#let aab() = 1;
#let aac() = 1;
#let aabc() = 1;
-----
// contains: base,baz,aa,aab,aac,aabc,aa.with,aa.where
/// contains: base,baz,aa,aab,aac,aabc,aa.with,aa.where
#import "base.typ" as baz
#bac(/* range -2..0 */);

View file

@ -1,10 +1,10 @@
// path: base.typ
/// path: base.typ
#let aa() = 1;
#let aab() = 1;
#let aac() = 1;
#let aabc() = 1;
-----
// contains: base,baz,aa,aab,aac,aabc,aa.with,aa.where
/// contains: base,baz,aa,aab,aac,aabc,aa.with,aa.where
#import "base.typ" as baz: *
#bac(/* range -2..0 */);

View file

@ -1,10 +1,10 @@
// path: base.typ
/// path: base.typ
#let aa() = 1;
#let aab() = 1;
#let aac() = 1;
#let aabc() = 1;
-----
// contains: base,aa,aab,aac,aabc,aa.with,aa.where
/// contains: base,aa,aab,aac,aabc,aa.with,aa.where
#import "base.typ": *
#aac(/* range -2..0 */);

View file

@ -1,4 +1,4 @@
// contains: aa,aac
/// contains: aa,aac
#let aa = 1;
#let aa() = 1;

View file

@ -1,2 +1,2 @@
// contains: inset
/// contains: inset
#set block(in /* range -2..-1 */)

View file

@ -1,4 +1,4 @@
// contains: a
/// contains: a
#let a = 1;
#let b = /* range after 1..2 */ #();

View file

@ -1,4 +1,4 @@
// contains: aa,aab,aac,aabc
/// contains: aa,aab,aac,aabc
#let aa() = 1;
#let aab = 1;

View file

@ -1,3 +1,3 @@
// contains: "New Computer Modern"
/// contains: "New Computer Modern"
#set text(font: ""/* range -2..0 */)

View file

@ -1,3 +1,3 @@
// contains: "New Computer Modern"
/// contains: "New Computer Modern"
#set text(font: (""/* range -2..0 */))

View file

@ -1,3 +1,3 @@
// contains: paint,cap
/// contains: paint,cap
#text(stroke: (/* range after 1..2 */ ))[]

View file

@ -1,3 +1,3 @@
// contains: paint,cap
/// contains: paint,cap
#text(stroke: (paint: red, /* range after 1..2 */ ))[]

View file

@ -1,2 +1,2 @@
// This is X.
/// This is X.
#let x /* ident */ = 1;

View file

@ -1,3 +1,3 @@
// This is X.
// Note: this is not Y.
/// This is X.
/// Note: this is not Y.
#let x /* ident */ = 1;

View file

@ -1,3 +1,3 @@
// This is X
/// This is X
#let x /* ident */ = 1;

View file

@ -1,4 +1,4 @@
// Docs for f.
/// Docs for f.
#let f(/* ident after */ a) = {
show it: it => it;
};

View file

@ -1,4 +1,4 @@
// Docs for f.
/// Docs for f.
#let f(a) = {
show it: it => /* ident after */ it;
};

View file

@ -4,4 +4,4 @@ expression: "snap.join(\"\\n\")"
input_file: crates/tinymist-query/src/fixtures/docs/base.typ
---
= docstings
Pattern(..)@19..20 in /s0.typ -> DocString { docs: Some("This is X."), var_bounds: {}, vars: {}, res_ty: None }
Pattern(..)@20..21 in /s0.typ -> DocString { docs: Some("This is X."), var_bounds: {}, vars: {}, res_ty: None }

View file

@ -4,4 +4,4 @@ expression: "snap.join(\"\\n\")"
input_file: crates/tinymist-query/src/fixtures/docs/multiple_line.typ
---
= docstings
Pattern(..)@43..44 in /s0.typ -> DocString { docs: Some("This is X.\nNote: this is not Y."), var_bounds: {}, vars: {}, res_ty: None }
Pattern(..)@45..46 in /s0.typ -> DocString { docs: Some("This is X.\nNote: this is not Y."), var_bounds: {}, vars: {}, res_ty: None }

View file

@ -4,4 +4,4 @@ expression: "snap.join(\"\\n\")"
input_file: crates/tinymist-query/src/fixtures/docs/param.typ
---
= docstings
Func(f)@20..21 in /s0.typ -> DocString { docs: Some("Docs for f."), var_bounds: {}, vars: {}, res_ty: None }
Func(f)@21..22 in /s0.typ -> DocString { docs: Some("Docs for f."), var_bounds: {}, vars: {}, res_ty: None }

View file

@ -4,4 +4,4 @@ expression: "snap.join(\"\\n\")"
input_file: crates/tinymist-query/src/fixtures/docs/param_in_init.typ
---
= docstings
Func(f)@20..21 in /s0.typ -> DocString { docs: Some("Docs for f."), var_bounds: {}, vars: {}, res_ty: None }
Func(f)@21..22 in /s0.typ -> DocString { docs: Some("Docs for f."), var_bounds: {}, vars: {}, res_ty: None }

View file

@ -1,3 +1,3 @@
// most simple def-use case
/// most simple def-use case
#let x = 1;
#x

View file

@ -1,7 +1,7 @@
// path: base.typ
/// path: base.typ
#let f() = 1;
-----
// path: derive.typ
/// path: derive.typ
#import "base.typ"
-----
#import "derive.typ": *

View file

@ -1,4 +1,4 @@
// path: base.typ
/// path: base.typ
#let x = 1;
#x
-----

View file

@ -1,8 +1,8 @@
// path: base.typ
/// path: base.typ
#let x = 1;
#x
-----
// path: base2.typ
/// path: base2.typ
#import "base.typ": *
#let y = 2;
-----

View file

@ -4,7 +4,7 @@ expression: "snap.join(\"\\n\")"
input_file: crates/tinymist-query/src/fixtures/expr_of/base.typ
---
= resolves
Var(x)@33..34 in /s0.typ -> Var(x)@33..34 in /s0.typ, root Var(x)@33..34 in /s0.typ, val: None
IdentRef(x)@41..42 in /s0.typ -> Var(x)@33..34 in /s0.typ, root Var(x)@33..34 in /s0.typ, val: None
Var(x)@34..35 in /s0.typ -> Var(x)@34..35 in /s0.typ, root Var(x)@34..35 in /s0.typ, val: None
IdentRef(x)@42..43 in /s0.typ -> Var(x)@34..35 in /s0.typ, root Var(x)@34..35 in /s0.typ, val: None
= exports
x -> Var(x)@33..34 in /s0.typ
x -> Var(x)@34..35 in /s0.typ

View file

@ -1,4 +1,4 @@
// path: base.typ
/// path: base.typ
#let f() = 1;
-----
#import "base.typ": f as one

View file

@ -1,4 +1,4 @@
// path: base.typ
/// path: base.typ
#let f() = 1;
-----
#import "base.typ": f

View file

@ -1,4 +1,4 @@
// path: base.typ
/// path: base.typ
-----
#import "base.typ" as x
#(/* position after */ x);

View file

@ -1,3 +1,3 @@
// path: base.typ
/// path: base.typ
#import "@preview/example:0.1.0";
#(/* ident after */ example.add(1, 1))

View file

@ -1,3 +1,3 @@
// path: base.typ
/// path: base.typ
#import "@preview/example:0.1.0";
#(/* ident after */ example)

View file

@ -1,3 +1,3 @@
// path: base.typ
/// path: base.typ
-----
#import /* position after */ "base.typ"

View file

@ -1,4 +1,4 @@
// path: base.typ
/// path: base.typ
-----
#import "base.typ"
#(/* position after */ base);

View file

@ -1,4 +1,4 @@
// path: base.typ
/// path: base.typ
#let f() = 1;
-----
.

View file

@ -1,4 +1,4 @@
// path: variable.typ
/// path: variable.typ
#let x = 2;
-----
.

View file

@ -1,4 +1,4 @@
// path: base.typ
/// path: base.typ
#let f() = 1;
-----
.

View file

@ -1,4 +1,4 @@
// path: base.typ
/// path: base.typ
#let f() = 1;
-----
.

View file

@ -1,4 +1,4 @@
// path: base.typ
/// path: base.typ
#let f() = 1;
-----
.

View file

@ -1,4 +1,4 @@
// path: base.typ
/// path: base.typ
#let f() = 1;
-----
.

View file

@ -1,4 +1,4 @@
// compile:true
/// compile: true
#set heading(numbering: "1.")

View file

@ -1,4 +1,4 @@
// compile: true
/// compile: true
#let test1(body) = figure(body)
#test1([Test1]) <fig:test1>

View file

@ -1,4 +1,4 @@
// compile: true
/// compile: true
#let test1(body) = figure(body)
#test1([Test1]) <fig:test1>

View file

@ -1,4 +1,4 @@
// path: variable.typ
/// path: variable.typ
#let f(x) = 2;
-----

View file

@ -1,4 +1,4 @@
// path: variable.typ
/// path: variable.typ
#let f(x) = 2;
-----

View file

@ -1,4 +1,4 @@
// path: themod.typ
/// path: themod.typ
/// = The Module (Alias)
-----
#import "themod.typ" as thatmod

View file

@ -1,4 +1,4 @@
// path: some-module.typ
/// path: some-module.typ
/// = Some Module
-----
#import /* position after */ "some-module.typ"

View file

@ -1,4 +1,4 @@
// path: themod.typ
/// path: themod.typ
/// = The Module
-----
#import "themod.typ"

View file

@ -1,3 +1,3 @@
// most simple def-use case
/// most simple def-use case
#let x = 1;
#x

View file

@ -1,7 +1,7 @@
// path: base.typ
/// path: base.typ
#let f() = 1;
-----
// path: derive.typ
/// path: derive.typ
#import "base.typ"
-----
#import "derive.typ": *

View file

@ -1,3 +1,3 @@
// path: may_import.typ
/// path: may_import.typ
-----
#import "may_import.typ"

View file

@ -1,4 +1,4 @@
// path: base.typ
/// path: base.typ
-----
// this may happens in cetz
/// this may happens in cetz
#let evil_import() = import "base.typ"

View file

@ -1,5 +1,5 @@
// path: lib.typ
// - level (auto, ): The level
/// path: lib.typ
/// - level (auto, ): The level
#let _size-to-pt(size, container-dimension) = {
let to-convert = size
if type(size) == ratio {
@ -8,18 +8,18 @@
measure(v(to-convert)).height
}
-----
// contains: level, hierachical, depth
/// contains: level, hierachical, depth
#import "lib.typ": *
#current-heading(/* range 0..1 */)[];
-----
// contains: "body"
/// contains: "body"
#import "lib.typ": *
#current-heading(level: /* range 0..1 */)[];
-----
// contains: false, true
/// contains: false, true
#import "lib.typ": *
#current-heading(hierachical: /* range 0..1 */)[];
-----
// contains: false, true
/// contains: false, true
#import "lib.typ": *
#current-heading(depth: /* range 0..1 */)[];

View file

@ -1,5 +1,5 @@
// path: lib.typ
// - level (auto, int): The level
/// path: lib.typ
/// - level (auto, int): The level
#let current-heading(level: auto, hierachical: true, depth: 9999) = {
let current-page = here().page()
if not hierachical and level != auto {
@ -26,18 +26,18 @@
}
}
-----
// contains: level, hierachical, depth
/// contains: level, hierachical, depth
#import "lib.typ": *
#current-heading(/* range 0..1 */)[];
-----
// contains: "body"
/// contains: "body"
#import "lib.typ": *
#current-heading(level: /* range 0..1 */)[];
-----
// contains: false, true
/// contains: false, true
#import "lib.typ": *
#current-heading(hierachical: /* range 0..1 */)[];
-----
// contains: 9999, 1
/// contains: 9999, 1
#import "lib.typ": *
#current-heading(depth: /* range 0..1 */)[];

View file

@ -1,5 +1,5 @@
// path: lib.typ
// - level (auto, ): The level
/// path: lib.typ
/// - level (auto, ): The level
#let fit-to-height(
width: none,
prescale-width: none,
@ -18,14 +18,14 @@
]
}
-----
// contains: 1
/// contains: 1
#import "lib.typ": *
#fit-to-height(width: /* range 0..1 */)[];
-----
// contains: 1
/// contains: 1
#import "lib.typ": *
#fit-to-height(prescale-width: /* range 0..1 */)[];
-----
// contains: 1
/// contains: 1
#import "lib.typ": *
#fit-to-height(height: /* range 0..1 */)[];

View file

@ -1,18 +1,18 @@
// path: lib.typ
/// path: lib.typ
#let reconstruct(body-name: "body", labeled: true, named: false, it, ..new-body) = { }
-----
// contains: body-name, labeled, named, it, new-body
/// contains: body-name, labeled, named, it, new-body
#import "lib.typ": *
#reconstruct(/* range 0..1 */)[];
-----
// contains: "body"
/// contains: "body"
#import "lib.typ": *
#reconstruct(body-name: /* range 0..1 */)[];
-----
// contains: false, true
/// contains: false, true
#import "lib.typ": *
#reconstruct(labeled: /* range 0..1 */)[];
-----
// contains: false, true
/// contains: false, true
#import "lib.typ": *
#reconstruct(named: /* range 0..1 */)[];

View file

@ -1,4 +1,4 @@
// path: base.typ
/// path: base.typ
#let tmpl(content, font: none) = {
set text(font: font)

View file

@ -1,4 +1,4 @@
// path: base.typ
/// path: base.typ
#let tmpl(content, font: none) = {
set text(font: font)

View file

@ -1,4 +1,4 @@
// path: base.typ
/// path: base.typ
#let tmpl(content, authors: (), font: none, class: "article") = {
if class != "article" and class != "letter" {
panic("")

View file

@ -1,15 +1,15 @@
// path: base2.typ
/// path: base2.typ
== Base 2 <b2>
Ref to b1 @b1
Ref to b2 @b2
Ref to b1 @b1 again
-----
// path: base1.typ
/// path: base1.typ
== Base 1 <b1>
Ref to b1 @b1
Ref to b2 @b2
-----
// compile:true
/// compile: true
#set heading(numbering: "1.")
= Test Ref Label

View file

@ -1,5 +1,5 @@
#import "base.typ": *
#x
-----
// path: base.typ
/// path: base.typ
#let /* ident after */ x = 1;

View file

@ -1,5 +1,5 @@
#import "base.typ": x
#x
-----
// path: base.typ
/// path: base.typ
#let /* ident after */ x = 1;

View file

@ -1,6 +1,6 @@
// path: /out/main.typ
/// path: /out/main.typ
#import "/out/base.typ": x
#x
-----
// path: /out/base.typ
/// path: /out/base.typ
#let /* ident after */ x = 1;

View file

@ -1,4 +1,4 @@
// path: base.typ
/// path: base.typ
#let x = 1;
-----
#import "base.typ": x as /* ident after */ ff

View file

@ -1,5 +1,5 @@
#import "base.typ": x as ff
#ff
-----
// path: base.typ
/// path: base.typ
#let /* ident after */ x = 1;

View file

@ -1,6 +1,6 @@
// path: /out/main.typ
/// path: /out/main.typ
#import "base.typ": x
#x
-----
// path: /out/base.typ
/// path: /out/base.typ
#let /* ident after */ x = 1;

View file

@ -1,4 +1,4 @@
// compile: true
/// compile: true
#set heading(numbering: "1.")
= Labeled <title_label> /* ident */

View file

@ -1,9 +1,9 @@
#import "base2.typ": x
#x
-----
// path: base2.typ
/// path: base2.typ
#import "base.typ": x
#x
-----
// path: base.typ
/// path: base.typ
#let /* ident after */ x = 1;

View file

@ -1,9 +1,9 @@
#import "base2.typ": *
#x
-----
// path: base2.typ
/// path: base2.typ
#import "base.typ": *
#x
-----
// path: base.typ
/// path: base.typ
#let /* ident after */ x = 1;

View file

@ -1,4 +1,4 @@
// compile: true
/// compile: true
#set heading(numbering: "1.")
= Labeled <title_label>

View file

@ -1,10 +1,10 @@
// path: basic/writing.typ
/// path: basic/writing.typ
#import "mod.typ": *
#exercise()
-----
// path: basic/mod.typ
/// path: basic/mod.typ
#import "../mod.typ": exercise
#exercise()
-----
// path: mod.typ
/// path: mod.typ
#let /* ident after */ exercise() = [];

View file

@ -1,4 +1,4 @@
// path: user.typ
/// path: user.typ
#let f() = 1;
-----
#import "user.typ": f

View file

@ -1,4 +1,4 @@
// path: variable.typ
/// path: variable.typ
#let f(x) = 2;
-----
#import /* position after */ "variable.typ"

View file

@ -1,4 +1,4 @@
// path: variable.typ
/// path: variable.typ
#let f(x) = 2;
-----
#import /* position after */ "/variable.typ"

View file

@ -1,4 +1,4 @@
// path: variable.typ
/// path: variable.typ
#let f(x) = 2;
-----
#import /* position after */ "variable.typ" as t

Some files were not shown because too many files have changed in this diff Show more