Skip to content

Commit 5b15d94

Browse files
committed
extrension
1 parent f09ac18 commit 5b15d94

4 files changed

Lines changed: 34 additions & 78 deletions

File tree

vscode-ex/.vscode/launch.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Run Extension",
6+
"type": "extensionHost",
7+
"request": "launch",
8+
"runtimeExecutable": "${execPath}",
9+
"args": [
10+
"--extensionDevelopmentPath=${workspaceFolder}"
11+
]
12+
}
13+
]
14+
}

vscode-ex/language-configuration.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"comments": {
3-
"lineComment": "#"
3+
"lineComment": "#",
44
},
55

66
"brackets": [

vscode-ex/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "samfile",
33
"displayName": "Samfile",
44
"description": "Syntax Highlighting for Samfiles",
5-
"version": "0.0.1",
5+
"version": "0.0.2",
66
"publisher": "your-name",
77

88
"engines": {
Lines changed: 18 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
{
22
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
3-
4-
"scopeName": "source.samfile",
5-
63
"name": "Samfile",
7-
4+
"scopeName": "source.samfile",
85
"patterns": [
96
{
107
"include": "#comments"
118
},
129
{
13-
"include": "#task"
10+
"include": "#targets"
1411
},
1512
{
1613
"include": "#commands"
@@ -19,109 +16,54 @@
1916
"include": "#strings"
2017
},
2118
{
22-
"include": "#numbers"
19+
"include": "#urls"
2320
}
2421
],
25-
2622
"repository": {
27-
2823
"comments": {
2924
"patterns": [
3025
{
31-
"match": "^\\s*#.*$",
32-
"name": "comment.line.number-sign.samfile"
33-
},
34-
{
35-
"match": "^\\s*//.*$",
36-
"name": "comment.line.double-slash.samfile"
37-
},
38-
{
39-
"match": "^\\s*--.*$",
40-
"name": "comment.line.double-dash.samfile"
26+
"name": "comment.line.number-sign.samfile",
27+
"match": "#.*$"
4128
}
4229
]
4330
},
44-
45-
"task": {
31+
"targets": {
4632
"patterns": [
4733
{
48-
"match": "^([A-Za-z0-9_.-]+)(\\s*:)",
49-
"captures": {
50-
"1": {
51-
"name": "entity.name.function.samfile"
52-
},
53-
"2": {
54-
"name": "punctuation.separator.key-value.samfile"
55-
}
56-
}
57-
},
58-
{
59-
"match": "^([A-Za-z0-9_.-]+)\\s*:\\s*(.*)$",
60-
"captures": {
61-
"2": {
62-
"name": "variable.parameter.samfile"
63-
}
64-
}
34+
"name": "entity.name.function.samfile",
35+
"match": "^[A-Za-z0-9_-]+(?=:)"
6536
}
6637
]
6738
},
68-
6939
"commands": {
7040
"patterns": [
71-
72-
{
73-
"match": "^\\s+(run)\\b",
74-
"name": "keyword.control.samfile"
75-
},
76-
77-
{
78-
"match": "^\\s+(cd)\\b",
79-
"name": "keyword.control.samfile"
80-
},
81-
82-
{
83-
"match": "^\\s+(env)\\b",
84-
"name": "keyword.control.samfile"
85-
},
86-
87-
{
88-
"match": "(?<=run\\s)[A-Za-z0-9_./-]+",
89-
"name": "support.function.samfile"
90-
},
91-
9241
{
93-
"match": "\\b([A-Za-z_][A-Za-z0-9_]*)=",
94-
"captures": {
95-
"1": {
96-
"name": "variable.other.constant.samfile"
97-
}
98-
}
42+
"name": "keyword.control.samfile",
43+
"match": "\\b(RUN|SHELL|SHELLWIN|RM|MV|CP|ECHO|echo|PROMPT|CD|MKDIR|RMDIR)\\b"
9944
}
10045
]
10146
},
102-
10347
"strings": {
10448
"patterns": [
10549
{
50+
"name": "string.quoted.double.samfile",
10651
"begin": "\"",
107-
"end": "\"",
108-
"name": "string.quoted.double.samfile"
52+
"end": "\""
10953
},
11054
{
111-
"begin": "'",
112-
"end": "'",
113-
"name": "string.quoted.single.samfile"
55+
"name": "string.unquoted.filename.samfile",
56+
"match": "\\b[\\w./-]+\\.(html|cpp|c|hpp|h|js|ts|json|wasm|data|png|jpg|txt|bat|exe)\\b"
11457
}
11558
]
11659
},
117-
118-
"numbers": {
60+
"urls": {
11961
"patterns": [
12062
{
121-
"match": "\\b\\d+\\b",
122-
"name": "constant.numeric.samfile"
63+
"name": "markup.underline.link.samfile",
64+
"match": "https?://[^\\s]+"
12365
}
12466
]
12567
}
12668
}
127-
}
69+
}

0 commit comments

Comments
 (0)