IDE Code Editor
Atlas has a fully functional and feature rich editor to aid you in creating your models. There is a lot of functionality designed to make your life as a modeler easier, so below is a breakdown of what the Atlas editor can do for you.
Code analysis runs in the background every time you save a document. The editor supports several different linters that perform this function, the default being Pylint. The result of this code analysis will be indicated as either yellow or red lines in your model files with corresponding details being listed in the Problems view. Yellow lines are for warnings,
and red lines are for errors.
You can either read the message behind the warning or error in the Problems view, or hover over the red or yellow line to get contextual information in a pop-up list.
The editor supports two very seamless ways of finding specific elements of your model. First, if you highlight a given word or line of text, every match of that text will become highlighted as well. This will quickly show you everywhere that particular bit of text is used.
The other way is an explicit search. By pressing the hotkey Ctrl+F the editor will bring up the in-editor search box.
Enter any term you would like to search for, search with case sensitivity on or off, search by whole word or by exact text match, even use regular expressions! It will also show you how many matches you have and allow you to go to the next or previous one by using the up or down arrows. The current match you are viewing will show up in the editor as highlighted in grey, all others will be highlighted in orange.
Find and Replace in File
Using this search functionality also allows you to replace text in the file you are viewing, either instance by instance, or in bulk. Expand the search view with the '>' button and type the replacement in the box provided.
One of the things that separates good editors from the rest of the crowd is syntax highlighting. This will help you distinguish between comments, text, functions, keywords, and other code elements. It makes your models much easier to read and maintain and Atlas supports rich syntax highlighting for a number of different languages.
The editor supports many models and/or other files being open at once. Each is given it’s own tab and you can see which one is active by a visual change in the tab header. The active tab will have the same background as the editor, while all other tabs will be grey.
In addition to this, you can see that the editor tab has focus when the header text of the active file turns white. This means that the editor has been selected.
The minimap gives you a high level view of your code and its visual structure. It can be toggled on/off by pressing F1 and then searching for minimap in the box that comes up.
The minimap shows you your entire code file, with syntax highlighting applied. Comments are represented by red highlighted lines. You can navigate your document by clicking anywhere on the minimap, or by clicking and dragging the viewable box up or down.
Right-Click Context Menu
The right-click context menu has a lot to offer the user for code navigation and operation.
There are several ways to navigate through the code elements within your model. These are represented by different ways you can Go To a specific element in your model, whether it be a function definition or variable declaration.
Selecting this option will take you to where that code symbol was declared.
Selecting this option will take you to where this function was defined.
Selecting this option will present you with a list of symbols that you can choose from. Upon selecting a symbol, it will navigate you to it in the model code.
Selecting this option will take you to where the type of that particular code symbol is defined.
Peeking is different from Go To in that it will not navigate you to a particular point in your model code, it will show you the relevant information in a pop-up, so you don’t need to worry about navigating away from where you are.
Peek at the declaration of a code symbol.
Peek at the definition of a function.
This will show you everywhere a symbol is referenced.
Change All Occurrences
This will highlight all occurrences of a line of text and allow you to change them all at once. You will notice that as you start typing the new value, all occurrences will update at once. This does not conform to an actual code symbol, but everything that matches the text selected.
This will format your document according to our default style guide. It will do things like create new lines for lines of code that are too long, properly space comments, properly indent lines of code, and so on. This is a great way to quickly make your code a consistent format.
This will apply the same default formatting to a selection of code.
This allows the Editor to suggest ways for you to refactor particular parts of your code. For instance, if you have a block of code that can be extracted into a method you can select the code, then select this option to perform that action.
This will allow you to rename a symbol and all instances of that symbol will be renamed to match. This is different than Change All Occurrences in that it is linked to how the code is used, so if you have a variable in a different scope that is named the same thing, it will not be renamed because it is technically a different symbol.
This action will provide you with a list of actions that you can take in the entirety of your model file source code. You can then select any action you would like to take to have it automatically applied.
This will allow you to undo or redo editing actions within the code. These can also be done via the hotkeys CTRL+Z and CTRL+SHIFT+Z respectively.
These allow you to perform the actions as they are named for duplicating or moving text. These can also be done via the hotkeys CTRL+X, CTRL+C and CTRL+V respectively.