mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-08-03 17:58:17 +00:00
feat: disable bracket colorizing according to textmate scopes (#81)
* feat: disable bracket colorizing according to textmate scopes * feat: use typc as highlighting language
This commit is contained in:
parent
14ef2e78e2
commit
10c3e0134a
2 changed files with 51 additions and 12 deletions
|
@ -65,8 +65,8 @@ fn def_tooltip(
|
|||
| crate::syntax::LexicalKind::Heading(..) => None,
|
||||
crate::syntax::LexicalKind::Var(LexicalVarKind::Function) => Some(
|
||||
LspHoverContents::Scalar(lsp_types::MarkedString::String(format!(
|
||||
r#"```typst-grammar
|
||||
#let {name}({params});
|
||||
r#"```typc
|
||||
let {name}({params});
|
||||
```{doc}"#,
|
||||
name = lnk.name,
|
||||
params = ParamTooltip(&lnk),
|
||||
|
@ -84,9 +84,9 @@ fn def_tooltip(
|
|||
.unwrap_or_default();
|
||||
Some(LspHoverContents::Scalar(lsp_types::MarkedString::String(
|
||||
format!(
|
||||
r#"```typst-grammar
|
||||
r#"```typc
|
||||
{values}
|
||||
#let {name};
|
||||
let {name};
|
||||
```{doc}"#,
|
||||
name = lnk.name,
|
||||
doc = DocTooltip::get(ctx, &lnk).unwrap_or_default(),
|
||||
|
|
|
@ -151,7 +151,9 @@
|
|||
".typ"
|
||||
],
|
||||
"aliases": [
|
||||
"Typst"
|
||||
"Typst",
|
||||
"typst",
|
||||
"typ"
|
||||
],
|
||||
"icon": {
|
||||
"light": "./icons/typst-small.png",
|
||||
|
@ -159,11 +161,15 @@
|
|||
}
|
||||
},
|
||||
{
|
||||
"id": "typst-grammar",
|
||||
"aliases": [
|
||||
"Typst with Syntax Support"
|
||||
],
|
||||
"id": "typst-code",
|
||||
"configuration": "./language-configuration.json",
|
||||
"extensions": [
|
||||
".typc"
|
||||
],
|
||||
"aliases": [
|
||||
"Typst (Code Mode)",
|
||||
"typc"
|
||||
],
|
||||
"icon": {
|
||||
"light": "./icons/typst-small.png",
|
||||
"dark": "./icons/typst-small.png"
|
||||
|
@ -172,9 +178,42 @@
|
|||
],
|
||||
"grammars": [
|
||||
{
|
||||
"language": "typst-grammar",
|
||||
"scopeName": "source.typst-grammar",
|
||||
"path": "./out/typst.tmLanguage.json"
|
||||
"language": "typst",
|
||||
"scopeName": "source.typst",
|
||||
"path": "./out/typst.tmLanguage.json",
|
||||
"balancedBracketScopes": [
|
||||
"*",
|
||||
"meta.expr",
|
||||
"meta.brace"
|
||||
],
|
||||
"unbalancedBracketScopes": [
|
||||
"markup.raw.block.typst",
|
||||
"markup.raw.inline.typst",
|
||||
"string.other.label.typst",
|
||||
"string.quoted.double.typst",
|
||||
"constant.character.escape",
|
||||
"comment.block.typst",
|
||||
"comment.line.double-slash.typst"
|
||||
]
|
||||
},
|
||||
{
|
||||
"language": "typst-code",
|
||||
"scopeName": "source.typst-code",
|
||||
"path": "./out/typst-code.tmLanguage.json",
|
||||
"balancedBracketScopes": [
|
||||
"*",
|
||||
"meta.expr",
|
||||
"meta.brace"
|
||||
],
|
||||
"unbalancedBracketScopes": [
|
||||
"markup.raw.block.typst",
|
||||
"markup.raw.inline.typst",
|
||||
"string.other.label.typst",
|
||||
"string.quoted.double.typst",
|
||||
"constant.character.escape",
|
||||
"comment.block.typst",
|
||||
"comment.line.double-slash.typst"
|
||||
]
|
||||
}
|
||||
],
|
||||
"semanticTokenTypes": [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue