diff --git a/demo/testcode.css b/demo/testcode.css index 8aacf00..a38738d 100644 --- a/demo/testcode.css +++ b/demo/testcode.css @@ -1,7 +1,74 @@ -/*! - Theme: Monokai - Author: Wimer Hazenberg (http://www.monokai.nl) - License: ~ MIT (or more permissive) [via base16-schemes-source] - Maintainer: @highlightjs/core-team - Version: 2021.09.0 -*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#f8f8f2;background:#272822}.hljs ::selection,.hljs::selection{background-color:#49483e;color:#f8f8f2}.hljs-comment{color:#75715e}.hljs-tag{color:#a59f85}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#f8f8f2}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#f92672}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#fd971f}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#f4bf75}.hljs-strong{font-weight:700;color:#f4bf75}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#a6e22e}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#a1efe4}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#66d9ef}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#ae81ff}.hljs-emphasis{color:#ae81ff;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#c63}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file +/* + +Atom One Dark With support for ReasonML by Gidi Morris, based off work by Daniel Gamage + +Original One Dark Syntax theme from https://github.com/atom/one-dark-syntax + +*/ +.hljs { + color: #abb2bf; + background: #282c34; +} +.hljs-keyword, .hljs-operator { + color: #F92672; +} +.hljs-pattern-match { + color: #F92672; +} +.hljs-pattern-match .hljs-constructor { + color: #61aeee; +} +.hljs-function { + color: #61aeee; +} +.hljs-function .hljs-params { + color: #A6E22E; +} +.hljs-function .hljs-params .hljs-typing { + color: #FD971F; +} +.hljs-module-access .hljs-module { + color: #7e57c2; +} +.hljs-constructor { + color: #e2b93d; +} +.hljs-constructor .hljs-string { + color: #9CCC65; +} +.hljs-comment, .hljs-quote { + color: #b18eb1; + font-style: italic; +} +.hljs-doctag, .hljs-formula { + color: #c678dd; +} +.hljs-section, .hljs-name, .hljs-selector-tag, .hljs-deletion, .hljs-subst { + color: #e06c75; +} +.hljs-literal { + color: #56b6c2; +} +.hljs-string, .hljs-regexp, .hljs-addition, .hljs-attribute, .hljs-meta .hljs-string { + color: #98c379; +} +.hljs-built_in, +.hljs-title.class_, +.hljs-class .hljs-title { + color: #e6c07b; +} +.hljs-attr, .hljs-variable, .hljs-template-variable, .hljs-type, .hljs-selector-class, .hljs-selector-attr, .hljs-selector-pseudo, .hljs-number { + color: #d19a66; +} +.hljs-symbol, .hljs-bullet, .hljs-link, .hljs-meta, .hljs-selector-id, .hljs-title { + color: #61aeee; +} +.hljs-emphasis { + font-style: italic; +} +.hljs-strong { + font-weight: bold; +} +.hljs-link { + text-decoration: underline; +} diff --git a/demo/testcode.html b/demo/testcode.html index 4b5b8a4..cda794b 100644 --- a/demo/testcode.html +++ b/demo/testcode.html @@ -9,6 +9,7 @@ @@ -20,8 +21,8 @@ -
-
+
+
List<SObject> mylist = [SELECT Name, StreetAddress__c, COUNT(),
(SELECT Id FROM Contacts)
FROM Warehouse__c.Contacts__r
@@ -30,10 +31,16 @@
ORDER BY DISTANCE(Location__c, GEOLOCATION(37.775,-122.418), 'mi')
LIMIT 10];
+ delete myAccount;
+ delete [SELECT Id FROM Account];
+
+ Integer myInt = 8 - 7++;
+
+ public List myString { get; set; }
+
List<Opportunity> opps = [SELECT Id FROM Opportunity WHERE Id NOT IN :newRecordsMap.keySet()];
- String queryText =
- 'SELECT Id, Name, AccountId, FirstName, LastName, mailingstreet, mailingcity, mailingstate, mailingpostalcode, mailingcountry, ' +
+ String queryText = 'SELECT Id, Name, AccountId, FirstName, LastName, mailingstreet, mailingcity, mailingstate, mailingpostalcode, mailingcountry, ' +
'otherstreet, othercity, otherstate, otherpostalcode, othercountry, mailinglatitude, mailinglongitude, otherlatitude, otherlongitude ' +
'FROM Contact WHERE AccountId = :acctid ORDER BY ' +
String.escapeSingleQuotes(SortFullExp) +
@@ -41,7 +48,7 @@
String queryText = 'SELECT Id, Name, AccountId, FirstName, LastName, mailingstreet, mailingcity, mailingstate, mailingpostalcode, mailingcountry, '
-------NEW LANGUAGE----------
-
+
@IsTest
private without sharing class myTestClass {
myMap?.get('Id');
@@ -52,7 +59,7 @@
-------NEW LANGUAGE----------
- Database.insert(myAccounts, AccessLevel.USER_MODE);
+ Database.insert(myAccounts, false, AccessLevel.USER_MODE);
delete myAccount;
delete [SELECT Id FROM Account];
@@ -64,6 +71,7 @@
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
'This is a string in a comment'
+ @throws DMLException
*/
/**
@@ -552,7 +560,7 @@
}
-------NEW LANGUAGE----------
-
+
/**
* SHOULD BE RECOGNIZED AS JAVA
* @author John Smith
@@ -668,7 +676,7 @@
Boolean ai = (Boolean) false;
System.debug('Should not be called');
if (1 > 5) { // wtf!?
- Database.insert(myAccounts, AccessLevel.USER_MODE);
+ Database.insert(myAccounts, true, AccessLevel.USER_MODE);
}
}
@@ -699,7 +707,7 @@
trigger CTrig on Custom__c (before insert){
System.debug('inserting a record');
upsert myRecord__c;
- Database.upsert(myRecord__c, AccessLevel.USER_MODE);
+ Database.upsert(myRecord__c, false, AccessLevel.USER_MODE);
}
diff --git a/dist/apex.es.min.js b/dist/apex.es.min.js
index d2af04a..c300d6f 100644
--- a/dist/apex.es.min.js
+++ b/dist/apex.es.min.js
@@ -1,104 +1,102 @@
/*! `apex` grammar compiled for Highlight.js 11.9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b\d+(\.\d*)?|\.\d+)([eE][-+]?\d+)?)/),
relevance:0
-},s=["cast","default","export","try","catch","finally","get","set","put","if","for","else","do","while","continue","break","return","throw","when"],i={
+},s=["cast","default","export","try","catch","finally","get","set","put","if","for","else","do","while","continue","break","implements","extends","return","throw","when"],o={
match:t.concat(/(?)/,/(--)/,/(\!|&&|\|\|)/,/(\*=|\/=|%=|\+=|-=)/,/(\&=|\^=|<<=|>>=|\|=)/,/(\&|~|\^|\|)/,/(\+\+)/,/(%[^%]|\*[^\/]|\/[^\/\*]|-|\+)/,/(<<|>>)/,/(<=|>=|\s(<|>)\s)/,/(==|!=)/,/=>/,/(!(?=\w))/,/(\&\&)/,/((?<=\s)(\?|:)(?=\s))/,/(\?\.)/,/(?)/,/--/,/\+\+/,/&&|\|\|/,/\*=|\/=|%=|\+=|-=/,/\&=|\^=|<<=|>>=|>>>=|\|=/,/\&|~|\^|\|/,/%[^%]|\*[^\/]|\/[^\/\*]|(?>/,/<=|>=|\s(<|>)\s/,/==|!=/,/=>/,/!(?=\w)/,/\&\&/,/(?<=\s)(\?|:)(?=\s)/,/\?\./,/(?+/,
-endScope:"punctuation",contains:[{match:/,scope:"punctuation"},A,{
+endScope:"punctuation",contains:[{match:/,scope:"punctuation"},E,{
match:t.concat(/\b/,a,/\b/),scope:"type"}],relevance:10},{match:[a,/\s*\[\]/],
-scope:{1:"type",2:"punctuation"},contains:[A]}],R=[{
-match:[a,/\s+/,a,/(?=\s*=)/],scope:{1:"type",3:"variable assigned"},relevance:0,
-contains:[A,S]},{match:[a,/\s+/,a,/\s+/,";"],scope:{1:"type",3:"variable"},
-relevance:0,contains:[A,S]},{match:[/\s+/,a,/\s+/,/(?==)/],scope:{
-2:"variable mynum"},relevance:0,contains:[A,S]},{
-match:[/(?<==)\s*/,/\(/,a,/\)/],scope:{2:"punctuation",3:"type",4:"punctuation"
-},contains:[A,S]}],O={
-match:[/(?)/),scope:"title.class.inherited"
-},{match:t.concat(/\b/,t.either(...p),/\b\s*(?!<>)/),scope:"built_in"},{
-match:[/\b/,a,/\./,a,/(?=[,\s<])/],scope:{2:"built_in",4:"title.class.inherited"
-}},{match:[/\b/,a,/(?=>)/],scope:{2:"type"}},{match:t.concat(/\b/,a,/\b(?!<)/),
-scope:"title.class.inherited"}]}]},U=[C,{relevance:10,
-match:/\b(with|without|inherited)\s+sharing\b/,scope:"keyword"},L,{
-begin:[/\benum\s+/,a,/\s*/,/\{/],beginScope:{1:"type",2:"type",4:"punctuation"},
-end:/[\}\n]/,endScope:"punctuation",scope:"enum_declaration",relevance:0,
-contains:[E,g,A,{match:t.concat(/\b/,a,/\b/),scope:"variable.constant"}]
-}].concat(M),w=[{match:[/(?<=\breturn\b)\s+/,t.either(o),/(?=\s*;)/],scope:{
-2:"literal"}},{match:[/(?<=return)/,/\s+/,a,/(?=\s*;)/],scope:{3:"variable"}},{
-match:[/(?<=return)/,/\s+/,t.lookahead(a+/\(/)],scope:{2:"title.function.invoke"
-}}],f={begin:[/\[/,/\s*/,/\b(SELECT|FIND)\b/],beginScope:{1:"punctuation",
-3:"keyword soql"},end:/\]/,scope:"soql",relevance:10,contains:[{
+scope:"built_in"}]}]},M={beginKeywords:"class",returnBegin:!0,end:/\{/,
+endScope:"punctuation",returnEnd:!0,scope:"class_declaration",keywords:{type:r,
+keyword:s},contains:[{match:[/(?<=\bclass\b)\s+/,a],scope:{2:"title.class"}},{
+returnEnd:!0,endsWithParent:!0,variants:[{beginKeywords:"implements",
+end:/(\b(extends)\b)|\{/,scope:"implements block"},{beginKeywords:"extends",
+end:/(\b(implements)\b)|\{/,scope:"extends block"}],contains:[{match:/\<|\>/,
+scope:"punctuation"},{match:t.concat(/\b/,t.either(...p),/\b\s*(?!<>)/),
+scope:"built_in"},{match:[/\b/,a,/\./,a,/(?=[,\s<])/],scope:{2:"built_in",
+4:"title.class.inherited"}},{match:[/\b/,a,/(?=>)/],scope:{2:"type"}},{
+match:t.concat(/\b/,a,/\b(?!<)/),scope:"title.class.inherited"},{
+match:t.concat(/\b/,t.either(...b),/\b\s*(?!>)/),scope:"title.class.inherited"}]
+}]},U=[L,{relevance:10,match:/\b(with|without|inherited)\s+sharing\b/,
+scope:"keyword"},C,{begin:[/\benum\s+/,a,/\s*/,/\{/],beginScope:{1:"type",
+2:"type"},end:/[\}\n]/,returnEnd:!0,scope:"enum_declaration",relevance:0,
+contains:[g,T,E,{match:t.concat(/\b/,a,/\b/),scope:"variable.constant"}]
+},M].concat(N),w=[{match:[/(?<=\breturn\b)\s+/,t.either(i),/(?=\s*;)/],scope:{
+2:"literal"}},{match:[/(?<=\breturn\b)/,/\s+/,a,/(?=\s*;)/],scope:{3:"variable"}
+},{match:[/(?<=\breturn\b)/,/\s+/,t.lookahead(a+/\(/)],scope:{
+2:"title.function.invoke"}}],f={begin:[/\[/,/\s*/,/\b(SELECT|FIND)\b/],
+beginScope:{1:"punctuation",3:"keyword soql"},end:/\]/,
+endScope:"punctuation outer",scope:"soql",relevance:10,contains:[{
begin:[/\bFROM\b/,t.concat(/\s+/,a,/\b/)],beginScope:{1:"keyword",2:"type"},
scope:"from_clause",end:/(?=\]|\s)/,contains:[{match:[/(?<=\.)/,a,/\b/],scope:{
-2:"type"}},A]},{match:/\]/,scope:"punctuation",endsParent:!0},{
+2:"type"}},E]},{match:/\]/,scope:"punctuation",endsParent:!0},{
match:/\b\s*IN|=\s*:/,scope:"operator"},{
begin:t.concat(/\b/,t.either("ABOVE_OR_BELOW","ACTIVE","ADVANCED","ALL","ANY","ARRAY","AS","BY","CATEGORY","CONTAINS","CUSTOM","DATA","DIVISION","END","FIELDS","FIND","FROM","LAST","METADATA","NETWORK","ON","RETURNING","ROLLUP","ROWS","SEARCH","SELECT","SNIPPET","SORT","STANDARD","USER_MODE","WHERE",/USING\s+SCOPE\s*(Delegated|Everything|Mine|My_Territory|My_Team_Territory|Team)/,/WITH\s+SECURITY_ENFORCED/),/\b/),
scope:"keyword soql",relevance:0},{
@@ -112,22 +110,23 @@ match:/(NEXT|LAST|THIS)_(90_DAY|DAY|FISCAL_QUARTER|FISCAL_YEAR|MONTH|QUARTER|WEE
scope:"variable.language",relevance:10},{
match:[/(NEXT|LAST)_N_(DAY|FISCAL_QUARTER|FISCAL_YEAR|MONTH|QUARTER|WEEK|YEAR)S/,/\s*:\s*/,/\d+/],
scope:{1:"variable.language",2:"operator",3:"number"},relevance:10},{
-match:[/(?<=:)/,/\s*/,a],scope:{3:"variable"}},c,I,S,A,e.APOS_STRING_MODE],
-illegal:"::"},k={begin:[/\bfor\b/,/\s*\(/,a,/\s+/,a,/\s*:/],beginScope:{
-2:"punctuation",3:"type",5:"variable",6:"operator"},end:"{",contains:[E,g,f]}
+match:[/(?<=:)/,/\s*/,a],scope:{3:"variable"}},c,I,A,E,e.APOS_STRING_MODE],
+illegal:"::"},k={begin:[/\bfor\b\s*/,/\(/,a,/\s+/,a,/\s*:/],beginScope:{
+2:"punctuation",3:"type",5:"variable for",6:"operator"},scope:"for_loop",
+end:/\)\s*\{/,endScope:"punctuation",contains:[g,T,f,I,{
+match:t.concat(a,/\b(?!\()/),scope:"variable"}],METHOD_CALL:I,PUNCTUATION:E}
;return{name:"Apex",aliases:["apex","lightning","soql"],case_insensitive:!0,
disableAutodetect:!1,ignoreIllegals:!1,keywords:{$pattern:a,keyword:s,
-"variable.language":["instanceof","new","super","this"],built_in:l,type:r,
-literal:o,classNameAliases:{soql:"subst"}},
-illegal:["","<#","<]","","\x3c!--","!DOCTYPE",/