Initial LSP implementation/vscode support
This commit is contained in:
44
newt-vscode-lsp/syntaxes/inject.json
Normal file
44
newt-vscode-lsp/syntaxes/inject.json
Normal file
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"scopeName": "newt.injection",
|
||||
"injectionSelector": "L:text.html.markdown",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#fenced_code_block_newt"
|
||||
}
|
||||
],
|
||||
"repository": {
|
||||
"fenced_code_block_newt": {
|
||||
"begin": "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(newt)((\\s+|:|,|\\{|\\?)[^`]*)?$)",
|
||||
"name": "markup.fenced_code.block.markdown",
|
||||
"end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
|
||||
"beginCaptures": {
|
||||
"3": {
|
||||
"name": "punctuation.definition.markdown"
|
||||
},
|
||||
"4": {
|
||||
"name": "fenced_code.block.language.markdown"
|
||||
},
|
||||
"5": {
|
||||
"name": "fenced_code.block.language.attributes.markdown"
|
||||
}
|
||||
},
|
||||
"endCaptures": {
|
||||
"3": {
|
||||
"name": "punctuation.definition.markdown"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "(^|\\G)(\\s*)(.*)",
|
||||
"while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
|
||||
"contentName": "meta.embedded.block.newt",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "source.newt"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
47
newt-vscode-lsp/syntaxes/newt.tmLanguage.json
Normal file
47
newt-vscode-lsp/syntaxes/newt.tmLanguage.json
Normal file
@@ -0,0 +1,47 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
|
||||
"name": "newt",
|
||||
"scopeName": "source.newt",
|
||||
"patterns": [
|
||||
{
|
||||
"name": "invalid.illegal.trace",
|
||||
"match": "\\b(trace|strace|fatalError)\\b"
|
||||
},
|
||||
{
|
||||
"name": "comment.block.newt",
|
||||
"begin": "/-",
|
||||
"end": "-/",
|
||||
"contentName": "comment.block.newt"
|
||||
},
|
||||
{
|
||||
"name": "comment.line.newt",
|
||||
"begin": "--",
|
||||
"end": "\\n"
|
||||
},
|
||||
{
|
||||
"name": "keyword.newt",
|
||||
"match": "\\b(λ|=>|<-|->|→|:=|\\$|data|record|constructor|where|do|class|uses|instance|case|of|let|if|then|else|forall|∀|in|U|module|import|ptype|pfunc|infix|infixl|infixr)\\b"
|
||||
},
|
||||
{
|
||||
"name": "string.js",
|
||||
"begin": "`",
|
||||
"end": "`",
|
||||
"patterns": [{ "include": "source.js" }]
|
||||
},
|
||||
{
|
||||
"name": "character",
|
||||
"match": "'\\\\?.'"
|
||||
},
|
||||
{
|
||||
"name": "string.double.newt",
|
||||
"begin": "\"",
|
||||
"end": "\"",
|
||||
"patterns": [
|
||||
{
|
||||
"name": "constant.character.escape.newt",
|
||||
"match": "\\\\[^{]"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user