Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

function calls with color like standard sql highlighter #5

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion PostgreSQL.YAML-tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ repository:
- include: '#misc'
- include: '#vars'
- include: '#proc'
- include: '#calls'

statement_create_other:
name: meta.statement.create.pgsql
Expand All @@ -67,6 +68,7 @@ repository:
- include: '#strings'
- include: '#keywords'
- include: '#misc'
- include: '#calls'

statement_commands:
name: meta.statement.pgsql
Expand All @@ -80,6 +82,7 @@ repository:
- include: '#strings'
- include: '#keywords'
- include: '#misc'
- include: '#calls'

dollar_quotes:
patterns:
Expand All @@ -106,6 +109,7 @@ repository:
- include: '#misc'
- include: '#vars'
- include: '#proc'
- include: '#calls'

keywords:
patterns:
Expand Down Expand Up @@ -163,7 +167,13 @@ repository:
match: (?i)\b([-a-z0-9_.]+%(row)?type)\b
- name: variable.parameter.pgsql
match: \$\d+


calls:
patterns:
- name: constant.other.pgsql
comment: schema.function calls
match: (?i)\b([-\w_]*\.?[-\w_]+\b\s*(?=\())

string_escape:
name: constant.character.escape.pgsql
match: \\.
Expand Down
30 changes: 30 additions & 0 deletions PostgreSQL.tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,20 @@
</array>
<key>repository</key>
<dict>
<key>calls</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>comment</key>
<string>schema.function calls</string>
<key>match</key>
<string>(?i)\b([-\w_]*\.?[-\w_]+\b\s*(?=\())</string>
<key>name</key>
<string>constant.other.pgsql</string>
</dict>
</array>
</dict>
<key>comments</key>
<dict>
<key>patterns</key>
Expand Down Expand Up @@ -158,6 +172,10 @@
<key>include</key>
<string>#proc</string>
</dict>
<dict>
<key>include</key>
<string>#calls</string>
</dict>
</array>
</dict>
</array>
Expand Down Expand Up @@ -374,6 +392,10 @@
<key>include</key>
<string>#misc</string>
</dict>
<dict>
<key>include</key>
<string>#calls</string>
</dict>
</array>
</dict>
<key>statement_create_function_view</key>
Expand Down Expand Up @@ -442,6 +464,10 @@
<key>include</key>
<string>#proc</string>
</dict>
<dict>
<key>include</key>
<string>#calls</string>
</dict>
</array>
</dict>
<key>statement_create_other</key>
Expand Down Expand Up @@ -497,6 +523,10 @@
<key>include</key>
<string>#misc</string>
</dict>
<dict>
<key>include</key>
<string>#calls</string>
</dict>
</array>
</dict>
<key>string_escape</key>
Expand Down