Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: inline autocomplete and TCG #5263

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
4d10d99
docs: inline autocomplete
sbudhirajadoc Dec 7, 2023
477f4d3
Merge branch 'develop' into sonal/inlineauto
sbudhirajadoc Dec 7, 2023
d51d2de
Update einstein-inline.md
sbudhirajadoc Dec 7, 2023
38135e3
Update einstein-inline.md
sbudhirajadoc Dec 7, 2023
adc947a
Update docs/_articles/en/einstein/einstein-inline.md
sbudhirajadoc Dec 11, 2023
55e1ff9
Update sidebar.yml
sbudhirajadoc Dec 11, 2023
f47a933
Merge branch 'develop' into sonal/inlineauto
sbudhirajadoc Dec 11, 2023
486a3f3
Update einstein-setup.md
sbudhirajadoc Dec 12, 2023
59cb318
Merge branch 'develop' into sonal/inlineauto
sbudhirajadoc Dec 15, 2023
7653208
Merge branch 'develop' into sonal/inlineauto
sbudhirajadoc Dec 15, 2023
884d623
Merge branch 'develop' into sonal/inlineauto
gbockus-sf Dec 18, 2023
28a01c8
Merge branch 'develop' into sonal/inlineauto
sbudhirajadoc Jan 4, 2024
68088f9
Update einstein-setup.md
sbudhirajadoc Jan 4, 2024
be14765
Update einstein-inline.md
sbudhirajadoc Jan 4, 2024
350fb24
Update docs/_articles/en/einstein/einstein-overview.md
sbudhirajadoc Jan 4, 2024
8a5b18e
Update docs/_articles/en/einstein/einstein-overview.md
sbudhirajadoc Jan 4, 2024
4625d68
Update einstein-example-prompts.md
sbudhirajadoc Jan 9, 2024
373937d
Merge branch 'develop' into sonal/inlineauto
sbudhirajadoc Jan 29, 2024
c3a8bb1
Merge branch 'develop' into sonal/inlineauto
sbudhirajadoc Feb 7, 2024
da21608
docs: inline auto and TCG
sbudhirajadoc Feb 21, 2024
9128359
Merge branch 'develop' into sonal/inlineauto
sbudhirajadoc Feb 21, 2024
002f0e1
Merge branch 'develop' into sonal/inlineauto
sbudhirajadoc Feb 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/_articles/en/einstein/einstein-apex.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
title: Apex Code Generation
title: Natural Language to Code Generation
lang: en
---

## Generate Apex Code
## Generate Apex Code from Natural Language Prompts

Use the Einstein for Developers side bar to write a question or an instruction that describes the task for which you'd like to receive an Apex code suggestion and press **Ask**. Copy the code suggestion you received and paste it into an Apex file to use as "starter" code.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we update the screenshot within this section and make it a bit smaller? It has the original issue with the backticks and we've updated the icon recently. Let me know if you need any help grabbing it!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can I get an updated screenshot @AnanyaJha ? Thank you!


Expand Down
37 changes: 37 additions & 0 deletions docs/_articles/en/einstein/einstein-inline.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: Inline Automatic Completions
lang: en
---

## Overview

Use AI-based autocomplete to accept suggestions for repetitive, boilerplate code right in your editor.
sbudhirajadoc marked this conversation as resolved.
Show resolved Hide resolved

## Set Up Inline Autocomplete

To use inline autocomplete, first activate the feature:

1. Select **File** > **Preferences** > **Settings** (Windows or Linux) or **Code** > **Preferences** > **Settings** (macOS).
sbudhirajadoc marked this conversation as resolved.
Show resolved Hide resolved
2. Under **Einstein for Developers**, select **Enable Einstein Auto Completions**.

## Receive your First Inline Completions

Einstein for Developers autogenerates inline code completions suggestions. To start receiving inline completions:
sbudhirajadoc marked this conversation as resolved.
Show resolved Hide resolved

1. In Visual Studio Code, create a new Apex class (\*.cls) file, or open an existing one.

2. In the Apex file, place your cursor inside a method. Einstein for Developers automatically suggests an entire method body in grayed text, as shown below. The exact suggestion may vary.
sbudhirajadoc marked this conversation as resolved.
Show resolved Hide resolved

![Inline Suggestions](./images/einstein-inline-create-account.png)

To accept the entire suggestion, press Tab. If you have VS Code's **Inline Suggest** enabled, you can accept the next word of the suggestion using one of the following keyboard shortcuts:

| Operating System | Accept Next Word |
| ---------------- | ---------------- |
| macOS | ⌘→ |
| Windows | ⌥→ |
| Linux | ⌥→ |

Note: If you don't see a suggestion, make sure Einstein Auto Completions are enabled.

**_Note_**: Use the Option (⌥)\ hotkeys to manually generate autocomplete suggestions if you don't have the auto completions setting enabled.
sbudhirajadoc marked this conversation as resolved.
Show resolved Hide resolved
8 changes: 5 additions & 3 deletions docs/_articles/en/einstein/einstein-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ Einstein for Developers assists you throughout the Salesforce development proces

## Current Capabilities

This release of Einstein for Developers focuses on boilerplate Apex code generation from natural language prompts. This feature, used along with IntelliSense, makes Apex development tooling in Visual Studio Code even richer. Familiarity with Visual Studio Code is assumed.
Use Einstein for Developers to generate boilerplate Apex code from natural language prompts and to automatically receive code completion suggestions inline. Used along with IntelliSense, this feature makes Apex development tooling in Visual Studio Code even richer. Familiarity with Visual Studio Code is assumed.
sbudhirajadoc marked this conversation as resolved.
Show resolved Hide resolved

Use the extension in this release to generate boilerplate code from natural language instructions in a sidebar, so you can work with your editor and the tool side by side, without any interruptions to your workflow. You can also get code suggestions within an existing Apex class, trigger, or anonymous Apex file. Use the VS Code Command Palette to enter a prompt describing what you'd like to build and then generate code suggestions within your editor.
Enter natural language instructions in a sidebar, so you can work with your editor and the tool side by side, without any interruptions to your workflow. You can also get code suggestions within an existing Apex class, trigger, or anonymous Apex file. Use the VS Code Command Palette to enter a prompt describing what you'd like to build and then generate code suggestions within your editor.

**Note**: This tool uses generative AI, which can produce inaccurate or harmful responses. The output generated by AI is often nondeterministic. Before using the generated output, review it for accuracy and safety. You assume responsibility for how the outcomes of Einstein are applied to your organization.
Enable inline autocompletion to automatically receive suggestions as you code.

**Note**: Einstein GPT for Developers uses generative AI, which can produce inaccurate or harmful responses. The output generated by AI is often nondeterministic. Before using the generated output, review it for accuracy and safety. You assume responsibility for how the outcomes of Einstein are applied to your organization.
sbudhirajadoc marked this conversation as resolved.
Show resolved Hide resolved

## Trusted Generative AI at Salesforce

Expand Down
23 changes: 23 additions & 0 deletions docs/_articles/en/einstein/einstein-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,14 @@ The Einstein logo on the activity bar and in the status bar confirms that the ex

![einstein installed](./images/einstein-installed.png)

## Enable or Disable Einstein For Developers

You can enable or disable Einstein for Developers from within Visual Studio Code. The Einstein for Developers status icon in the bottom panel of the Visual Studio Code window indicates whether Einstein for Developers is enabled or disabled. When enabled, the background color of the icon will match the color of the status bar. When disabled, the background color of the icon is brown. The background color of the icon is red when you're connected to an org that doesn't have Einstein for Developers enabled.
sbudhirajadoc marked this conversation as resolved.
Show resolved Hide resolved

To enable or disable Einstein for Developers, click the status icon in the bottom panel of the Visual Studio Code window and then click **Disable**.

![einstein icon](./images/einstein-icon.png)

### Use Einstein for Developers in a Scratch Org

Einstein for Developers is only available in scratch org editions that can author Apex:
Expand Down Expand Up @@ -110,3 +118,18 @@ Create a scratch org using the `SFDX: Create a Default Scratch Org...` command r
Run **Einstein: Show Prompt History** from the Command Palette to open the Feedback console. When opened, you can view a running history of your prompts and associated responses. Use 👍, 👎, and comments for each response to provide us with feedback about the quality of the generated code. Your feedback during this beta is key to helping us improve AI model quality and overall product.

![feedback panel](./images/einstein-feedback.png)

## Keyboard Shortcuts for Einstein for Developers

You can use the default keyboard shortcuts in Visual Studio Code when using Einstein for Developers. You can rebind the shortcuts in the Keyboard Shortcuts editor using your preferred keyboard shortcuts for each specific command. For more information see [Key Bindings for Visual Studio Code](https://code.visualstudio.com/docs/getstarted/keybindings).

You can search for each keyboard shortcut by command name in the Keyboard Shortcuts editor.

| Command | Key Binding |
| ---------------------------------------- | ----------- |
| Accept | ⌘Enter |
| Accept | Tab |
| Clear | Escape |
| Einstein:Generate Code | ⇧⌘R |
| SFDX: Insert Comment for Code Generation | ⌘L |
sbudhirajadoc marked this conversation as resolved.
Show resolved Hide resolved
| Trigger Inline Suggestion | ⌥\ |
35 changes: 35 additions & 0 deletions docs/_articles/ja/einstein/einstein-inline.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
title: Inline Automatic Completions
lang: en
---

## Overview

## Set Up Inline Autocomplete

To use inline autocomplete, you first activate the feature

1. Select **File** > **Preferences** > **Settings** (Windows or Linux) or **Code** > **Preferences** > **Settings** (macOS).
2. Under Einstein for Developers, select **Enable Einstein Auto Completions**.

## Receive your First Inline Completions

Einstein for Developers autogenerates inline completions suggestions. To start receiving inline completions:

1. In Visual Studio Code, create a new Apex class (\*.cls) file, or open an existing one.

2. In the Apex file, place your cursor inside a method. Einstein for Developers automatically suggests an entire method body in grayed text, as shown below. The exact suggestion may vary.

![Inline Suggestions](./images/einstein-inline-create-account.png)

To accept the entire suggestion, press Tab. If you have VS Code's **Inline Suggest** enabled, you can accept the next word of the suggestion using one of the following keyboard shortcuts:

| Operating System | Accept Next Word |
| ---------------- | ---------------- |
| macOS | ⌘→ |
| Windows | ⌥→ |
| Linux | ⌥→ |

Note: If you don't see a suggestion, make sure Einstein Auto Completions are enabled.

**_Note_**: Use the Option (⌥)\ hotkeys to manually generate autocomplete suggestions if you don't have the auto completions setting enabled.
8 changes: 6 additions & 2 deletions docs/_data/sidebar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,13 @@
ja: Set Up Einstein for Developers
url: /einstein/einstein-setup
- title:
en: Use Einstein for Apex Programming
ja: Set Up Einstein for Developers
en: Natural Language to Code Generation
ja: Natural Language to Code Generation
url: /einstein/einstein-apex
- title:
en: Inline Auto Completion
ja: Inline Auto Completion
url: /einstein/einstein-inline
- title:
en: Example Prompts and Responses
ja: Set Up Einstein for Developers
Expand Down
Binary file added docs/images/einstein-icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.