diff --git a/.gitignore b/.gitignore index 52c5498..f6df6e2 100644 --- a/.gitignore +++ b/.gitignore @@ -106,6 +106,11 @@ typings/ # OSX file .DS_Store -# no idea why sfdx is in this repo, but excluding those folders +# SFDX CLI +.sf .sfdx -.sf \ No newline at end of file + +#PMD file +.pmdCache + +demo/scratchpad.* diff --git a/.npmignore b/.npmignore index a2792c4..9c7e943 100644 --- a/.npmignore +++ b/.npmignore @@ -1,7 +1,6 @@ -assets -demo -.github -.vscode -node_modules, -.release-please-manifest.json -release-please-config.json \ No newline at end of file +* + +!dist/**/* +!package.json +!src/**/* +!test/**/* \ No newline at end of file diff --git a/.prettierignore b/.prettierignore index c3c4bdd..06b75d0 100755 --- a/.prettierignore +++ b/.prettierignore @@ -4,4 +4,9 @@ node_modules .localdevserver -.vscode \ No newline at end of file +.vscode + +*.txt + +test/index.js +*.png \ No newline at end of file diff --git a/.prettierrc b/.prettierrc index bb76ebc..048c8a9 100755 --- a/.prettierrc +++ b/.prettierrc @@ -1,15 +1,30 @@ { "trailingComma": "none", "useTabs": true, - "printWidth": 120, "bracketSameLine": true, "bracketSpacing": true, "tabWidth": 2, "singleQuote": true, "overrides": [ + { + "files": ".prettierrc", + "options": { "parser": "json", "printWidth": 80 } + }, { "files": "**/*.js", - "options": { "useTabs": false, "printWidth": 80 } + "options": { "parser": "babel", "useTabs": false, "printWidth": 80 } + }, + { + "files": "doc*/**/*.html", + "options": { + "parser": "html", + "useTabs": true, + "tabWidth": 2, + "printWidth": 150, + "htmlWhitespaceSensitivity": "ignore", + "singleQuote": false + } } - ] + ], + "$schema": "https://json.schemastore.org/prettierrc" } diff --git a/.vscode/settings.json b/.vscode/settings.json index 55bd8f8..577fbb7 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,6 @@ { - "apexPMD.enableCache": false + "apexPMD.enableCache": false, + "[css]": { + "editor.formatOnSave": false + } } \ No newline at end of file diff --git a/demo/testcode.css b/demo/testcode.css new file mode 100644 index 0000000..0d5ed1f --- /dev/null +++ b/demo/testcode.css @@ -0,0 +1,24 @@ +@import url('https://fonts.googleapis.com/css?family=Barlow:400,400i|Nanum+Gothic&display=swap'); + +:root { + --grey-blue-tx: #51638a; + --grey-blue-bg: #547499; + --light-grey: #f7f7f7; + --dark-grey: #c6c6c6; + --white: #fff; + --dark-red: #a31515; + --title-font: 'Nanum Gothic'; + --code-font: monospace; +} + +body { + font-family: 'Barlow', sans-serif; + margin: 0px; + padding: 0px; +} + +pre code { + white-space: pre-wrap; + font-size: 120%; + +} diff --git a/demo/testcode.html b/demo/testcode.html index f07bcaf..2d31f26 100644 --- a/demo/testcode.html +++ b/demo/testcode.html @@ -1,13 +1,14 @@ - +
- /*
- Copyright (c) 2022, salesforce.com, inc.
- All rights reserved.
- 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
- */
+
+ Map<Id, CustomObject__c> myMap = new Map<Id, CustomObject__c>([SELECT Id FROM CustomObject__c WHERE Id NOT IN :newRecordsMap.keySet()]);
+ Map<Id, String> myMap = new Map<Id, String>{a => b, c => d};
+
+ delete myAccount;
+ Account a;
+ String s;
+ delete [SELECT Id FROM Account];
+
+ Integer myInt = 8 - 7++;
+
+ public List<String> myString { get; set; }
+
+ List<Opportunity> opps = [SELECT Id FROM Opportunity WHERE Id NOT IN :newRecordsMap.keySet()];
+
+
+ String queryText = 'SELECT Id, Name, ';
+ acctid = System.currentPageReference().getParameters().get('Id');
+ System.assert(true);
+ System.requestVersion();
+
+ @IsTest
+ private without sharing class myTestClass {
+ myMap?.get('Id');
+ }
+ System.URL.getCurrentRequestUrl();
+ URL.getCurrentRequestUrl();
+
+ public List<SelectOption> recordTypes { get; private set; }
+
+ Database.insert(myAccounts, false, AccessLevel.USER_MODE);
+ delete myAccount;
+ delete [SELECT Id FROM Account];
+ myAcct = (Account)myacct;
+
+ public String myString { get; set; }
+
+ List<SObject> mylist = [SELECT Name, StreetAddress__c, COUNT(),
+ (SELECT Id FROM Contacts)
+ FROM Warehouse__c.Contacts__r
+ WHERE DISTANCE(Location__c, GEOLOCATION(37.775,-122.418), 'mi') < 20
+ AND Date__kav NOT IN LAST_N_DAYS:80
+ ORDER BY DISTANCE(Location__c, GEOLOCATION(37.775,-122.418), 'mi')
+ LIMIT 10];
+
+ String queryText = 'SELECT Id, Name, AccountId, FirstName, LastName, mailingcountry, ' +
+ 'FROM Contact WHERE AccountId = :acctid ORDER BY ' +
+ String.escapeSingleQuotes(SortFullExp) +
+ ' NULLS LAST LIMIT 1000';
/**
- * @author {@link [David Schach](https://github.com/dschach)}
+ * @author {@link [David Schach](https://github.com/dschach)} test@email.com
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
* @group Visualforce
* @since 2022
*/
@@ -37,63 +81,50 @@
public enum Season {WINTER, SPRING, SUMMER, FALL}
- /**
- * Extension Constructor
- * @param stdController `ActionPlan__c` Standard Controller
- */
public ActionPlanDetailController(ApexPages.StandardController stdController, Integer x, Double y) {
Map<Id, Map<String, Wrapper>> renew = new Map<Id, Map<String, SObject>>();
- if (!Test.isRunningTest()) {
+ if (!Test.isRunningTest() && false) {
stdController.addFields(ActionPlansUtilities.getCustomRelationshipFields());
}
for(Account a : [SELECT Id FROM Account WHERE Id = :a.Id ORDER BY CreatedDate ASC] ){}
actionPlan = (ActionPlan__c) stdController.getRecord();
truestory = req.setHeader('X-Password', '{!$Credential.Password}');
}
+ }
/**
- * Action on page load to ensure custom setting is created
- * @return `PageReference` null (required for page actions method)
- */
+ * @description Constructor using passed-in class name constructor for faster performance
+ * <br>We cast all four trigger collections
+ * @param className The name of this class. Pass in the string to make the handler run faster
+ * @return `PageReference` Page to go to after deleting `ActionPlan__c`
+ * Display ControllingTasks column only if there are controlling tasks
+ * @author {@link [David Schach](https://github.com/dschach)}
+ * @return `Boolean` is the Controller__c field populated for any Action Plan Tasks?
+ */
public PageReference onLoad() {
ActionPlansUtilities.onPageLoad();
return null;
}
-
- /**
- * Deletes the current Action Plan loaded and redirects to the AP List
- * @return `PageReference` Page to go to after deleting `ActionPlan__c`
- */
+
public PageReference deletePlan() {
+ this(DEFAULT_SIZE);
//delete ap, which will also delete apts via master-detail relationship
try {
delete actionPlan;
} catch (DMLException e) {
ApexPages.addMessages(e);
+ throw new CustomException('my error');
return i++;
}
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) {
- retURL = '/' + ActionPlansUtilities.getEscapedPageParameter('templateId');
- } else if (hasRetURLParam && !ActionPlansUtilities.getIsLex()) {
- retURL = '' + ActionPlansUtilities.getEscapedPageParameter('retURL');
- }
Pagereference newPage = new PageReference('' + retURL);
newPage.setRedirect(true);
return newPage;
}
- /**
- * Display ControllingTasks column only if there are controlling tasks
- * @author {@link [David Schach](https://github.com/dschach)}
- * @return `Boolean` is the Controller__c field populated for any Action Plan Tasks?
- */
public Custom__c hasControllingTasks {
get {
hasControllingTasks = false;
@@ -122,16 +153,7 @@
Map<Id, APTask__c> apTaskMap = new Map<Id, APTask__c>(
[
SELECT
- Action_Plan__c,
- ActivityDate__c,
- Controller__c,
- Controller__r.Subject__c,
- DaysFromStart__c,
- Dependent__c,
Id,
- IsClosed__c,
- Minutes_Reminder__c,
- User__c,
User__r.Name
FROM APTask__c
WHERE Action_Plan__c = :actionPlan.Id
@@ -155,31 +177,18 @@
return apTaskWrapperList;
}
- /**
- * Wrapper for Action Plan Task
- * <br>It contains the `Action Plan Task` and the `Task` Id
- */
public class TaskWrapper {
/**
* The (standard) `Task` Id
*/
public Id taskId { get; private set; }
- /**
- * Constructor for the task wrapper
- * @param aptParam Action Plan Task Template
- * @param taskIdParam TaskId (for the standard object `Task`)
- */
public TaskWrapper(APTask__c aptParam, Id taskIdParam) {
this.apt = aptParam;
this.taskId = taskIdParam;
}
}
- /**
- * Checks if Action Plan Template has been changed since the creation of the Action Plan.
- * @return `Boolean` Was the AP's template modified after the Action Plan was created?
- */
public Boolean getVersion() {
if (actionPlan.Action_Plan_Template__c != null) {
ActionPlanTemplate__c tempApt = [SELECT LastModifiedDate FROM ActionPlanTemplate__c WHERE Id = :actionPlan.Action_Plan_Template__c];
@@ -190,24 +199,6 @@
return false;
}
- /**
- * The label of the Action Plan's parent record SObject
- * @return `String` Label of the object related to this Action Plan
- */
- public String getRelatedObjectLabel() {
- String objLabel = '';
-
- for (String f : ActionPlansUtilities.getCustomRelationshipFields()) {
- if (actionPlan.get(f) != null) {
- Id objId = (Id) actionPlan.get(f);
- Schema.DescribeSObjectResult dsr = objId.getSObjectType().getDescribe();
- objLabel = dsr.getLabel();
- break;
- }
- }
- return objLabel;
- }
-
/**
* The name of the parent record - show a different field based on SObject Type
* @return `String` name of the object related to this Action Plan
@@ -257,31 +248,10 @@
return toReturn;
}
- /**
- * If we have no share object, we don't need to show a Share button
- * @author {@link [David Schach](https://github.com/dschach)}
- * @return `Boolean` Does the user have permission to share this Action Plan?
- */
public Boolean getCanShare() {
return ActionPlansUtilities.canShareRecord(actionPlan.Id, actionPlan.OwnerId);
}
-
- /**
- * Does the user have permission to transfer? We query `UserRecordAccess` to find out.
- * @author {@link [David Schach](https://github.com/dschach)}
- * @return `Boolean` yes/no
- */
- public Boolean getCanTransfer() {
- return ActionPlansUtilities.getCanTransfer(actionPlan.Id);
- }
- }
- @SuppressWarnings('PMD.AvoidGlobalModifier')
- /**
- * @group Invocable
- * @author {@link [David Schach](https://github.com/dschach)}
- * @since 2022
- */
global without sharing class ActionPlanCreateInvocable {
@InvocableMethod
(label='Create Action Plan From Template' description='Takes a Template Name/Id and Record Id and makes an Action Plan for that record.' category=77)
@@ -299,23 +269,10 @@
SELECT
Id,
Description__c,
- Name,
- OwnerId,
- SkipDay__c,
- SkipWeekends__c,
TaskRecordTypeID__c,
(
SELECT
Type__c,
- Name,
- User__c,
- User__r.Name,
- Id,
- DaysFromStart__c,
- Action_Plan_Template__c,
- TController__r.Subject__c,
- Minutes_Reminder__c,
- TaskIndex__c,
Action_Plan_Template__r.TaskRecordTypeID__c
FROM aptTasks__r
ORDER BY TaskIndex__c ASC
@@ -330,22 +287,14 @@
for (ActionPlanTemplate__c apt : possibleTemplates) {
templateNameOrIdToTemplate.put(apt.Id, apt);
- templateNameOrIdToTemplate.put(apt.Name, apt);
}
- Set<Id> relatedIDs = new Set<Id>();
-
for (CreateActionPlanRequest r : requests) {
relatedIDs.add(r.relatedRecordID);
}
Map<Id, ActionPlan__c> actionPlansToInsert = new Map<Id, ActionPlan__c>();
-
- if (actionPlansToInsert.isEmpty()) {
- return resultIDs;
- }
-
insert actionPlansToInsert.values();
Map<String, APTask__c> planTaskIndexToTask = new Map<String, APTask__c>();
@@ -357,55 +306,24 @@
ActionPlan__c ap = actionPlansToInsert.get(r.relatedRecordID);
- ActionPlanTemplate__c actionPlanTemplate = templateNameOrIdToTemplate.get(r.templateNameOrID);
-
for (APTemplateTask__c aptTask : actionPlanTemplate.aptTasks__r) {
APTask__c apTask = new APTask__c();
apTask.User__c = ActionPlansBuilderUtilities.getAPTaskTemplateUser(ap, relObjectOwners, aptTask.User__c);
- apTask.DaysFromStart__c = aptTask.DaysFromStart__c;
- apTask.Comments__c = aptTask.Comments__c;
- apTask.Minutes_Reminder__c = aptTask.Minutes_Reminder__c;
apTask.SendEmail__c = aptTask.SendEmail__c;
- apTask.Action_Plan__c = ap.Id;
-
apTask.Status__c = ActionPlansUtilities.getTaskRecordTypeStatusDefaultValues().get(ActionPlansUtilities.getDefaultTaskRecordTypeId());
- if (apTask.Dependent__c != null && apTask.Dependent__c != 'None') {
- apTask.ActivityDate__c = null;
+ // create due date, calculate the due date of the tasks for skip weekends feature
+ if (ap.SkipWeekends__c == true && ap.SkipDay__c != null) {
+ apTask.ActivityDate__c = ActionPlansUtilities.adjustTaskDueDate(ap.StartDate__c, apTask.DaysFromStart__c.intValue(), ap.SkipDay__c);
} else {
- apTask.Controller__c = null;
-
- //set dependency taskId to none if none was selected
- if (apTask.Dependent__c == null) {
- apTask.Dependent__c = 'None';
- }
-
- // create due date, calculate the due date of the tasks for skip weekends feature
- if (ap.SkipWeekends__c == true && ap.SkipDay__c != null) {
- apTask.ActivityDate__c = ActionPlansUtilities.adjustTaskDueDate(ap.StartDate__c, apTask.DaysFromStart__c.intValue(), ap.SkipDay__c);
- } else {
- apTask.ActivityDate__c = ap.StartDate__c.addDays(apTask.DaysFromStart__c.intValue());
- }
+ apTask.ActivityDate__c = ap.StartDate__c.addDays(apTask.DaysFromStart__c.intValue());
}
planTaskIndexToTask.put(ap.Id + '' + apTask.TaskIndex__c, apTask);
}
}
- Database.insert(planTaskIndexToTask.values());
-
- // Now we have to update with the controlling/dependent task IDs
-
- List<APTask__c> dependentTasksToUpdate = new List<APTask__c>();
-
- for (APTask__c apTask : planTaskIndexToTask.values()) {
- String actionPlanPlusIndex = apTask.Action_Plan__c + '' + apTask.Dependent__c;
-
- if (planTaskIndexToTask.containsKey(actionPlanPlusIndex)) {
- apTask.Controller__c = planTaskIndexToTask.get(actionPlanPlusIndex).Id;
- dependentTasksToUpdate.add(apTask);
- }
- }
+ Database.insert(new planTaskIndexToTask.values());
Database.update(dependentTasksToUpdate);
@@ -425,8 +343,6 @@
ActionPlan__c insertedAP;
// check if task exists already
Task t = new Task();
- t.Subject = apTask.Subject__c;
- t.Priority = apTask.Priority__c;
t.OwnerId = apTask.User__c;
t.TaskAPTask__c = apTask.Id;
@@ -454,35 +370,17 @@
String f = s;
if (
!f.equalsIgnoreCase(ActionPlansUtilities.namespacePrefix + 'Contact__c') &&
- !f.equalsIgnoreCase(ActionPlansUtilities.namespacePrefix + 'Lead__c') &&
insertedAP.get(f) != null
) {
t.WhatId = (Id) insertedAP.get(f);
break;
}
}
-
- if (t.Id == null) {
- t.Status = apTask.Status__c;
- }
- t.ActivityDate = apTask.ActivityDate__c;
-
- if (apTask.Dependent__c == 'None') {
- if (apTask.SendEmail__c == true) {
- myNewTasksWithEmail.add(t);
- } else {
- myTasksWithOutEmail.add(t);
- }
- }
}
Database.DMLOptions dmlo1 = new Database.DMLOptions();
dmlo1.EmailHeader.triggerUserEmail = true;
- if (myTasksWithOutEmail.size() > 0) {
- Database.insert(myTasksWithOutEmail, dmlo2);
- }
-
Set<Id> relObjectIDs = new Set<Id>();
for (ActionPlan__c ap : actionPlansToInsert.values()) {
relObjectIDs.add(ap.Id);
@@ -499,193 +397,216 @@
return resultIDs;
}
- /**
- * Wrapper class for ActionPlan Request for invocable Apex.
- * @author {@link [David Schach](https://github.com/dschach)}
- * @since 2022
- */
global class CreateActionPlanRequest {
@InvocableVariable(required=true label='The parent Record ID' description=55)
- /**
- * The parent Record ID. Must have a relationship named the related record object name from Action Plan object.
- */
global Id relatedRecordID;
}
}
trigger APAccount on Account(before delete, after undelete) {
ActionPlansTriggerHandlers.triggerhandlerActionPlanAccount(Trigger.new, Trigger.old, Trigger.newMap, Trigger.oldMap, Trigger.operationType);
-
- ActionPlansTriggerHandlers.actionPlansSObjectTriggerHandler('Account');
-
+ ActionPlansTriggerHandlers.actionPlansSObjectTriggerHandler('Account');
}
-
-
-/**
- * SHOULD BE RECOGNIZED AS JAVA
- * @author John Smith
-*/
-package l2f.gameserver.model;
-
-public abstract strictfp class L2Char extends L2Object {
- public static final Short ERROR = 0x0001;
-
- public void _moveTo(int x, int y, int z, customtype a) {
- _ai = null;
- log("Should not be called");
- if (1 > 5) { // wtf!?
- return;
+ /**
+ * SHOULD BE RECOGNIZED AS JAVA
+ * @author John Smith
+ */
+ package l2f.gameserver.model;
+
+ public abstract strictfp class L2Char extends L2Object {
+ public static final Short ERROR = 0x0001;
+
+ public void _moveTo(int x, int y, int z, customtype a) {
+ _ai = null;
+ log("Should not be called");
+ if (1 > 5) { // wtf!?
+ return;
+ }
}
}
-}
-
-
-
-public without sharing class AccountSampleTriggerHandler extends TriggerHandler, Database.schedulable, Batchable<SObject> {
- private List<Account> newRecords;
- private List<Account> oldRecords;
- private Map<Id, Account> newRecordsMap;
- private Map<Id, Account> oldRecordsMap;
+ public without sharing class AccountSampleTriggerHandler extends TriggerHandler, Database.schedulable, Batchable<SObject> {
+ private List<Account> newRecords;
+ private List<Account> oldRecords;
+ private Map<Id, Account> newRecordsMap;
+ private Map<Id, Account> oldRecordsMap;
- switch on context {
- when 'BEFORE_INSERT' {
- this.triggerEvent = System.TriggerOperation.BEFORE_INSERT;
- }
- when 'BEFORE_UPDATE' {
- this.triggerEvent = System.TriggerOperation.BEFORE_UPDATE;
- }
- when 'BEFORE_DELETE' {
- this.triggerEvent = System.TriggerOperation.BEFORE_DELETE;
+ switch on context {
+ when 'BEFORE_INSERT' {
+ this.triggerEvent = System.TriggerOperation.BEFORE_INSERT;
+ }
+ when else {
+ // we are not in trigger context
+ this.isTriggerExecuting = false;
+ }
}
- when 'AFTER_INSERT' {
- this.triggerEvent = System.TriggerOperation.AFTER_INSERT;
+
+ public AccountSampleTriggerHandler(CustomType a, String className) {
+ this.newRecords = (List<Account>) Trigger.new;
+ this.newRecordsMap = (Map<Id, Account>) Trigger.newMap;
}
- when 'AFTER_UPDATE' {
- this.triggerEvent = System.TriggerOperation.AFTER_UPDATE;
+
+ public override sobject beforeInsert() {
+ method1();
}
- when 'AFTER_DELETE' {
- this.triggerEvent = System.TriggerOperation.AFTER_DELETE;
+
+ //public override void afterUpdate(){}
+
+ private void method1() {
+ for (Account a : newRecords) {
+ a.Name = a.Name.toUpperCase();
+ a.Name = new FooBar();
+ }
}
- when 'AFTER_UNDELETE' {
- this.triggerEvent = System.TriggerOperation.AFTER_UNDELETE;
+
+ @TestVisible
+ (SeeAllData=true)
+ private void method2() {
+ for (Account a : newRecords) {
+ a.Name = a.Name.toLowerCase();
+ }
}
- when else {
- // we are not in trigger context
- this.isTriggerExecuting = false;
+
+ @future
+ (label = true)
+ private void method3() {
+ Contact[] acctContacts = [SELECT Id FROM Contact WHERE AccountId IN :newRecordsMap.keyset() WITH SECURITY_ENFORCED];
+ List<Contact> acctContacts2 = [SELECT Id FROM Contact WHERE ID = '012000000' AND CreatedDate = :LAST_N_DAYS:90 WITH SECURITY_ENFORCED];
+ if (Contact.getSObjectType().getDescribe().isUpdateable()) {
+ update as user acctContacts; //NOPMD
+ }
+ // do things here
}
}
- /**
- * @description Constructor using passed-in class name constructor for faster performance
- * <br>We cast all four trigger collections
- * @param className The name of this class. Pass in the string to make the handler run faster
- */
- public AccountSampleTriggerHandler(CustomType a, String className) {
- this.newRecords = (List<Account>) Trigger.new;
- this.oldRecords = (List<Account>) Trigger.old;
- this.newRecordsMap = (Map<Id, Account>) Trigger.newMap;
- this.oldRecordsMap = (Map<Id, Account>) Trigger.oldMap;
- }
+ public without sharing class AccountSampleTriggerHandler extends Database.schedulable, Batchable<SObject> {
+ @isTest
+ private testMethod void testme(){
+ Assert.isTrue(true);
+ }
- public override sobject beforeInsert() {
- method1();
+ @testVisible2
+ private List<SelectOption> recordTypes { get; private set; }
}
- //public override void afterUpdate(){}
+ public virtual class Marker {
+ public virtual void write() {
+ System.debug('Writing some text.');
+ }
- private void method1() {
- for (Account a : newRecords) {
- a.Name = a.Name.toUpperCase();
- a.Name = new FooBar();
+ public virtual Double discount() {
+ return .05;
}
}
-
- @TestVisible
- (SeeAllData=true)
- private void method2() {
- for (Account a : newRecords) {
- a.Name = a.Name.toLowerCase();
+
+ @IsTest(Seealldata=true)
+ public with sharing class L2Char implements Database.batchable {
+ public static final String ERROR = 0x0001;
+
+ @InvocableMethod(label='my invocable')
+ public void moveTo(
+ integer x,
+ integer y,
+ integer z
+ ) {
+
+ Account a = new Account();
+ a.Custom__c = 'stringvalue';
+ insert a;
+ Boolean ai = (Boolean) false;
+ System.debug('Should not be called');
+ if (1 > 5) { // wtf!?
+ Database.insert(myAccounts);
+ }
+ }
+
+ @InvocableMethod
+ (label='my invocable')
+ public void doThis(){
}
}
-
- @future
- (label = true)
- private void method3() {
- Contact[] acctContacts = [SELECT Id FROM Contact WHERE AccountId IN :newRecordsMap.keyset() WITH SECURITY_ENFORCED];
- List<Contact> acctContacts2 = [SELECT Id FROM Contact WHERE ID = '012000000' AND CreatedDate = :LAST_N_DAYS:90 WITH SECURITY_ENFORCED];
- if (Contact.getSObjectType().getDescribe().isUpdateable()) {
- update as user acctContacts; //NOPMD
+
+ @TestSetup
+ (TRUEKING=trueking)
+ private static void makeData(Boolean a){
+ Custom__c c = new Custom__c();
+
+ for(Account a : acctLis ){
+ ConnectApi.insert a;
+ }
}
- // do things here
+
+ trigger CTrig on Custom__c (before insert){
+ System.debug('inserting a record');
+ upsert myRecord__c;
}
-}
-public without sharing class AccountSampleTriggerHandler extends Database.schedulable, Batchable<SObject> {
+
+
diff --git a/demo/testcode.txt b/demo/testcode.txt
new file mode 100644
index 0000000..95ab29b
--- /dev/null
+++ b/demo/testcode.txt
@@ -0,0 +1,537 @@
+
+Map myMap = new Map();
+Map myMap = new Map([SELECT Id FROM CustomObject__c WHERE Id NOT IN :newRecordsMap.keySet()]);
+Map myMap = new Map{a => b, c => d};
+
+String relNameQuery = 'SELECT Id, Name FROM ' + objName + ' WHERE Id = \'' + objId + '\'';
+ SObject so = Database.query(relNameQuery)[0];
+ return (String) so.get('Name');
+
+delete myAccount;
+insert new Account(Name = 'testAcct');
+Account a;
+String s;
+delete [SELECT Id FROM Account];
+ApexPages.currentPage().getParameters().get('id');
+
+Integer myInt = 8 - 7++;
+
+public List myString { get; set; }
+
+List opps = [SELECT Id FROM Opportunity WHERE Id NOT IN :newRecordsMap.keySet() and myage = 90];
+List acctContacts2 = [SELECT Id FROM Contact WHERE ID = '012000000' AND CreatedDate = LAST_N_DAYS:90 WITH SECURITY_ENFORCED];
+[SELECT CreatedDate, Amount
+FROM Opportunity
+WHERE CALENDAR_YEAR(CreatedDate) = 2009]
+
+String relNameQuery = 'SELECT Id, Name FROM ' + objName + ' WHERE Id = \'' + objId + '\'';
+ SObject so = Database.query(relNameQuery)[0];
+ return (String) so.get('Name');
+
+
+String queryText = 'SELECT Id, Name, ';
+acctid = System.currentPageReference().getParameters().get('Id');
+System.assert(true);
+System.requestVersion();
+Database.insert(mything);
+
+@IsTest
+private without sharing class myTestClass {
+ myMap?.get('Id');
+}
+System.URL.getCurrentRequestUrl();
+URL.getCurrentRequestUrl();
+
+public List recordTypes { get; private set; }
+
+Database.insert(myAccounts, false, AccessLevel.USER_MODE);
+delete myAccount;
+delete [SELECT Id FROM Account];
+myAcct = (Account)myacct;
+
+public String myString { get; set; }
+
+List mylist = [SELECT Name, StreetAddress__c, COUNT(),
+ (SELECT Id FROM Contacts)
+ FROM Warehouse__c.Contacts__r
+ WHERE DISTANCE(Location__c, GEOLOCATION(37.775,-122.418), 'mi') < 20
+ AND Date__kav NOT IN LAST_N_DAYS:80
+ ORDER BY DISTANCE(Location__c, GEOLOCATION(37.775,-122.418), 'mi')
+ LIMIT 10];
+
+String queryText = 'SELECT Id, Name, AccountId, FirstName, LastName, mailingcountry, ' +
+ 'FROM Contact WHERE AccountId = :acctid ORDER BY ' +
+ String.escapeSingleQuotes(SortFullExp) +
+ ' NULLS LAST LIMIT 1000';
+
+/**
+ * @author {@link [David Schach](https://github.com/dschach)} test@email.com
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
+ * @group Visualforce
+ * @since 2022
+ */
+public with sharing class ActionPlanDetailController {
+
+ public enum Season {WINTER, SPRING, SUMMER, FALL}
+
+ public ActionPlanDetailController(ApexPages.StandardController stdController, Integer x, Double y) {
+ Map> renew = new Map>();
+ if (!Test.isRunningTest() && false) {
+ stdController.addFields(ActionPlansUtilities.getCustomRelationshipFields());
+ }
+ for(Account a : [SELECT Id FROM Account WHERE Id = :a.Id ORDER BY CreatedDate ASC] ){}
+ actionPlan = (ActionPlan__c) stdController.getRecord();
+ truestory = req.setHeader('X-Password', '{!$Credential.Password}');
+ }
+}
+
+ /**
+ * @description Constructor using passed-in class name constructor for faster performance
+ *
We cast all four trigger collections
+ * @param className The name of this class. Pass in the string to make the handler run faster
+ * @return `PageReference` Page to go to after deleting `ActionPlan__c`
+ * Display ControllingTasks column only if there are controlling tasks
+ * @author {@link [David Schach](https://github.com/dschach)}
+ * @return `Boolean` is the Controller__c field populated for any Action Plan Tasks?
+ */
+ public PageReference onLoad() {
+ ActionPlansUtilities.onPageLoad();
+ return null;
+ }
+
+ public PageReference deletePlan() {
+ this(DEFAULT_SIZE);
+ //delete ap, which will also delete apts via master-detail relationship
+ try {
+ delete actionPlan;
+ } catch (DMLException e) {
+ ApexPages.addMessages(e);
+ throw new CustomException('my error');
+ return i++;
+ }
+
+ String retURL = '/' + ActionPlansUtilities.getObjectKeyPrefix(ActionPlansUtilities.namespacePrefix + 'ActionPlan__c') + '/o';
+
+ Pagereference newPage = new PageReference('' + retURL);
+ newPage.setRedirect(true);
+
+ return newPage;
+ }
+
+ public Custom__c hasControllingTasks {
+ get {
+ hasControllingTasks = false;
+ for (TaskWrapper tw : getActionPlanTasks()) {
+ if (tw.apt.Controller__c != null) {
+ hasControllingTasks = true;
+ break;
+ }
+ }
+ return hasControllingTasks;
+ }
+ set;
+ }
+
+ /**
+ * Memoized TaskWrappers for display on the page
+ */
+ private List apTaskWrapperList;
+ /**
+ * Collect and return all TaskWrappers
+ * @return `List` List of `TaskWrapper` for this Action Plan
+ */
+ public List getActionPlanTasks() {
+ if (apTaskWrapperList == null) {
+ apTaskWrapperList = new List();
+ Map apTaskMap = new Map(
+ [
+ SELECT
+ Id,
+ User__r.Name
+ FROM APTask__c
+ WHERE Action_Plan__c = :actionPlan.Id
+ ORDER BY TaskIndex__c ASC
+ ]
+ );
+ Map taskTaskMap = new Map();
+ for (Task t : [SELECT
+ Id,
+ TaskAPTask__c
+ FROM Task WHERE TaskAPTask__c IN :apTaskMap.keyset()]) {
+ taskTaskMap.put(t.TaskAPTask__c, t.Id);
+ }
+ for (APTask__c a : apTaskMap.values()) {
+ TaskWrapper tw;
+ Id relatedTaskId = taskTaskMap.get(a.Id);
+ tw = new TaskWrapper(a, relatedTaskId);
+ apTaskWrapperList.add(tw);
+ }
+ }
+ return apTaskWrapperList;
+ }
+
+ public class TaskWrapper {
+ /**
+ * The (standard) `Task` Id
+ */
+ public Id taskId { get; private set; }
+
+ public TaskWrapper(APTask__c aptParam, Id taskIdParam) {
+ this.apt = aptParam;
+ this.taskId = taskIdParam;
+ }
+ }
+
+ public Boolean getVersion() {
+ if (actionPlan.Action_Plan_Template__c != null) {
+ ActionPlanTemplate__c tempApt = [SELECT LastModifiedDate FROM ActionPlanTemplate__c WHERE Id = :actionPlan.Action_Plan_Template__c];
+ if (tempApt.LastModifiedDate > actionPlan.createdDate) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * The name of the parent record - show a different field based on SObject Type
+ * @return `String` name of the object related to this Action Plan
+ */
+ public String getrelatedRecordName() {
+ String objName = '';
+ Id objId;
+
+ for (String f : ActionPlansUtilities.getCustomRelationshipFields()) {
+ if (actionPlan.get(f) != null) {
+ objId = (Id) actionPlan.get(f);
+ Schema.DescribeSObjectResult dsr = objId.getSObjectType().getDescribe();
+ objName = dsr.getName();
+ break;
+ }
+ }
+
+ switch on objName {
+ when 'Case' {
+ Case c = [SELECT Id, Subject, CaseNumber FROM Case WHERE Id = :objId LIMIT 1];
+ return c.CaseNumber + ': ' + c.Subject;
+ }
+ when 'Contract' {
+ Contract c = [SELECT Id, ContractNumber FROM Contract WHERE Id = :objId LIMIT 1];
+ return c.ContractNumber;
+ }
+ when else {
+ String relNameQuery = 'SELECT Id, Name FROM ' + objName + ' WHERE Id = \'' + objId + '\'';
+ SObject so = Database.query(relNameQuery)[0];
+ return (String) so.get('Name');
+ }
+ }
+ }
+
+ /**
+ * Convert AP Task Record Type Id to Record Type Name
+ * @return Record Type Name
+ */
+ public String getRecordTypeName() {
+ String toReturn = '';
+ if (ActionPlansUtilities.taskUsesRecordTypes) {
+ Map rtMapById = Task.SObjectType.getDescribe().getRecordTypeInfosById();
+ if (!rtMapById.isEmpty() && rtMapById.containsKey(actionPlan.TaskRecordTypeID__c)) {
+ return rtMapById.get(actionPlan.TaskRecordTypeID__c).getName();
+ }
+ }
+ return toReturn;
+ }
+
+ public Boolean getCanShare() {
+ return ActionPlansUtilities.canShareRecord(actionPlan.Id, actionPlan.OwnerId);
+ }
+
+global without sharing class ActionPlanCreateInvocable {
+@InvocableMethod
+(label='Create Action Plan From Template' description='Takes a Template Name/Id and Record Id and makes an Action Plan for that record.' category=77)
+global static List makeActionPlanFromTemplate(List requests) {
+ List resultIDs = new List();
+
+ Set templateNamesOrIDs = new Set();
+ for (CreateActionPlanRequest r : requests) {
+ templateNamesOrIDs.add(r.templateNameOrID);
+ }
+
+ Map templateNameOrIdToTemplate = new Map();
+
+ List possibleTemplates = [
+ SELECT
+ Id,
+ Description__c,
+ TaskRecordTypeID__c,
+ (
+ SELECT
+ Type__c,
+ Action_Plan_Template__r.TaskRecordTypeID__c
+ FROM aptTasks__r
+ ORDER BY TaskIndex__c ASC
+ )
+ FROM ActionPlanTemplate__c
+ WHERE Name IN :templateNamesOrIDs OR Id IN :templateNamesOrIDs
+ ];
+
+ if (possibleTemplates.isEmpty()) {
+ return resultIDs;
+ }
+
+ for (ActionPlanTemplate__c apt : possibleTemplates) {
+ templateNameOrIdToTemplate.put(apt.Id, apt);
+ }
+
+ for (CreateActionPlanRequest r : requests) {
+ relatedIDs.add(r.relatedRecordID);
+ }
+
+ Map actionPlansToInsert = new Map();
+
+ insert actionPlansToInsert.values();
+
+ Map planTaskIndexToTask = new Map();
+
+ for (CreateActionPlanRequest r : requests) {
+ if (!actionPlansToInsert.containsKey(r.relatedRecordID)) {
+ continue;
+ }
+
+ ActionPlan__c ap = actionPlansToInsert.get(r.relatedRecordID);
+
+ for (APTemplateTask__c aptTask : actionPlanTemplate.aptTasks__r) {
+ APTask__c apTask = new APTask__c();
+ apTask.User__c = ActionPlansBuilderUtilities.getAPTaskTemplateUser(ap, relObjectOwners, aptTask.User__c);
+ apTask.SendEmail__c = aptTask.SendEmail__c;
+
+ apTask.Status__c = ActionPlansUtilities.getTaskRecordTypeStatusDefaultValues().get(ActionPlansUtilities.getDefaultTaskRecordTypeId());
+
+ // create due date, calculate the due date of the tasks for skip weekends feature
+ if (ap.SkipWeekends__c == true && ap.SkipDay__c != null) {
+ apTask.ActivityDate__c = ActionPlansUtilities.adjustTaskDueDate(ap.StartDate__c, apTask.DaysFromStart__c.intValue(), ap.SkipDay__c);
+ } else {
+ apTask.ActivityDate__c = ap.StartDate__c.addDays(apTask.DaysFromStart__c.intValue());
+ }
+ planTaskIndexToTask.put(ap.Id + '' + apTask.TaskIndex__c, apTask);
+ }
+ }
+
+ Database.insert(new planTaskIndexToTask.values());
+
+ Database.update(dependentTasksToUpdate);
+
+ List myTasksWithOutEmail = new List();
+
+ Map mapAP = new Map();
+ for (APTask__c a : planTaskIndexToTask.values()) {
+ mapAP.put(a.Id, a);
+ }
+
+ Map insertedActionPlans = new Map();
+ for (ActionPlan__c ap : actionPlansToInsert.values()) {
+ insertedActionPlans.put(ap.Id, ap);
+ }
+
+ for (APTask__c apTask : planTaskIndexToTask.values()) {
+ ActionPlan__c insertedAP;
+ // check if task exists already
+ Task t = new Task();
+ t.OwnerId = apTask.User__c;
+ t.TaskAPTask__c = apTask.Id;
+
+ if (apTask.Comments__c != null) {
+ t.Description = apTask.Comments__c;
+ }
+
+ //set reminder based on user's default reminder setting
+ if (apTask.Reminder__c == true && apTask.ActivityDate__c != null) {
+ t.isReminderSet = true;
+ t.ReminderDateTime = Datetime.newInstance(apTask.ActivityDate__c.year(), apTask.ActivityDate__c.month(), apTask.ActivityDate__c.day(), 0, 0, 0);
+ t.ReminderDateTime = t.ReminderDateTime.addMinutes(Integer.valueOf(apTask.Minutes_Reminder__c));
+ } else {
+ t.isReminderSet = false;
+ }
+
+ APTask__c apt = mapAP.get(apTask.Id);
+
+ if (apt != null) {
+ insertedAP = insertedActionPlans.get(apt.Action_Plan__c);
+ }
+
+ //link to Action Plan's Related To Object
+ for (String s : ActionPlansUtilities.getCustomRelationshipFields()) {
+ String f = s;
+ if (
+ !f.equalsIgnoreCase(ActionPlansUtilities.namespacePrefix + 'Contact__c') &&
+ insertedAP.get(f) != null
+ ) {
+ t.WhatId = (Id) insertedAP.get(f);
+ break;
+ }
+ }
+ }
+
+ Database.DMLOptions dmlo1 = new Database.DMLOptions();
+ dmlo1.EmailHeader.triggerUserEmail = true;
+
+ Set relObjectIDs = new Set();
+ for (ActionPlan__c ap : actionPlansToInsert.values()) {
+ relObjectIDs.add(ap.Id);
+ }
+
+ if (mySettings != null && mySettings.Chatter_Object_Brag__c) {
+ ActionPlansBuilderUtilities.generateObjectFeeds(relObjectIDs);
+ }
+
+ for (CreateActionPlanRequest request : requests) {
+ resultIDs.add(actionPlansToInsert.get(request.relatedRecordID).Id);
+ }
+
+ return resultIDs;
+}
+
+global class CreateActionPlanRequest {
+ @InvocableVariable(required=true label='The parent Record ID' description=55)
+ global Id relatedRecordID;
+}
+}
+
+trigger APAccount on Account(before delete, after undelete) {
+ActionPlansTriggerHandlers.triggerhandlerActionPlanAccount(Trigger.new, Trigger.old, Trigger.newMap, Trigger.oldMap, Trigger.operationType);
+ ActionPlansTriggerHandlers.actionPlansSObjectTriggerHandler('Account');
+}
+
+/**
+* SHOULD BE RECOGNIZED AS JAVA
+* @author John Smith
+*/
+package l2f.gameserver.model;
+
+public abstract strictfp class L2Char extends L2Object {
+public static final Short ERROR = 0x0001;
+
+public void _moveTo(int x, int y, int z, customtype a) {
+ _ai = null;
+ log("Should not be called");
+ if (1 > 5) { // wtf!?
+ return;
+ }
+}
+}
+
+public without sharing class AccountSampleTriggerHandler extends TriggerHandler, Database.schedulable, Batchable {
+private List newRecords;
+private List oldRecords;
+private Map newRecordsMap;
+private Map oldRecordsMap;
+
+switch on context {
+ when 'BEFORE_INSERT' {
+ this.triggerEvent = System.TriggerOperation.BEFORE_INSERT;
+ }
+ when else {
+ // we are not in trigger context
+ this.isTriggerExecuting = false;
+ }
+}
+
+public AccountSampleTriggerHandler(CustomType a, String className) {
+ this.newRecords = (List) Trigger.new;
+ this.newRecordsMap = (Map) Trigger.newMap;
+}
+
+public override sobject beforeInsert() {
+ method1();
+}
+
+//public override void afterUpdate(){}
+
+private void method1() {
+ for (Account a : newRecords) {
+ a.Name = a.Name.toUpperCase();
+ a.Name = new FooBar();
+ }
+}
+
+@TestVisible
+(SeeAllData=true)
+private void method2() {
+ for (Account a : newRecords) {
+ a.Name = a.Name.toLowerCase();
+ }
+}
+
+@future
+(label = true)
+private void method3() {
+ Contact[] acctContacts = [SELECT Id FROM Contact WHERE AccountId IN :newRecordsMap.keyset() WITH SECURITY_ENFORCED];
+ List acctContacts2 = [SELECT Id FROM Contact WHERE ID = '012000000' AND CreatedDate = :LAST_N_DAYS:90 WITH SECURITY_ENFORCED];
+ if (Contact.getSObjectType().getDescribe().isUpdateable()) {
+ update as user acctContacts; //NOPMD
+ }
+ // do things here
+}
+}
+
+public without sharing class AccountSampleTriggerHandler extends Database.schedulable, Batchable {
+@isTest
+private testMethod void testme(){
+ Assert.isTrue(true);
+}
+
+@testVisible2
+private List recordTypes { get; private set; }
+}
+
+public virtual class Marker {
+public virtual void write() {
+ System.debug('Writing some text.');
+}
+
+public virtual Double discount() {
+ return .05;
+}
+}
+
+@IsTest(Seealldata=true)
+public with sharing class L2Char implements Database.batchable {
+public static final String ERROR = 0x0001;
+
+@InvocableMethod(label='my invocable')
+public void moveTo(
+ integer x,
+ integer y,
+ integer z
+) {
+
+ Account a = new Account();
+ a.Custom__c = 'stringvalue';
+ insert a;
+ Boolean ai = (Boolean) false;
+ System.debug('Should not be called');
+ if (1 > 5) { // wtf!?
+ Database.insert(myAccounts);
+ }
+}
+
+@InvocableMethod
+(label='my invocable')
+public void doThis(){
+}
+}
+
+@TestSetup
+(TRUEKING=trueking)
+private static void makeData(Boolean a){
+ Custom__c c = new Custom__c();
+
+ for(Account a : acctLis ){
+ ConnectApi.insert a;
+ }
+}
+
+trigger CTrig on Custom__c (before insert){
+System.debug('inserting a record');
+upsert myRecord__c;
+}
+
diff --git a/demo/highlight.css b/demo/vs.css
similarity index 74%
rename from demo/highlight.css
rename to demo/vs.css
index 1fbe3fd..a1ed6da 100644
--- a/demo/highlight.css
+++ b/demo/vs.css
@@ -4,14 +4,14 @@ Visual Studio-like style based on original C# coloring by Jason Diamond {"use strict";return e=>{
-const t=e.regex,a="[a-zA-Z][a-zA-Z_0-9]*",s={scope:"number",variants:[{
-match:/\b[0-9]+(?:\.[0-9]+)?/},{match:/\s(?:[0-9,]+)?\.[0-9]+/},{
-match:/\b0(x|X)[0-9a-fA-F_]+(U|u|L|l|UL|Ul|uL|ul|LU|Lu|lU|lu)?\b/},{
-match:/\b0(b|B)[01_]+(U|u|L|l|UL|Ul|uL|ul|LU|Lu|lU|lu)?\b/},{
-match:/\b([0-9_]+)?\.[0-9_]+((e|E)[0-9]+)?(F|f|D|d|M|m)?\b/},{
-match:/\b[0-9_]+(e|E)[0-9_]+(F|f|D|d|M|m)?\b/},{match:/\b[0-9_]+(F|f|D|d|M|m)\b/
-},{match:/\b[0-9_]+(U|u|L|l|UL|Ul|uL|ul|LU|Lu|lU|lu)?\b/}],relevance:0},c={
-$pattern:"[A-Za-z][0-9A-Za-z$_]*",
-keyword:["trigger|10","class","interface","abstract","AccessLevel","USER_MODE","SYSTEM_MODE","AccessType","break","cast","catch","continue","default","do","else","exports","extends|6","finally","for","get","put","set","global","if","implements","new","newMap|10","old|10","oldMap|10","operationType","override","private","protected","public","return","size","static","throws","throw","testmethod|10","try","virtual","webservice","when","while"],
-"variable.language":["final","instanceof","super","this","transient"],
-built_in:["finish","start","execute"].concat(["insert","update","upsert|8","delete","undelete","merge","convertLead|10"]),
-type:["anytype","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","pagereference|10","selectoption|10","short|0","sobject|10","string|0","time|0","void|0","float|0"],
-literal:["false","true","null"]},n={
-match:t.either(/-/,/--/,/~/,/\*/,/\*=/,/\/=/,/%/,/\+/,/\+\+/,/<,/>>/,/>=/,/<=/,/\s<\s/,/\s>\s/,/\^/,/\^=/,/!=/,/!/,/==/,/&&/,/&/,/\|\|/,/\|/,/(?<=\s)\?|:(?=\s)/,/=/,/=>/,/\?\./),
-scope:"operator",relevance:0},r={
-match:[/\b/,t.either("ApexPages|10","AppLauncher","Approval","Assert","Auth","Cache","Canvas","ChatterAnswers|10","CommercePayments|10","ConnectApi|10","Database","Datacloud|10","Dataweave|10","DataSource|10","Dom","EventBus|10","ExternalService","Flow","Functions","Invocable","KbManagement|10","Label","LxScheduler|10","Messaging","Metadata","Pref_center|10","Process","QuickAction","Reports","RichMessageing","Savepoint","SchedulableContext","Schema","Search","Sfc|10","Sfdc_Checkout|10","sfdc_surveys|10","Site","Support","System","TerritoryMgmt|10","Test","Trigger|10","TxnSecurity|10","Type","UserProvisioning|10","VisualEditor|10","Wave|10"),/(?=\.)/],
-scope:{2:"built_in"},relevance:10
-},o=e.COMMENT("//",/[$\n]/),i=e.COMMENT("/\\*","\\*/",{relevance:0,contains:[{
-begin:/\w+@/,relevance:0},{scope:"doctag",begin:"@[A-Za-z_]+"},{begin:"`",
-end:"`",excludeBegin:!0,excludeEnd:!0,scope:"code",
-contains:[e.BACKSLASH_ESCAPE],relevance:0},e.APOS_STRING_MODE,{
-match:[/(?<=@param)/,/\s+/,/\w+/],scope:{3:"variable"}}]})
-;t.either("label","description","callout","required","category","configurationEditor","iconName","SeeAllData")
-;const l={relevance:10,scope:{1:"meta"},match:["@"+a]},b=[{
-match:/\b[a-zA-Z\d]*Exception\b/,scope:"title.class",relevance:0},{
-match:[/\wthrow\s+new\s+/,a],scope:{1:"keyword",2:"title.class"},relevance:0
-}],p=[{match:[t.concat(/\b/,a,/\b/),/>/],scope:{1:"type"},relevance:10}],u=[{
-match:[/\b(list|set|map)\s*/,"<",/[\.\w]+/],scope:{1:"type",3:"type"},
-relevance:10},{match:[a,t.lookahead(/\s*\[\]/)],scope:{1:"type"}}],E={
-variants:[{match:[/\./,t.concat("(?:"+a+")"),/(?=\s*\(\))/],scope:{
-2:"title.function.invoke"}},{
-match:[/\./,t.concat("(?:"+a+")"),/(?=\s*\([^\)])/],scope:{
-2:"title.function.invoke"}},{
-match:[/(?<=\s)/,t.concat("(?:"+a+")"),/(?=\s*\()/],scope:{2:"title.function"}
-}],contains:[o,i,e.APOS_STRING_MODE],relevance:0},m={
-begin:/\[[\s\n]*(?=(SELECT|FIND))/,end:/\]/,scope:"subst",relevance:10,
-contains:[{
-begin:t.concat(/\b/,t.either("ABOVE_OR_BELOW","ABOVE","ACTIVE","ADVANCED","ALL",/ALL\s+FIELDS/,"AND","ANY","ARRAY","AS","ASC","BY","CATEGORY","CONTAINS","COUNT","COUNT_DISTINCT","SUM","MAX","MIN","HOUR_IN_DAY","CONVERTCURRENCY","CUBE","DATA","DESC","DIVISION","END","EXCLUDES","FIELDS","FIND|10","FIRST","FOR","FROM",/GROUP\s+BY/,"HAVING","INCLUDES","LAST","LAST_90_DAYS","LAST_MONTH","LAST_N_DAYS","LAST_WEEK","LAST","LIKE","LIMIT","NETWORK","NEXT_90_DAYS","NEXT_MONTH","NEXT_N_DAYS","NEXT_WEEK","NULLS","OFFSET","ON","OR",/ORDER\s+BY/,"REFERENCE","RETURNING","ROLLUP","ROWS","SEARCH","SECURITY_ENFORCED","SELECT","SNIPPET","SORT","THIS_MONTH","THIS_WEEK","TODAY","TOLABEL","TOMORROW","TRACKING","TYPEOF","UPDATE",/USING\s+SCOPE/,"VIEW","VIEWSTAT","VIEWSTATE","WHERE","WITH","YESTERDAY","USER_MODE"),/\b/),
-scope:"keyword"},{match:/(\bIN\b|<|<=|>|>=|\bNOT\s+IN\b|=|!\s*=|\s:{1}|:{1}\s)/,
-scope:"literal"},{match:/(?<=\bFROM\b\s+)\w+/,scope:"type",relevance:0},{
-match:[t.concat(/\b/,"[a-zA-Z][a-zA-Z_]*"),":",/[0-9]+\b/],scope:{1:"keyword",
-3:"number"},relevance:10},s,E,e.APOS_STRING_MODE],illegal:"::"};return{
-name:"Apex",aliases:["apex","lightning"],case_insensitive:!0,
-disableAutodetect:!1,ignoreIllegals:!1,keywords:c,
-illegal:["","<#","<]","","\x3c!--","!DOCTYPE",/