Skip to content

Commit 398ccc4

Browse files
committed
feat: Add basic psqlrc syntax highlighting
1 parent e2495bd commit 398ccc4

File tree

5 files changed

+50
-3
lines changed

5 files changed

+50
-3
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"comments": {
3+
"lineComment": "--"
4+
}
5+
}

package.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@
336336
"ignore"
337337
],
338338
"extensions": [
339+
".agignore",
339340
".mignore",
340341
".cvsignore",
341342
".chefignore",
@@ -590,6 +591,16 @@
590591
"Protocol Buffers"
591592
]
592593
},
594+
{
595+
"id": "psqlrc",
596+
"extensions": [
597+
".psqlrc"
598+
],
599+
"filenames": [
600+
"psqlrc.conf"
601+
],
602+
"configuration": "./language-configuration/psqlrc.language-configuration.json"
603+
},
593604
{
594605
"id": "pbxproj",
595606
"aliases": [
@@ -1111,6 +1122,11 @@
11111122
"scopeName": "source.proto",
11121123
"path": "./syntaxes/proto3.tmLanguage.json"
11131124
},
1125+
{
1126+
"language": "psqlrc",
1127+
"scopeName": "source.psqlrc",
1128+
"path": "./syntaxes/psqlrc.tmLanguage.json"
1129+
},
11141130
{
11151131
"scopeName": "markdown.codeblock.proto",
11161132
"path": "./syntaxes/proto3.codeblock.tmLanguage.json",

syntaxes/digrc.tmLanguage.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
"patterns": [
66
{
77
"include": "#comment"
8-
},
9-
{
10-
"include": "#option"
118
}
129
],
1310
"repository": {

syntaxes/psqlrc.tmLanguage.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"$schema": "https://json.schemastore.org/tmLanguage.json",
3+
"name": "psqlrc",
4+
"scopeName": "source.psqlrc",
5+
"patterns": [
6+
{
7+
"include": "#comment"
8+
}
9+
],
10+
"repository": {
11+
"comment": {
12+
"patterns": [
13+
{
14+
"name": "comment.line.number-sign",
15+
"begin": "^\\s*--.*",
16+
"end": "\\n"
17+
}
18+
]
19+
}
20+
}
21+
}

testdata/1.psqlrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
\set COMP_KEYWORD_CASE upper
2+
3+
\x auto
4+
5+
\pset null '[null]'
6+
7+
-- Display timings
8+
\timing

0 commit comments

Comments
 (0)