Skip to content

Commit

Permalink
add syntax highlight for ston
Browse files Browse the repository at this point in the history
  • Loading branch information
badetitou committed Feb 14, 2024
1 parent c05b1a4 commit f985e47
Show file tree
Hide file tree
Showing 4 changed files with 145 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v2.1.17

- Syntax highlight for Ston

## v2.1.16

- Native Test integration
Expand Down
24 changes: 22 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Highlighting, Auto-completion, Execution, ...",
"author": "Benoît Verhaeghe",
"license": "MIT",
"version": "2.1.16",
"version": "2.1.17",
"icon": "icon.png",
"repository": {
"type": "git",
Expand All @@ -21,7 +21,8 @@
],
"keywords": [
"pharo",
"smalltalk"
"smalltalk",
"ston"
],
"engines": {
"vscode": "^1.76.0"
Expand Down Expand Up @@ -161,13 +162,32 @@
"light": "./media/moose-logo.svg",
"dark": "./media/moose-logo.svg"
}
},
{
"id": "ston",
"aliases": [
"Ston",
"STON"
],
"extensions": [
".ston"
],
"icon": {
"light": "./media/pharo-bar.svg",
"dark": "./media/pharo-bar.svg"
}
}
],
"grammars": [
{
"language": "pharo",
"scopeName": "source.pharo",
"path": "./syntaxes/pharo.tmLanguage.json"
},
{
"language": "ston",
"scopeName": "source.ston",
"path": "./syntaxes/ston.tmLanguage.json"
}
],
"commands": [
Expand Down
17 changes: 17 additions & 0 deletions samples/.smalltalk.ston
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
SmalltalkCISpec {
#loading : [
SCIMetacelloLoadSpec {
#baseline : 'PharoLanguageServer',
#directory : 'src',
#ignoreImage : true,
#onConflict : #useIncoming,
#onUpgrade : #useIncoming
}
],
#testing : {
#coverage : {
#packages : [ 'PharoLanguageServer.*', 'PLS-.*', 'PharoLanguageClient.*', 'PharoLanguageProtocol' ],
#format : #lcov
}
}
}
102 changes: 102 additions & 0 deletions syntaxes/ston.tmLanguage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
{
"name": "ston",
"foldingStartMarker": "\\[",
"foldingStopMarker": "^\\s*\\]|^\\s\\]",
"fileTypes": [
"ston"
],
"patterns": [
{
"begin": "'",
"beginCaptures": [
{
"name": "punctuation.definition.string.begin.ston"
}
],
"end": "'",
"endCaptures": [
{
"name": "punctuation.definition.string.end.ston"
}
],
"name": "string.quoted.single.ston"
},
{
"captures": {
"1": {
"name": "support.class.ston"
}
},
"comment": "Class Name",
"match": "([a-zA-Z_][a-zA-Z0-9]*) {"
},
{
"captures": {
"1": {
"name": "support.type.property-name.ston"
}
},
"comment": "symbols",
"match": "(#[a-zA-Z_][a-zA-Z0-9:]*) :"
},
{
"captures": {
"1": {
"name": "punctuation.definition.constant.ston"
}
},
"comment": "symbols",
"match": "(#)[a-zA-Z_][a-zA-Z0-9:]*",
"name": "constant.language.keyword.ston"
},
{
"match": "\\b(true|false)\\b",
"name": "constant.language.boolean.ston"
},
{
"begin": "#\\[",
"beginCaptures": [
{
"name": "punctuation.definition.constant.begin.ston"
}
],
"end": "\\]",
"endCaptures": [
{
"name": "punctuation.definition.constant.end.ston"
}
],
"name": "meta.array.byte.ston",
"patterns": [
{
"match": "[0-9]+(r[a-zA-Z0-9]+)?",
"name": "constant.numeric.integer.ston"
},
{
"match": "[^\\s\\]]+",
"name": "invalid.illegal.character-not-allowed-here.ston"
}
]
},
{
"begin": "#\\(",
"beginCaptures": [
{
"name": "punctuation.definition.constant.begin.ston"
}
],
"comment": "Array Constructor",
"end": "\\)",
"endCaptures": [
{
"name": "punctuation.definition.constant.end.ston"
}
],
"name": "constant.other.array.ston"
}
],
"repository": {
},
"scopeName": "source.ston"

}

0 comments on commit f985e47

Please sign in to comment.