feat: init syntax library for function hover tip (#77)

* dev: introduce upstream tooltip

* feat: basic function definition

* feat: init syntax library

* abandon

* build: run syntax building

* fix: let expression

* fix: markup in code

* fix: raw code
This commit is contained in:
Myriad-Dreamin 2024-03-20 12:18:57 +08:00 committed by GitHub
parent 14fc4819f1
commit a3948df5da
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
46 changed files with 3068 additions and 5 deletions

View file

@ -61,8 +61,8 @@ fn def_tooltip(ctx: &mut AnalysisContext, source: &Source, cursor: usize) -> Opt
crate::syntax::LexicalKind::Var(LexicalVarKind::Function) => {
let f = lnk.value.as_ref();
Some(Tooltip::Text(eco_format!(
r#"```typc
let {}({});
r#"```typst-grammar
#let {}({});
```{}"#,
lnk.name,
ParamTooltip(f),
@ -80,8 +80,8 @@ let {}({});
Some(Tooltip::Text(eco_format!(
r#"
```typc
let {};
```typst-grammar
#let {};
```{v}"#,
lnk.name
)))