Skip to content

Commit b771860

Browse files
committed
vscode: Fixed the syntax highlighter for vs code
1 parent a6e25c0 commit b771860

File tree

8 files changed

+89
-50
lines changed

8 files changed

+89
-50
lines changed

editors/vscode/CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Change Log
2+
3+
All notable changes to the "piccodescript" extension will be documented in this file.
4+
5+
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
6+
7+
## [Unreleased]
8+
9+
- Initial release

editors/vscode/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# piccodescript
2+

editors/vscode/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ VERSION=1.0
77
EDITOR=VSCode
88

99
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
10-
VSCODE_EXTENSION_DIR="$HOME/.vscode/extensions/cspydr"
10+
VSCODE_EXTENSION_DIR="$HOME/.vscode/extensions/piccodescript"
1111

1212
log() {
1313
printf "[INFO] %s\n" "$1"

editors/vscode/language-configuration.json

100755100644
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,30 @@
11
{
22
"comments": {
3+
// symbol used for single line comment. Remove this entry if your language does not support line comments
34
"lineComment": "//",
5+
// symbols used for start and end a block comment. Remove this entry if your language does not support block comments
46
"blockComment": [ "/*", "*/" ]
57
},
8+
// symbols used as brackets
69
"brackets": [
710
["{", "}"],
811
["[", "]"],
912
["(", ")"]
1013
],
14+
// symbols that are auto closed when typing
1115
"autoClosingPairs": [
1216
["{", "}"],
1317
["[", "]"],
1418
["(", ")"],
1519
["\"", "\""],
16-
["'", "'"],
17-
["`", "`"]
20+
["'", "'"]
1821
],
22+
// symbols that can be used to surround a selection
1923
"surroundingPairs": [
2024
["{", "}"],
2125
["[", "]"],
2226
["(", ")"],
2327
["\"", "\""],
24-
["'", "'"],
25-
["`", "`"],
28+
["'", "'"]
2629
]
27-
}
30+
}

editors/vscode/package-lock.json

Lines changed: 12 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

editors/vscode/package.json

100755100644
Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,30 @@
11
{
2-
"name": "piccodescript-syntax-highlighting",
3-
"displayName": "PiccodeScript Syntax Highlighting",
4-
"description": "VSCode Syntax highlighting support for the PiccodeScript programming language",
5-
"license": "MIT",
6-
"version": "0.0.1",
7-
"publisher": "Hexaredecimal",
8-
"repository": {
9-
"type": "git",
10-
"url": "https://github.com/Glimmr-Lang/PiccodeScript"
11-
},
12-
"engines": {
13-
"vscode": "^1.56.0"
14-
},
15-
"categories": [
16-
"Programming Languages"
17-
],
18-
"contributes": {
19-
"languages": [{
20-
"id": "picoc",
21-
"aliases": ["PiccodeScript", "picoc", "pic"],
22-
"extensions": [".pics"],
23-
"configuration": "./language-configuration.json"
24-
}],
25-
"grammars": [{
26-
"language": "piccodescript",
27-
"scopeName": "source.pics",
28-
"path": "./syntaxes/piccodescript.tmLanguage.json"
29-
}]
30-
}
2+
"name": "piccodescript",
3+
"displayName": "piccodescript",
4+
"description": "VSCode support for piccodescript",
5+
"version": "0.0.1",
6+
"publisher": "Hexaredecimal",
7+
"engines": {
8+
"vscode": "^1.101.0"
9+
},
10+
"repository": {
11+
"type": "git",
12+
"url": "https://github.com/Glimmr-Lang/PiccodeScript"
13+
},
14+
"categories": [
15+
"Programming Languages"
16+
],
17+
"contributes": {
18+
"languages": [{
19+
"id": "picoc",
20+
"aliases": ["PiccodeScript", "picoc"],
21+
"extensions": [".pics"],
22+
"configuration": "./language-configuration.json"
23+
}],
24+
"grammars": [{
25+
"language": "picoc",
26+
"scopeName": "source.pics",
27+
"path": "./syntaxes/picoc.tmLanguage.json"
28+
}]
29+
}
3130
}

editors/vscode/syntaxes/piccodescript.tmLanguage.json renamed to editors/vscode/syntaxes/picoc.tmLanguage.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
33
"name": "piccodescript",
44
"scopeName": "source.pics",
5-
"fileTypes": ["pics"],
65
"patterns": [
76
{ "include": "#main" },
87
{ "include": "#main__1" },
@@ -93,4 +92,3 @@
9392
}
9493
}
9594
}
96-
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Welcome to your VS Code Extension
2+
3+
## What's in the folder
4+
5+
* This folder contains all of the files necessary for your extension.
6+
* `package.json` - this is the manifest file in which you declare your language support and define the location of the grammar file that has been copied into your extension.
7+
* `syntaxes/picoc.tmLanguage.json` - this is the Text mate grammar file that is used for tokenization.
8+
* `language-configuration.json` - this is the language configuration, defining the tokens that are used for comments and brackets.
9+
10+
## Get up and running straight away
11+
12+
* Make sure the language configuration settings in `language-configuration.json` are accurate.
13+
* Press `F5` to open a new window with your extension loaded.
14+
* Create a new file with a file name suffix matching your language.
15+
* Verify that syntax highlighting works and that the language configuration settings are working.
16+
17+
## Make changes
18+
19+
* You can relaunch the extension from the debug toolbar after making changes to the files listed above.
20+
* You can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes.
21+
22+
## Add more language features
23+
24+
* To add features such as IntelliSense, hovers and validators check out the VS Code extenders documentation at https://code.visualstudio.com/api/language-extensions/overview
25+
26+
## Install your extension
27+
28+
* To start using your extension with Visual Studio Code copy it into the `<user home>/.vscode/extensions` folder and restart Code.
29+
* To share your extension with the world, read on https://code.visualstudio.com/api/working-with-extensions/publishing-extension about publishing an extension.

0 commit comments

Comments
 (0)