Skip to content

Commit

Permalink
fix: rename variable classes from debug temp names
Browse files Browse the repository at this point in the history
  • Loading branch information
dschach committed Feb 6, 2024
1 parent ef4ea46 commit fa67d05
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
14 changes: 7 additions & 7 deletions dist/apex.es.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ $pattern:t.concat(/(?<!\.)\b/,a,/\b/),keyword:[...b,...d,...E],type:m,literal:S
},L=[...S,...b,...d,...A,...h,...v,...u,...E],N={
match:t.concat(/\b/,t.either(...u),/\b/),scope:"variable.language",relevance:0
},O=[{match:[t.concat(/\b/,t.either(...v)),/\./,a,/\b\s*(?![\.\(])/],scope:{
1:"built_in",2:"punctuation",3:"variable1"},relevance:0},{
1:"built_in",2:"punctuation",3:"variable"},relevance:0},{
match:[t.concat(/\b/,t.either(...h)),/\./,a,/\b\s*(?![\.\(])/],scope:{
1:"built_in",2:"punctuation",3:"type"},relevance:0},{
match:[t.concat(/\b/,t.either(...A)),/\./,c,/\b(?=\.)/],scope:{1:"built_in",
Expand All @@ -32,7 +32,7 @@ scope:"string",relevance:0,contains:[{match:/\\'/,scope:"literal",relevance:0}]
relevance:0,contains:[{begin:/\w+@/,relevance:0},{
match:[/@(?:exception|throws)/,s,a],scope:{1:"doctag",3:"title.class"},
relevance:0},{begin:"@[A-Za-z_-]+",scope:"doctag",relevance:0},{
match:[/(?<=@param)\s+/,a],scope:{2:"variable2"},relevance:0},{excludeBegin:!0,
match:[/(?<=@param)\s+/,a],scope:{2:"variable"},relevance:0},{excludeBegin:!0,
excludeEnd:!0,contains:[e.BACKSLASH_ESCAPE],relevance:0,variants:[{begin:"`",
end:"`",scope:"subst"},{begin:/'/,end:/'/,scope:"string"}]}]}),D],_={
match:t.either(...T),scope:"operator",relevance:0},U={match:/(?<!\.)\bId\b/,
Expand All @@ -46,7 +46,7 @@ match:[t.optional(c),/\[/,t.optional(/\d+/),/\]/],scope:{1:"variable",
},end:/\)/,endScope:"punctuation",contains:[{match:[c,/\s*=/],scope:{
1:"keyword",2:"operator"},contains:[_]},C,p],keywords:{literal:S}}],k={
match:[/\b[a-zA-Z0-9\.]*Exception/,s,a],scope:{1:"type",3:"variable"},
relevance:0},F={match:[/(?<!\.)/,c,/\s*(?=\=[^\>])/],scope:{2:"variable3"},
relevance:0},F={match:[/(?<!\.)/,c,/\s*(?=\=[^\>])/],scope:{2:"variable"},
relevance:0},P={match:[/(?<=\=\s*\()/,a,"(?=\\)\\s*"+a+")"],scope:{2:"type"},
relevance:0},Y={match:[/\bnew\s+/,a,o],scope:{2:"type"},relevance:0};let W={
scope:"params_call",begin:/\(/,beginScope:"punctuation",end:/\)/,
Expand All @@ -57,10 +57,10 @@ contains:[...i],starts:W},{match:[/^\s*/,l(...b),a,o],scope:{
;W.contains=[C,Y,I,_,f,O,p,U,x,{keywords:{KEYWORDS:y},
match:t.concat(/(?<=\s|\(|\,)/,l(...S),a,/\b/,/(?!\.)/),scope:"variable",
relevance:0},{match:/\(|\,|\./,scope:"punctuation",relevance:0},{match:a,
scope:"variable4"}];const H={scope:"params",end:/\)/,endScope:"punctuation",
scope:"variable"}];const H={scope:"params",end:/\)/,endScope:"punctuation",
relevance:1,keywords:y,contains:[p,C,I,f,...O,{match:/\,|\(/,scope:"punctuation"
},U,{match:[/(?<=\(|\,)\s*/,a,/(?=\s)/],scope:{2:"type"}},{
match:[s,a,/\s*(?=[,)])/],scope:{2:"variable5"}}]},G={
match:[s,a,/\s*(?=[,)])/],scope:{2:"variable"}}]},G={
match:[/\bswitch\s+on\s+/,a],scope:{1:"keyword",2:"variable"}};return{
name:"Apex",aliases:["apex","lightning","soql"],case_insensitive:!0,
disableAutodetect:!1,ignoreIllegals:!1,keywords:y,
Expand Down Expand Up @@ -99,9 +99,9 @@ scope:"keyword",relevance:8},{
match:[/(NEXT|LAST)_N_(DAY|FISCAL_QUARTER|FISCAL_YEAR|MONTH|QUARTER|WEEK|YEAR)S/,/\s*:\s*/,/\d+/],
scope:{1:"keyword",2:"operator",3:"number"},relevance:8},{
match:t.concat(/\b/,t.either(...y.keyword,"ABOVE_OR_BELOW","ABOVE","ACTIVE","ADVANCED","ALL","ANY","ARRAY","AS","ASC","BELOW","CATEGORY","CONTAINS","CUSTOM","DATA","DESC","DIVISION","ELSE","END","FIND","FROM","METADATA","NETWORK","ON","PricebookId","RETURNING","ROLLUP","ROWS","SEARCH","SECURITY_ENFORCED","SELECT","SNIPPET","SORT","SPELL_CORRECTION","STANDARD","THEN","USER_MODE","USING","WHEN","WHERE","WITH","SCOPE","Delegated","Everything","Mine","My_Territory","My_Team_Territory","Team","AND","AT","FIRST","FOR","HAVING","IN","LAST","LIKE","LIMIT","LISTVIEW","NOT","NULLS","OFFSET","OR","REFERENCE","TRACKING","TYPEOF","UPDATE","VIEW","VIEWSTAT"),/\b/),
scope:"keyword"},{match:[/(?<=:)/,/\s*/,c,/(?!\()/],scope:{3:"variable6"},
scope:"keyword"},{match:[/(?<=:)/,/\s*/,c,/(?!\()/],scope:{3:"variable"},
relevance:0},{match:[/(?<=:|\.)/,a,/(?=\s*\()/],scope:{2:"title.function.invoke"
},relevance:0},{match:/:/,scope:"operator",relevance:0}],illegal:"::"
},G,F,_,w,i,{match:t.concat("(?<=this.\b)",a,"(?!\\()"),scope:"variable7"},{
},G,F,_,w,i,{match:t.concat("(?<=this.\b)",a,"(?!\\()"),scope:"variable"},{
match:[t.concat(/\b/,l(...L)),a,s,/(?=\{)/],scope:{2:"property"},relevance:0}]}}
})();export default hljsGrammar;
14 changes: 7 additions & 7 deletions dist/apex.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ $pattern:t.concat(/(?<!\.)\b/,a,/\b/),keyword:[...b,...d,...E],type:m,literal:S
},L=[...S,...b,...d,...A,...h,...v,...u,...E],N={
match:t.concat(/\b/,t.either(...u),/\b/),scope:"variable.language",relevance:0
},O=[{match:[t.concat(/\b/,t.either(...v)),/\./,a,/\b\s*(?![\.\(])/],scope:{
1:"built_in",2:"punctuation",3:"variable1"},relevance:0},{
1:"built_in",2:"punctuation",3:"variable"},relevance:0},{
match:[t.concat(/\b/,t.either(...h)),/\./,a,/\b\s*(?![\.\(])/],scope:{
1:"built_in",2:"punctuation",3:"type"},relevance:0},{
match:[t.concat(/\b/,t.either(...A)),/\./,c,/\b(?=\.)/],scope:{1:"built_in",
Expand All @@ -32,7 +32,7 @@ scope:"string",relevance:0,contains:[{match:/\\'/,scope:"literal",relevance:0}]
relevance:0,contains:[{begin:/\w+@/,relevance:0},{
match:[/@(?:exception|throws)/,s,a],scope:{1:"doctag",3:"title.class"},
relevance:0},{begin:"@[A-Za-z_-]+",scope:"doctag",relevance:0},{
match:[/(?<=@param)\s+/,a],scope:{2:"variable2"},relevance:0},{excludeBegin:!0,
match:[/(?<=@param)\s+/,a],scope:{2:"variable"},relevance:0},{excludeBegin:!0,
excludeEnd:!0,contains:[e.BACKSLASH_ESCAPE],relevance:0,variants:[{begin:"`",
end:"`",scope:"subst"},{begin:/'/,end:/'/,scope:"string"}]}]}),D],_={
match:t.either(...R),scope:"operator",relevance:0},U={match:/(?<!\.)\bId\b/,
Expand All @@ -46,7 +46,7 @@ match:[t.optional(c),/\[/,t.optional(/\d+/),/\]/],scope:{1:"variable",
},end:/\)/,endScope:"punctuation",contains:[{match:[c,/\s*=/],scope:{
1:"keyword",2:"operator"},contains:[_]},C,p],keywords:{literal:S}}],k={
match:[/\b[a-zA-Z0-9\.]*Exception/,s,a],scope:{1:"type",3:"variable"},
relevance:0},F={match:[/(?<!\.)/,c,/\s*(?=\=[^\>])/],scope:{2:"variable3"},
relevance:0},F={match:[/(?<!\.)/,c,/\s*(?=\=[^\>])/],scope:{2:"variable"},
relevance:0},P={match:[/(?<=\=\s*\()/,a,"(?=\\)\\s*"+a+")"],scope:{2:"type"},
relevance:0},Y={match:[/\bnew\s+/,a,o],scope:{2:"type"},relevance:0};let W={
scope:"params_call",begin:/\(/,beginScope:"punctuation",end:/\)/,
Expand All @@ -57,10 +57,10 @@ contains:[...r],starts:W},{match:[/^\s*/,l(...b),a,o],scope:{
;W.contains=[C,Y,I,_,f,O,p,U,x,{keywords:{KEYWORDS:y},
match:t.concat(/(?<=\s|\(|\,)/,l(...S),a,/\b/,/(?!\.)/),scope:"variable",
relevance:0},{match:/\(|\,|\./,scope:"punctuation",relevance:0},{match:a,
scope:"variable4"}];const H={scope:"params",end:/\)/,endScope:"punctuation",
scope:"variable"}];const H={scope:"params",end:/\)/,endScope:"punctuation",
relevance:1,keywords:y,contains:[p,C,I,f,...O,{match:/\,|\(/,scope:"punctuation"
},U,{match:[/(?<=\(|\,)\s*/,a,/(?=\s)/],scope:{2:"type"}},{
match:[s,a,/\s*(?=[,)])/],scope:{2:"variable5"}}]},B={
match:[s,a,/\s*(?=[,)])/],scope:{2:"variable"}}]},B={
match:[/\bswitch\s+on\s+/,a],scope:{1:"keyword",2:"variable"}};return{
name:"Apex",aliases:["apex","lightning","soql"],case_insensitive:!0,
disableAutodetect:!1,ignoreIllegals:!1,keywords:y,
Expand Down Expand Up @@ -99,9 +99,9 @@ scope:"keyword",relevance:8},{
match:[/(NEXT|LAST)_N_(DAY|FISCAL_QUARTER|FISCAL_YEAR|MONTH|QUARTER|WEEK|YEAR)S/,/\s*:\s*/,/\d+/],
scope:{1:"keyword",2:"operator",3:"number"},relevance:8},{
match:t.concat(/\b/,t.either(...y.keyword,"ABOVE_OR_BELOW","ABOVE","ACTIVE","ADVANCED","ALL","ANY","ARRAY","AS","ASC","BELOW","CATEGORY","CONTAINS","CUSTOM","DATA","DESC","DIVISION","ELSE","END","FIND","FROM","METADATA","NETWORK","ON","PricebookId","RETURNING","ROLLUP","ROWS","SEARCH","SECURITY_ENFORCED","SELECT","SNIPPET","SORT","SPELL_CORRECTION","STANDARD","THEN","USER_MODE","USING","WHEN","WHERE","WITH","SCOPE","Delegated","Everything","Mine","My_Territory","My_Team_Territory","Team","AND","AT","FIRST","FOR","HAVING","IN","LAST","LIKE","LIMIT","LISTVIEW","NOT","NULLS","OFFSET","OR","REFERENCE","TRACKING","TYPEOF","UPDATE","VIEW","VIEWSTAT"),/\b/),
scope:"keyword"},{match:[/(?<=:)/,/\s*/,c,/(?!\()/],scope:{3:"variable6"},
scope:"keyword"},{match:[/(?<=:)/,/\s*/,c,/(?!\()/],scope:{3:"variable"},
relevance:0},{match:[/(?<=:|\.)/,a,/(?=\s*\()/],scope:{2:"title.function.invoke"
},relevance:0},{match:/:/,scope:"operator",relevance:0}],illegal:"::"
},B,F,_,w,r,{match:t.concat("(?<=this.\b)",a,"(?!\\()"),scope:"variable7"},{
},B,F,_,w,r,{match:t.concat("(?<=this.\b)",a,"(?!\\()"),scope:"variable"},{
match:[t.concat(/\b/,l(...L)),a,s,/(?=\{)/],scope:{2:"property"},relevance:0}]}}
})();hljs.registerLanguage("apex",e)})();
14 changes: 7 additions & 7 deletions src/languages/apex.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ export default function (hljs) {
/\b\s*(?![\.\(])/
],
// TODO: Find a better scope for the enum value
scope: { 1: 'built_in', 2: 'punctuation', 3: 'variable1' },
scope: { 1: 'built_in', 2: 'punctuation', 3: 'variable' },
relevance: 0
},
{
Expand Down Expand Up @@ -437,7 +437,7 @@ export default function (hljs) {
},
{
match: [/(?<=@param)\s+/, APEX_IDENT_RE],
scope: { 2: 'variable2' },
scope: { 2: 'variable' },
relevance: 0
},
{
Expand Down Expand Up @@ -554,7 +554,7 @@ export default function (hljs) {
// mynum =
// could also be a collection variable
match: [/(?<!\.)/, APEX_IDENT_WORD_RE, /\s*(?=\=[^\>])/],
scope: { 2: 'variable3' },
scope: { 2: 'variable' },
relevance: 0
};
const CASTING = {
Expand Down Expand Up @@ -628,7 +628,7 @@ export default function (hljs) {
relevance: 0
},
{ match: /\(|\,|\./, scope: 'punctuation', relevance: 0 },
{ match: APEX_IDENT_RE, scope: 'variable4' }
{ match: APEX_IDENT_RE, scope: 'variable' }
];

const PARAMS_DECLARATION = {
Expand All @@ -655,7 +655,7 @@ export default function (hljs) {
// must be followed by comma or paren
match: [SPACE, APEX_IDENT_RE, /\s*(?=[,)])/],

scope: { 2: 'variable5' }
scope: { 2: 'variable' }
}
]
};
Expand Down Expand Up @@ -1007,7 +1007,7 @@ export default function (hljs) {
{
// colon notation
match: [/(?<=:)/, /\s*/, APEX_IDENT_WORD_RE, /(?!\()/],
scope: { 3: 'variable6' },
scope: { 3: 'variable' },
relevance: 0
},
{
Expand Down Expand Up @@ -1041,7 +1041,7 @@ export default function (hljs) {

const THIS = {
match: regex.concat('(?<=this\.\b)', APEX_IDENT_RE, '(?!\\()'),
scope: 'variable7'
scope: 'variable'
};

const PROPERTY = {
Expand Down

0 comments on commit fa67d05

Please sign in to comment.