Skip to content

Commit

Permalink
Manually adding syntaxes to fix highlighting
Browse files Browse the repository at this point in the history
Defining `extra_syntaxes` in the config causes default syntaxes to stop
working, see getzola/zola#1309. Fixed
temporarily by copying in the syntax files I use, will revert on a new
release from Zola.
  • Loading branch information
thezeroalpha committed Jun 9, 2021
1 parent e63763c commit 904682d
Show file tree
Hide file tree
Showing 168 changed files with 22,711 additions and 0 deletions.
694 changes: 694 additions & 0 deletions syntaxes/ASP/ASP.sublime-syntax

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions syntaxes/ASP/Comments.tmPreferences
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>name</key>
<string>Comments</string>
<key>scope</key>
<string>source.asp</string>
<key>settings</key>
<dict>
<key>shellVariables</key>
<array>
<dict>
<key>name</key>
<string>TM_COMMENT_START</string>
<key>value</key>
<string>' </string>
</dict>
</array>
</dict>
</dict>
</plist>
60 changes: 60 additions & 0 deletions syntaxes/ASP/HTML-ASP.sublime-syntax
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: HTML (ASP)
file_extensions:
- asp
scope: text.html.asp
contexts:
main:
- include: html

asp_punctuation_begin:
- match: '<%'
scope: punctuation.section.embedded.begin.asp
push:
- match: '@' # https://msdn.microsoft.com/en-us/library/ms525579%28v=vs.90%29.aspx
set: asp_directive
- match: '='
scope: punctuation.section.embedded.begin.asp
set: [close_embedded_asp, begin_embedded_asp_expression]
- match: '(?=\S)'
set: [close_embedded_asp, begin_embedded_asp]
asp_directive:
- match: '@?\s*\b((?i:ENABLESESSIONSTATE|LANGUAGE|LCID|TRANSACTION))\b'
captures:
1: constant.language.processing-directive.asp
push:
- match: '\s*(=)\s*'
scope: punctuation.separator.key-value.asp
pop: true
- match: '(?=%>)'
pop: true
- match: '%>'
scope: punctuation.section.embedded.end.asp
pop: true

html:
- match: ''
set:
- include: scope:text.html.basic
with_prototype:
- include: asp_punctuation_begin

begin_embedded_asp:
- meta_content_scope: source.asp.embedded.html
- match: '(?=%>)'
pop: true
- include: scope:source.asp

begin_embedded_asp_expression:
- meta_content_scope: source.asp.embedded.html
- match: '(?=%>)'
pop: true
- include: scope:source.asp#expression

close_embedded_asp:
- match: '%>'
scope: punctuation.section.embedded.end.asp
pop: true
20 changes: 20 additions & 0 deletions syntaxes/ASP/Indentation Rules.tmPreferences
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>name</key>
<string>Indentation Rules</string>
<key>scope</key>
<string>source.asp - comment</string>
<key>settings</key>
<dict>
<key>decreaseIndentPattern</key>
<string>^\s*(?i:end|else|elseif|loop|wend|next)(\s|$)</string>
<key>increaseIndentPattern</key>
<string>(?x)(^\s*(
((?i:private|public(?!\s+default))\s+)?(?i:function|sub|property)\s
|
(?i:class|if|select\s+case|with|do|for|while)\s
))</string>
</dict>
</dict>
</plist>
14 changes: 14 additions & 0 deletions syntaxes/ASP/Indexed Symbol List.tmPreferences
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>name</key>
<string>Symbol List</string>
<key>scope</key>
<string>source.asp entity.name.class.asp, source.asp entity.name.method.asp</string>
<key>settings</key>
<dict>
<key>showInIndexedSymbolList</key>
<integer>1</integer>
</dict>
</dict>
</plist>
22 changes: 22 additions & 0 deletions syntaxes/ASP/Symbol List.tmPreferences
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>name</key>
<string>Symbol List</string>
<key>scope</key>
<string>source.asp meta.class.identifier.asp, source.asp meta.method.identifier.asp</string>
<key>settings</key>
<dict>
<key>showInSymbolList</key>
<integer>1</integer>
<key>symbolTransformation</key>
<string><![CDATA[
s/(\[[^\]]*\])|\b_\b\s*|\(.*|(\s{2,})/$1(?2 )/g; (?# this ignores anything in square brackets, and:
- finds an underscore line continuation character and any whitespace following it, and replaces it with nothing
- finds an open paren and anything following it, and replaces it with nothing
- collapses multiple spaces into one
We don't have to worry about comments, because they are not allowed after an underscore.)
]]></string>
</dict>
</dict>
</plist>
Loading

0 comments on commit 904682d

Please sign in to comment.