---
schema_version: "1"
id: 8e8b4e371d09b3198e352a0f922fceb5703cc8c37911b395cfd1f3e27f5f4531
title: Source Code Editor
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/code_dev_console_view_code_editor.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.code_dev_console_view_code_editor.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 20e86a67a6101e62c6a46853d527f3397388614f4143f00afdc689d963e9c553
description: The Developer Console includes a Source Code Editor with a collection of features for editing Apex and Visualforce code.
products:
  - Salesforce Platform
release: "264"
---
# Source Code Editor

The Developer Console includes a Source Code Editor with a collection of features for editing Apex and Visualforce code.

All code files, including Apex classes and triggers, and Visualforce pages and components, open in the Source Code Editor in the Developer Console workspace.

![Developer Console code editor view](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_code-264-0-0-production-enus/789bc523-706b-4ae4-8fe9-be6322e38b6b/extend_code/images/code_dev_console_view_code_editor.png)

The syntax highlighting in the Source Code Editor calls out comments, numbers, strings, [reserved keywords](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_reserved_words.htm), [primitive data types](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/langCon_apex_primitives.htm), variable declarations, and references. To access code search, press CTRL+F.

After you implement testing, you can view line-by-line code coverage in the Source Code Editor. The Source Code Editor also lets you set checkpoints to troubleshoot without updating your code.

To toggle between the Source Code Editor and a full screen editor (if available), press F11.

## Setting Source Code Editor Preferences

You can choose the font size and display theme for the Source Code Editor. Click **Help** | **Preferences** to access the Preferences dialog.

![Editor preferences dialog](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_code-264-0-0-production-enus/789bc523-706b-4ae4-8fe9-be6322e38b6b/extend_code/images/code_dev_console_editor_prefs.png)

Select an Editor Theme to preview it.

The Preferences window includes additional configuration options based on your permissions and implementation. These include enabling code completion and Logs Tab.

Click **Save** to update your settings and close the window.

## Navigating to Method and Variable Declarations

You can navigate directly to a method or variable declaration, rather than having to scroll or search to find it.

- Mouse over a method or variable name. If the method or variable name is underlined, you can navigate to its declaration.
- Click in an underlined method or variable name.
- Press CTRL+ALT+N or click **Go To** to move the cursor to the declaration. If the declaration is in another file, the file opens in a new tab.

## Using Search and Replace

Use the following keyboard shortcuts to search and replace text within the current view. To search files that are not open in the current view, click **File** | **Search in Files** or press CTRL+SHIFT+H.

Function Shortcut Notes Search CTRL+F Opens an active search form. Replace CTRL+SHIFT+F Opens a dialog that prompts you for the search term and then the replacement term, then lets you confirm or reject each change. Replace all CTRL+SHIFT+R Opens a dialog that prompts you for the search term and then the replacement term, then lets you confirm or reject the universal change.

## Using Code Completion

The Source Code Editor provides auto-complete suggestions while you are writing code.

In Visualforce pages and components, auto-complete appears automatically as you type.

## Validating Changes in Source Code: Problems Tab

Changes you make in the Source Code Editor are compiled and validated in the background. While you’re editing code, an error indicator appears on lines with errors, and the **Problems** tab in the lower panel shows the details of compilation errors. To collapse the **Problems** tab, use the ![Collapse down button](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_code-264-0-0-production-enus/789bc523-706b-4ae4-8fe9-be6322e38b6b/extend_code/images/code_dev_console_button_collapse_down.png) button in the corner of the panel.

When source views are validated, all modified sources are validated together instead of individually. Changes that might be inconsistent with code on the server, but are consistent when validated as a group—such as adding a method in one file and calling that method in another—will not be reported as errors.

## Changing the API Version

Use the **API Version** list at the top of the Source Code Editor to change the version of the current entity. The list includes the five most recent API versions plus the current version of the entity.

## Saving Changes

When you make changes in the Source Code Editor, the name of the tab includes a “\*” to indicate unsaved changes. Apex classes and triggers are saved with the current API version of the class or trigger.

To save a collection of changes with dependencies, click **File** | **Save All** or CTRL+S+SHIFT. All open tabs with modifications are saved together in one request.

When you save modified source views, they are validated against all saved source files. If source files have related changes, it is not possible to save the files individually. If there are any compilation errors, you will not be able to save. Review the **Problems** panel, correct any errors, and click **Save** again.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_code-264-0-0-production-enus/789bc523-706b-4ae4-8fe9-be6322e38b6b/images/icon_note.png)

Note You can’t edit and save Apex classes in a production organization.

## Staying in Sync with Code in the Cloud

The Developer Console tracks changes made to the source by other users while you have a file open. If you haven’t made any changes, your view will be updated automatically. If you’ve made modifications, you won’t be able to save them to the server. You’ll see an alert that another user has made changes, with the option to update the source view to the latest version.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_code-264-0-0-production-enus/789bc523-706b-4ae4-8fe9-be6322e38b6b/images/icon_note.png)

Note If you choose to update to the latest version of a file, your changes will be overwritten. Copy your version out of the source view to preserve it, then update to the latest version and integrate your modifications.

#### See Also

- [The Developer Console User Interface](https://help.salesforce.com/s/articleView?id=platform.code_dev_console_navigating.htm&release=264.0.0&type=5 "The Developer Console includes a collection of useful tools for coding, debugging, and testing applications.")
- [Checking Code Coverage](https://help.salesforce.com/s/articleView?id=platform.code_dev_console_tests_coverage.htm&release=264.0.0&type=5 "The Developer Console retrieves and displays code coverage information from your organization. Code coverage results come from any tests you’ve run from an API or from a user interface (for example, the Developer Console, the Salesforce Extensions for Visual Studio Code, or the Application Test Execution page).")
- [Set Checkpoints in Apex Code](https://help.salesforce.com/s/articleView?id=platform.code_dev_console_checkpoints_setting.htm&release=264.0.0&type=5 "Use Developer Console checkpoints to debug your Apex classes and triggers. You can’t set checkpoints in Visualforce markup.")
- [Developer Console File Menu](https://help.salesforce.com/s/articleView?id=platform.code_dev_console_menu_file.htm&release=264.0.0&type=5 "The Developer Console File menu allows you to manage your Apex triggers and classes, Visualforce pages and components, and static resources (text, XML, JavaScript, or CSS). It includes these options.")