From 8dc370e63c362901583e17ddafc6bf1e0759bb56 Mon Sep 17 00:00:00 2001 From: David Schach Date: Tue, 24 Oct 2023 16:15:04 -0700 Subject: [PATCH] looks good --- demo/testcode.css | 81 ++------------- demo/testcode.html | 20 ++-- dist/apex.es.min.js | 164 ++++++++++++++++-------------- dist/apex.min.js | 162 +++++++++++++++-------------- src/languages/apex.js | 230 +++++++++++++++++++++++++++--------------- 5 files changed, 341 insertions(+), 316 deletions(-) diff --git a/demo/testcode.css b/demo/testcode.css index 8e3b99d..8aacf00 100644 --- a/demo/testcode.css +++ b/demo/testcode.css @@ -1,74 +1,7 @@ -/* -Monokai style - ported by Luigi Maselli - http://grigio.org -*/ -body { - background: #272822; -} -.hljs { - background: #272822; - color: #ddd; -} - -.hljs-tag, -.hljs-keyword, -.hljs-selector-tag, -.hljs-literal, -.hljs-strong, -.hljs-name { - color: #f92672; -} - -.hljs-code { - color: #66d9ef; -} - -.hljs-attribute, -.hljs-symbol, -.hljs-regexp, -.hljs-link { - color: #bf79db; -} - -.hljs-operator { - color: yellow; -} - -.hljs-string, -.hljs-bullet, -.hljs-subst, -.hljs-title, -.hljs-section, -.hljs-emphasis, -.hljs-type, -.hljs-built_in, -.hljs-selector-attr, -.hljs-selector-pseudo, -.hljs-addition, -.hljs-variable, -.hljs-template-tag, -.hljs-template-variable { - color: #a6e22e; -} - -.hljs-title.class_, -.hljs-class .hljs-title { - color: white; -} - -.hljs-comment, -.hljs-quote, -.hljs-deletion, -.hljs-meta { - color: #75715e; -} - -.hljs-keyword, -.hljs-selector-tag, -.hljs-literal, -.hljs-doctag, -.hljs-title, -.hljs-section, -.hljs-type, -.hljs-selector-id { - font-weight: bold; -} +/*! + 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 diff --git a/demo/testcode.html b/demo/testcode.html index 514065e..4b5b8a4 100644 --- a/demo/testcode.html +++ b/demo/testcode.html @@ -31,6 +31,14 @@ LIMIT 10]; 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, ' + + 'otherstreet, othercity, otherstate, otherpostalcode, othercountry, mailinglatitude, mailinglongitude, otherlatitude, otherlongitude ' + + 'FROM Contact WHERE AccountId = :acctid ORDER BY ' + + String.escapeSingleQuotes(SortFullExp) + + ' NULLS LAST LIMIT 1000'; + String queryText = 'SELECT Id, Name, AccountId, FirstName, LastName, mailingstreet, mailingcity, mailingstate, mailingpostalcode, mailingcountry, '

-------NEW LANGUAGE----------


@@ -38,6 +46,8 @@
       private without sharing class myTestClass {
         myMap?.get('Id');
       }
+      System.URL.getCurrentRequestUrl();
+      System.getCurrentRequestUrl();
     

-------NEW LANGUAGE----------


@@ -46,6 +56,8 @@
     delete myAccount;
     delete [SELECT Id FROM Account];
 
+    public String myString { get; set; }
+
     /*
     Copyright (c) 2022, salesforce.com, inc.
     All rights reserved.
@@ -103,14 +115,6 @@
     
         String retURL = '/' + ActionPlansUtilities.getObjectKeyPrefix(ActionPlansUtilities.namespacePrefix + 'ActionPlan__c') + '/o';
     
-        String hasTemplateIdParam = ApexPages.currentPage().getParameters().containsKey('templateId');
-        Boolean hasRetURLParam = ApexPages.currentPage().getParameters().containsKey('retURL');
-    
-        if (hasTemplateIdParam && true) {
-          retURL = '/' + ActionPlansUtilities.getEscapedPageParameter('templateId');
-        } else if (hasRetURLParam && !ActionPlansUtilities.getIsLex()) {
-          retURL = '' + ActionPlansUtilities.getEscapedPageParameter('retURL');
-        }
         Pagereference newPage = new PageReference('' + retURL);
         newPage.setRedirect(true);
     
diff --git a/dist/apex.es.min.js b/dist/apex.es.min.js
index 4ffbffa..085ec5e 100644
--- a/dist/apex.es.min.js
+++ b/dist/apex.es.min.js
@@ -1,96 +1,109 @@
 /*! `apex` grammar compiled for Highlight.js 11.9.0 */
 var hljsGrammar=(()=>{"use strict";return e=>{
-const t=e.regex,a="[a-zA-Z][a-zA-Z_0-9]*",c="@"+a,n={scope:"number",
+const t=e.regex,a="[a-zA-Z][a-zA-Z_0-9]*",n="@"+a,c={scope:"number",
 match:t.either(/\b(\d{4}\-\d{2}\-\d{2}T\d{2}\:\d{2}\:\d{2}(\.\d{1,3})?(\-|\+)\d{2}\:\d{2})\b/,/\b(\d{4}\-\d{2}\-\d{2}T\d{2}\:\d{2}\:\d{2}(\.\d{1,3})?(Z)?)\b/,/\b(\d{4}\-\d{2}\-\d{2})\b/,/\b0(x|X)[0-9a-fA-F_]+(U|u|L|l|UL|Ul|uL|ul|LU|Lu|lU|lu)?\b/,/\b0(b|B)[01_]+(U|u|L|l|UL|Ul|uL|ul|LU|Lu|lU|lu)?\b/,/\b([0-9_]+)?\.[0-9_]+((e|E)[0-9]+)?(F|f|D|d|M|m)?\b/,/\b[0-9_]+(e|E)[0-9_]+(F|f|D|d|M|m)?\b/,/\b[0-9_]+(F|f|D|d|M|m)\b/,/\b[0-9_]+(U|u|L|l|UL|Ul|uL|ul|LU|Lu|lU|lu)?\b/),
 relevance:0
 },s=["cast","default","export","try","catch","finally","get","set","put","if","for","else","do","while","continue","break","return","throw","when"],i={
 match:t.concat(/(?>/,/>=|<=/,/\s<\s|\s>\s/,/\^/,/==|!=|!/,/\\&|~|\^|\|/,/\&\&/,/\&/,/\|\|/,/\|/,/(?<=\s)\?|:(?=\s)/,/=/,/\?\./,/(?)/,/(--)/,/(\!|&&|\|\|)/,/(\*=|\/=|%=|\+=|-=)/,/(\&=|\^=|<<=|>>=|\|=)/,/(\&|~|\^|\|)/,/(\+\+)/,/(\=)/,/(%[^%]|\*[^\/]|\/[^\/\*]|-|\+)/,/(<<|>>)/,/(<=|>=|\s(<|>)\s)/,/(==|!=)/,/(=>)/,/(!(?=\w))/,/(\&\&)/,/((?<=\s)(\?|:)(?=\s))/,/(\?\.)/,/(?+/,
-endScope:"punctuation",contains:[{match://],scope:{2:"type",3:"punctuation"}},{
-match:t.concat(/\b/,a,/(?=[,\s<])/),scope:{2:"title.class.inherited"}},{
-match:[/\b/,a,/\./,a,/(?=[,\s<])/],scope:{1:"built_in",3:"title.class.inherited"
-}}]},C=[I,{relevance:10,match:/\b(with|without|inherited)\s+sharing\b/,
-scope:"keyword"},D,{begin:[/\b(?<=enum)\s+/,a,/\s*/,/[{()]/],beginScope:{
-2:"type",4:"punctuation"},end:/[})]/,endScope:"punctuation",relevance:0,
-contains:[A,E,{match:t.concat(/\b/,a,/\b/),scope:"variable.constant"}]
-}].concat(L),M=[{match:[/(?<=\breturn\b)\s+/,t.either(o),/(?=\s*;)/],scope:{
+scope:"built_in"}]}]},M={begin:[/\bclass\b/,/\s+/,a],beginScope:{1:"keyword",
+3:"title.class"},end:/\{/,returnEnd:!0,scope:"class-declaration",keywords:{
+type:r,keyword:["extends","implements"]},contains:[{variants:[{
+begin:/\b(implements)\b/,beginScope:"keyword",end:/\b(extends)\b/},{
+begin:/\b(extends)\b/,beginScope:"keyword",end:/\b(implements)\b/},{end:/\{/,
+endScope:"punctuation",endsParent:!0}],endsWithParent:!0,contains:[{
+match:t.concat(/\b/,t.either(...l),/\b\s*(?!>)/),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"
-}}],U={begin:[/\[/,/\s*/,/\b(SELECT|FIND)\b/],beginScope:{1:"punctuation",
+}}],f={begin:[/\[/,/\s*/,/\b(SELECT|FIND)\b/],beginScope:{1:"punctuation",
 3:"keyword for 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"}},S]},{match:/\]/,scope:"punctuation",
-endsParent:!0},{match:/IN|=\s*:/,scope:"operator"},{
+match:[/(?<=\.)/,a,/\b/],scope:{2:"type"}},A]},{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",relevance:0},{
 match:t.concat(/\b/,t.either("ABOVE","AND","ASC","AT","DESC","HAVING","IN","LIKE","LIMIT","LISTVIEW","NOT","OFFSET","OR","TRACKING","TYPEOF","UPDATE","VIEWSTAT",/FOR\s+REFERENCE/,/FOR\s+UPDATE/,/FOR\s+VIEW/,/GROUP\s+BY/,/NOT\s+IN/,/NULLS\s+(FIRST|LAST)/,/ORDER\s+BY/,/WITH/,/DATA\s+CATEGORY/,/WITH\s+PricebookId/),/\b/),
-scope:"operator",relevance:0},{
+scope:"operator soql",relevance:0},{
 match:t.concat(/\b/,t.either("AVG","convertCurrency","convertTimezone","COUNT_DISTINCT","COUNT","DAY_IN_MONTH","DAY_IN_WEEK","DAY_IN_YEAR","DAY_ONLY","DISTANCE","EXCLUDES","FORMAT","GEOLOCATION","GROUP BY CUBE","GROUP BY ROLLUP","GROUPING","HOUR_IN_DAY","INCLUDES","MAX","MIN","SUM","toLabel","WEEK_IN_MONTH","WEEK_IN_YEAR"),/\b/),
 scope:"title.function.invoke"},{
 match:t.concat(/\b/,t.either("CALENDAR_MONTH","CALENDAR_QUARTER","CALENDAR_YEAR","FISCAL_MONTH","FISCAL_QUARTER","FISCAL_YEAR","TODAY","TOMORROW","YESTERDAY"),/\b/),
@@ -99,23 +112,22 @@ 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"}},n,y,h,S,e.APOS_STRING_MODE],
-illegal:"::"},f={begin:[/\bfor\b/,/\s*\(/,a,/\s+/,a,/\s*:/],beginScope:{
-2:"punctuation",3:"type",5:"variable",6:"punctuation"},end:"{",contains:[A,E,U]}
-;return{name:"Apex",aliases:["apex","lightning"],case_insensitive:!0,
+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]}
+;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:r,
-type:["anytype|0","blob|0","boolean|0","byte|0","currency|0","date|0","datetime|0","decimal|0","double|0","enum|0","float|0","integer|0","long|0","object|0","pagereference|10","selectoption|10","short|0","sobject|10","string|0","time|0","void|0","float|0"],
+"variable.language":["instanceof","new","super","this"],built_in:l,type:r,
 literal:o,classNameAliases:{soql:"subst"}},
-illegal:["","\x3c!--","!DOCTYPE",//,/<%/,"<%#","%%>","<%%"],
-contains:[g,R,v,E,A,_,C,[{
-match:[t.concat(/\b/,t.either(...l),/\b/),/\s*/,a,/(?=;)/],scope:{1:"built_in",
-3:"variable"}},{match:t.concat(/\b/,t.either(...l),/\b/),scope:"built_in"},{
+illegal:["","\x3c!--","!DOCTYPE",/","<%%"],
+contains:[v,_,R,g,E,O,U,[{
+match:[t.concat(/\b/,t.either(...b),/\b/),/\s*/,a,/(?=;)/],scope:{1:"built_in",
+3:"variable"}},{match:t.concat(/\b/,t.either(...b),/\b/),scope:"built_in"},{
 match:[/\s+/,/(?:\bas\s+(user|system)\b\s+)?/,a,t.lookahead(";")],scope:{
-2:"built_in",3:"variable"}},{begin:t.concat(/\b/,t.either(...l),/\b/),
-beginScope:"built_in",scope:"DML",contains:[N,{
-match:[t.concat("(?<=",t.either(l),")"),/\s+/,/(?:\bas\s+(user|system)\b\s+)?/,a,t.lookahead(";")],
-scope:{3:"built_in",4:"variable"}},{match:t.either(l),scope:"built_in"},S]},{
+2:"built_in",3:"variable"}},{begin:t.concat(/\b/,t.either(...b),/\b/),
+beginScope:"built_in",scope:"DML",contains:[D,{
+match:[t.concat("(?<=",t.either(b),")"),/\s+/,/(?:\bas\s+(user|system)\b\s+)?/,a,t.lookahead(";")],
+scope:{3:"built_in",4:"variable"}},{match:t.either(b),scope:"built_in"},A]},{
 match:["AccessLevel",/\./,/(SYSTEM_MODE|USER_MODE)/],scope:{1:"built_in",
-3:"keyword"}}],T,f,e.APOS_STRING_MODE,N,y,d,n,h,S,M,{match:/(?{var e=(()=>{"use strict";return e=>{
-const t=e.regex,a="[a-zA-Z][a-zA-Z_0-9]*",c="@"+a,n={scope:"number",
+const t=e.regex,a="[a-zA-Z][a-zA-Z_0-9]*",n="@"+a,c={scope:"number",
 match:t.either(/\b(\d{4}\-\d{2}\-\d{2}T\d{2}\:\d{2}\:\d{2}(\.\d{1,3})?(\-|\+)\d{2}\:\d{2})\b/,/\b(\d{4}\-\d{2}\-\d{2}T\d{2}\:\d{2}\:\d{2}(\.\d{1,3})?(Z)?)\b/,/\b(\d{4}\-\d{2}\-\d{2})\b/,/\b0(x|X)[0-9a-fA-F_]+(U|u|L|l|UL|Ul|uL|ul|LU|Lu|lU|lu)?\b/,/\b0(b|B)[01_]+(U|u|L|l|UL|Ul|uL|ul|LU|Lu|lU|lu)?\b/,/\b([0-9_]+)?\.[0-9_]+((e|E)[0-9]+)?(F|f|D|d|M|m)?\b/,/\b[0-9_]+(e|E)[0-9_]+(F|f|D|d|M|m)?\b/,/\b[0-9_]+(F|f|D|d|M|m)\b/,/\b[0-9_]+(U|u|L|l|UL|Ul|uL|ul|LU|Lu|lU|lu)?\b/),
 relevance:0
 },s=["cast","default","export","try","catch","finally","get","set","put","if","for","else","do","while","continue","break","return","throw","when"],i={
 match:t.concat(/(?>/,/>=|<=/,/\s<\s|\s>\s/,/\^/,/==|!=|!/,/\\&|~|\^|\|/,/\&\&/,/\&/,/\|\|/,/\|/,/(?<=\s)\?|:(?=\s)/,/=/,/\?\./,/(?)/,/(--)/,/(\!|&&|\|\|)/,/(\*=|\/=|%=|\+=|-=)/,/(\&=|\^=|<<=|>>=|\|=)/,/(\&|~|\^|\|)/,/(\+\+)/,/(\=)/,/(%[^%]|\*[^\/]|\/[^\/\*]|-|\+)/,/(<<|>>)/,/(<=|>=|\s(<|>)\s)/,/(==|!=)/,/(=>)/,/(!(?=\w))/,/(\&\&)/,/((?<=\s)(\?|:)(?=\s))/,/(\?\.)/,/(?+/,
-endScope:"punctuation",contains:[{match://],scope:{2:"type",3:"punctuation"}},{
-match:t.concat(/\b/,a,/(?=[,\s<])/),scope:{2:"title.class.inherited"}},{
-match:[/\b/,a,/\./,a,/(?=[,\s<])/],scope:{1:"built_in",3:"title.class.inherited"
-}}]},C=[I,{relevance:10,match:/\b(with|without|inherited)\s+sharing\b/,
-scope:"keyword"},D,{begin:[/\b(?<=enum)\s+/,a,/\s*/,/[{()]/],beginScope:{
-2:"type",4:"punctuation"},end:/[})]/,endScope:"punctuation",relevance:0,
-contains:[A,E,{match:t.concat(/\b/,a,/\b/),scope:"variable.constant"}]
-}].concat(L),M=[{match:[/(?<=\breturn\b)\s+/,t.either(o),/(?=\s*;)/],scope:{
+scope:"built_in"}]}]},M={begin:[/\bclass\b/,/\s+/,a],beginScope:{1:"keyword",
+3:"title.class"},end:/\{/,returnEnd:!0,scope:"class-declaration",keywords:{
+type:r,keyword:["extends","implements"]},contains:[{variants:[{
+begin:/\b(implements)\b/,beginScope:"keyword",end:/\b(extends)\b/},{
+begin:/\b(extends)\b/,beginScope:"keyword",end:/\b(implements)\b/},{end:/\{/,
+endScope:"punctuation",endsParent:!0}],endsWithParent:!0,contains:[{
+match:t.concat(/\b/,t.either(...l),/\b\s*(?!>)/),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"},I,{
+begin:[/\benum\s+/,a,/\s*/,/\{/],beginScope:{1:"type",2:"type",4:"punctuation"},
+end:/[\}\n]/,endScope:"punctuation",scope:"enum declaration",relevance:0,
+contains:[g,E,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"
-}}],U={begin:[/\[/,/\s*/,/\b(SELECT|FIND)\b/],beginScope:{1:"punctuation",
+}}],f={begin:[/\[/,/\s*/,/\b(SELECT|FIND)\b/],beginScope:{1:"punctuation",
 3:"keyword for 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"}},S]},{match:/\]/,scope:"punctuation",
-endsParent:!0},{match:/IN|=\s*:/,scope:"operator"},{
+match:[/(?<=\.)/,a,/\b/],scope:{2:"type"}},A]},{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",relevance:0},{
 match:t.concat(/\b/,t.either("ABOVE","AND","ASC","AT","DESC","HAVING","IN","LIKE","LIMIT","LISTVIEW","NOT","OFFSET","OR","TRACKING","TYPEOF","UPDATE","VIEWSTAT",/FOR\s+REFERENCE/,/FOR\s+UPDATE/,/FOR\s+VIEW/,/GROUP\s+BY/,/NOT\s+IN/,/NULLS\s+(FIRST|LAST)/,/ORDER\s+BY/,/WITH/,/DATA\s+CATEGORY/,/WITH\s+PricebookId/),/\b/),
-scope:"operator",relevance:0},{
+scope:"operator soql",relevance:0},{
 match:t.concat(/\b/,t.either("AVG","convertCurrency","convertTimezone","COUNT_DISTINCT","COUNT","DAY_IN_MONTH","DAY_IN_WEEK","DAY_IN_YEAR","DAY_ONLY","DISTANCE","EXCLUDES","FORMAT","GEOLOCATION","GROUP BY CUBE","GROUP BY ROLLUP","GROUPING","HOUR_IN_DAY","INCLUDES","MAX","MIN","SUM","toLabel","WEEK_IN_MONTH","WEEK_IN_YEAR"),/\b/),
 scope:"title.function.invoke"},{
 match:t.concat(/\b/,t.either("CALENDAR_MONTH","CALENDAR_QUARTER","CALENDAR_YEAR","FISCAL_MONTH","FISCAL_QUARTER","FISCAL_YEAR","TODAY","TOMORROW","YESTERDAY"),/\b/),
@@ -99,23 +112,22 @@ 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"}},n,y,h,S,e.APOS_STRING_MODE],
-illegal:"::"},w={begin:[/\bfor\b/,/\s*\(/,a,/\s+/,a,/\s*:/],beginScope:{
-2:"punctuation",3:"type",5:"variable",6:"punctuation"},end:"{",contains:[A,E,U]}
-;return{name:"Apex",aliases:["apex","lightning"],case_insensitive:!0,
+match:[/(?<=:)/,/\s*/,a],scope:{3:"variable"}},c,D,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:[g,E,f]}
+;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:r,
-type:["anytype|0","blob|0","boolean|0","byte|0","currency|0","date|0","datetime|0","decimal|0","double|0","enum|0","float|0","integer|0","long|0","object|0","pagereference|10","selectoption|10","short|0","sobject|10","string|0","time|0","void|0","float|0"],
+"variable.language":["instanceof","new","super","this"],built_in:l,type:r,
 literal:o,classNameAliases:{soql:"subst"}},
-illegal:["","\x3c!--","!DOCTYPE",//,/<%/,"<%#","%%>","<%%"],
-contains:[g,R,v,E,A,_,C,[{
-match:[t.concat(/\b/,t.either(...l),/\b/),/\s*/,a,/(?=;)/],scope:{1:"built_in",
-3:"variable"}},{match:t.concat(/\b/,t.either(...l),/\b/),scope:"built_in"},{
+illegal:["","\x3c!--","!DOCTYPE",/","<%%"],
+contains:[v,_,R,E,g,O,U,[{
+match:[t.concat(/\b/,t.either(...b),/\b/),/\s*/,a,/(?=;)/],scope:{1:"built_in",
+3:"variable"}},{match:t.concat(/\b/,t.either(...b),/\b/),scope:"built_in"},{
 match:[/\s+/,/(?:\bas\s+(user|system)\b\s+)?/,a,t.lookahead(";")],scope:{
-2:"built_in",3:"variable"}},{begin:t.concat(/\b/,t.either(...l),/\b/),
-beginScope:"built_in",scope:"DML",contains:[N,{
-match:[t.concat("(?<=",t.either(l),")"),/\s+/,/(?:\bas\s+(user|system)\b\s+)?/,a,t.lookahead(";")],
-scope:{3:"built_in",4:"variable"}},{match:t.either(l),scope:"built_in"},S]},{
+2:"built_in",3:"variable"}},{begin:t.concat(/\b/,t.either(...b),/\b/),
+beginScope:"built_in",scope:"DML",contains:[L,{
+match:[t.concat("(?<=",t.either(b),")"),/\s+/,/(?:\bas\s+(user|system)\b\s+)?/,a,t.lookahead(";")],
+scope:{3:"built_in",4:"variable"}},{match:t.either(b),scope:"built_in"},A]},{
 match:["AccessLevel",/\./,/(SYSTEM_MODE|USER_MODE)/],scope:{1:"built_in",
-3:"keyword"}}],T,w,e.APOS_STRING_MODE,N,y,d,n,h,S,M,{match:/(?>/,
-    />=|<=/,
-    /\s<\s|\s>\s/,
-    /\^/,
-    /==|!=|!/,
-    /\\&|~|\^|\|/,
-    /\&\&/,
-    /\&/,
-    /\|\|/,
-    /\|/,
-    /(?<=\s)\?|:(?=\s)/, // standalone ? or : (ternary operator?)
-    /=/,
-    /\?\./,
+    //=/,
+    /(?)/,
+
+      /(--)/, // decrement
+      /(\!|&&|\|\|)/, // logical
+      /(\*=|\/=|%=|\+=|-=)/, // assignment.compound
+      /(\&=|\^=|<<=|>>=|\|=)/, // assignment.compound.bitwise
+      /(\&|~|\^|\|)/, // bitwise
+      /(\+\+)/, // increment
+      /(\=)/, // assignment
+      /(%[^%]|\*[^\/]|\/[^\/\*]|-|\+)/, // arithmetic
+      /(<<|>>)/, // bitwise.shift
+      /(<=|>=|\s(<|>)\s)/, // relational
+      /(==|!=)/, // comparison
+      /(=>)/, // map assign
+    /(!(?=\w))/, // negator
+    /(\&\&)/,
+    /((?<=\s)(\?|:)(?=\s))/, // standalone ? or : (ternary operator?)
+    
+    /(\?\.)/, // null-safe operator
     /(?/],
-        scope: { 2: 'type', 3: 'punctuation' }
-      },
-      {
-        match: regex.concat(/\b/, APEX_IDENT_RE, /(?=[,\s<])/),
-        scope: { 2: 'title.class.inherited' }
-      },
-      {
-        match: [/\b/, APEX_IDENT_RE, /\./, APEX_IDENT_RE, /(?=[,\s<])/],
-        scope: { 1: 'built_in', 3: 'title.class.inherited' }
+
+       ],
+       
+       endsWithParent: true,
+       
+        /* begin: /\b(extends|implements)\b/,
+        beginScope: 'keyword',
+        end: /\b(extends|implements|\{)\b/, */
+
+        //endsWithParent: true,
+        contains:[
+          {
+            match: regex.concat(/\b/, regex.either(...BUILT_INS), /\b\s*(?!>)/),
+            scope: 'title.class.inherited'
+          },
+          {
+            match: regex.concat(/\b/, regex.either(...NAMESPACE_LIST), /\b\s*(?!<>)/),
+            scope: 'built_in'
+          },
+          {
+            match: [/\b/, APEX_IDENT_RE, /\./, APEX_IDENT_RE, /(?=[,\s<])/],
+            scope: { 2: 'built_in', 4: 'title.class.inherited' }
+          },
+          /* {
+            match: regex.concat(/[^\.]/, APEX_IDENT_RE, /(?=[,\s<])/),
+            scope: { 2: 'title.class.inherited' }
+          }, */
+          {
+            // collection type
+            match: [/\b/, APEX_IDENT_RE, /(?=>)/],
+            scope: { 2: 'type' //, 3: 'punctuation'
+           }
+          },
+          {
+            match: regex.concat(/\b/, APEX_IDENT_RE, /\b(?!<)/),
+            scope: 'title.class.inherited'
+          }
+        ]
+
       }
     ]
   };
 
   const ENUM_DECLARATION = {
-    begin: [/\b(?<=enum)\s+/, APEX_IDENT_RE, /\s*/, /[{()]/],
+    begin: [/\benum\s+/, APEX_IDENT_RE, /\s*/, /\{/],
     beginScope: {
+      1: 'type',
       2: 'type',
       4: 'punctuation'
     },
-    end: /[})]/,
+    end: /[\}\n]/,
     endScope: 'punctuation',
+    scope: 'enum declaration',
     relevance: 0,
     contains: [
       COMMENT_LINE,
       COMMENT_BLOCK,
+      PUNCTUATION,
       {
         match: regex.concat(/\b/, APEX_IDENT_RE, /\b/),
         scope: 'variable.constant'
@@ -1046,7 +1110,7 @@ export default function (hljs) {
         endsParent: true
       },
       {
-        match: /IN|=\s*:/,
+        match: /\b\s*IN|=\s*:/,
         scope: 'operator'
       },
       {
@@ -1056,7 +1120,7 @@ export default function (hljs) {
       },
       {
         match: regex.concat(/\b/, regex.either(...SOQL_OPERATORS), /\b/),
-        scope: 'operator',
+        scope: 'operator soql',
         relevance: 0
       },
       {
@@ -1106,7 +1170,7 @@ export default function (hljs) {
       2: 'punctuation',
       3: 'type',
       5: 'variable',
-      6: 'punctuation'
+      6: 'operator'
     },
     end: '{',
     contains: [COMMENT_LINE, COMMENT_BLOCK, SOQL_QUERY]
@@ -1211,7 +1275,7 @@ export default function (hljs) {
     '%endif',
     '#endif',
     /\w::\w/,
-    /RETURNING\s+\*/,
+    /(SELECT|RETURNING)\s+\*/,
     /\bint\b/,
     /import\s+\w+\s+=\s+require\("\w+"\)/,
     '/^include\b/',
@@ -1223,7 +1287,6 @@ export default function (hljs) {
     /\bend\n/,
     '"""',
     /\+\+\+/,
-    /=>/,
     /<%/,
     '<%#',
     '%%>',
@@ -1234,7 +1297,7 @@ export default function (hljs) {
 
   return {
     name: 'Apex',
-    aliases: ['apex', 'lightning'],
+    aliases: ['apex', 'lightning', 'soql'],
     case_insensitive: true, // language is case-insensitive
     disableAutodetect: false,
     ignoreIllegals: false,
@@ -1245,7 +1308,7 @@ export default function (hljs) {
       built_in: BUILT_INS,
       type: TYPES,
       literal: LITERALS,
-      //punctuation: PUNCTUATION_REGEX,
+      //operator: OPERATOR_REGEX,
       classNameAliases: {
         soql: 'subst'
       }
@@ -1269,6 +1332,7 @@ export default function (hljs) {
       NAMESPACES,
       NUMBERS,
       OPERATORS,
+      PROPERTIES,
       PUNCTUATION,
       RETURNS,
       SALESFORCE_ID,