ObjectiveThe aim of Simplificy is to simplify the work of project developers at Efficy by adding to VSCode some shortcuts and commands related to Efficy. SetupThis extension has been originally designed to work with at most one custom folder and one standard Efficy folder in your VSCode workspace. However, you can work with as many custom folders and standard versions as you like at the same time. For this extension to work as expected, always start by opening your custom folder in an empty workspace. You can then add as many custom folders as you wish. Features1. Efficy API auto-completion
Type Efficy. to see all of the methods available. Switch between parameters by pressing the Tab key. This functionality is built upon a foundational snippet made by Gaëtan Warin and has been improved and expanded for Simplificy. 2. Define Custom Folder
Hit Ctrl+Shift+P and search for Efficy Enterprise > Define Custom Folder. If there is a single custom folder in your workspace, it will automatically be picked by Simplificy. Simplificy has been designed to work with branches or the trunk, not with the root folder. 3.1 Add Standard Efficy Folder
Right Click on VSCode's explorer to see the command Efficy Enterprise > Add Standard Folder. This shortcut will automatically search for the matching standard Efficy folder to add to your Workspace. If you do not have a custom Efficy folder in your workspace before using this command, an error message will be displayed: 3.2 Add Standard Lib Folder
Right Click on VSCode's explorer to see the command Efficy Enterprise > Add Standard Lib Folder. This shortcut will automatically search for the matching standard Lib folder to add to your Workspace. If you do not have a custom Efficy folder in your workspace before using this command, an error message will be displayed. 3.3 Add Standard Conficy Folder
Right Click on VSCode's explorer to see the command Efficy Enterprise > Add Standard Conficy Folder. This shortcut will automatically search for the matching standard Conficy folder to add to your Workspace. If you do not have a custom Efficy folder in your workspace before using this command, an error message will be displayed. 3.4 Add Standard Extranet Folder
Right Click on VSCode's explorer to see the command Efficy Enterprise > Add Standard Extranet Folder. This shortcut will automatically search for the matching standard Extranet folder to add to your Workspace. If you do not have a custom Efficy folder in your workspace before using this command, an error message will be displayed. 4. Reveal Standard File
Right-click on a file from your custom Efficy folder and select the command Efficy Enterprise > Reveal Standard File. This command will automatically open in a new tab the Standard file according to your custom folder version. You can also trigger this command with the keyboard shortcut Ctrl+Alt+F: This shortcut will use the currently opened file to find the Standard one. If the file is not found in Efficy standard, an error message is displayed: 5. Search In Standard
Right-click on a text selection from your custom code and select the command: Efficy Enterprise > Search in Standard Folder. This command will search for the current selection text in the Efficy standard folder only. In order to use this command, you will need to add a standard Efficy folder to your workspace via the Efficy Enterprise > Add Standard Folder command. Otherwise, the following error will be displayed: 6. Customize File
Right-click on a file from your standard Efficy folder and select the command: Efficy Enterprise > Customize File. This command will check if you already customized the selected standard file. If so, it will open your custom file. Otherwise, it will create the file and its missing folder structure. 7. Install ProjUtils
Right-click on your file explorer from VSCode and select the command: Efficy Enterprise > Install ProjUtils > Basic Package / Designer Plugin. This command will automatically download the corresponding ProjUtil into your custom folder and install it. 8. Start DataSynchro
Right-click on your file explorer from VSCode and select the command: Efficy Enterprise > Start DataSynchro. This command will ask you to choose a DataSynchro program utility which will be copy-pasted to your defined custom folder. The missing datasync folder will be created if not existing. If your defined custom folder is not pointing to an SVN root path, Simplificy will search for it on your computer (/customs) and will continue the process from this path. At the end of the process, your DataSynchro utility opens automatically. 9. Create Node API Call
Right-click on your text editor from VSCode and select the command: Efficy Enterprise > Create Node API Call. The missing structure (node/api folders) will be created if not existing. Utils will also be imported to your file if missing. You will then be prompted to pick an existing folder inside of node/api, or create a new one. You can also directly create your endpoint file at any moment. If the file created already exists, an error will be displayed as you see in the GIF above. If you use this command outside of the efficy/js folder scope, an error will be displayed: 10. Open CRM
Right-click on your file explorer from VSCode and select the command: Efficy Enterprise > Open CRM. Note that this will need you to have a customer profile set for your custom. If no customer profile is set, you will be asked to open Alias and Customer Manager: 11. Format SQL
Right-click on your SQL expression from your text editor and select the command: Efficy Enterprise > Format SQL. This command will format your SQL statement to a ready-to-use variable that will keep your statement's syntax indentation. Run this command one more time to get your SQL statement back. 12. Macro Syntax Coloration
Open a macro file to notice syntax coloration. Credits to Stefan Vucinic for originally making this snippet. 13. Imports auto-completion
Auto-completion of files path is triggered by slashes and quotes (simple or double). Auto-completion of imports is also working inside of define/require/requirejs statements: Those are the paths triggering auto-completion for @imports:
Those are the paths triggering auto-completion for define/require/requirejs:
14. Access Custom Import
Place your cursor on the imported file that you want to open or select the full @import statement before running the following command: Efficy Enterprise > Access Custom Import. Note that this command does not work with imports from the standard. 15. Auto-update of require.config
Save a front-end file (efficy/js - efficy/css) to notice the auto update of require's appendSuffixCustom property (js/config/require.config.js). If no require.config.js file is found, Simplificy will ask you if you wish to create it. You can enable or disable this feature from VSCode's Simplificy settings. 16. Context Check Report
Hit Ctrl+Shift+P and search for Efficy Enterprise > Context Check Report. This command will search for every opened/closed context in your custom folder and generate a report for you. You can easily open the files that need to be checked by clicking on them. You can also export the report in a .txt format. This feature is built upon a foundational snippet made by Slim Gaigi which has been improved for Simplificy. 17. Settings
File > Preferences > Settings > Extensions > Simplificy Future features coming
Enjoy!Created and maintained by Julien Bénard |