-
Notifications
You must be signed in to change notification settings - Fork 391
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
Closed
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
4d10d99
docs: inline autocomplete
sbudhirajadoc 477f4d3
Merge branch 'develop' into sonal/inlineauto
sbudhirajadoc d51d2de
Update einstein-inline.md
sbudhirajadoc 38135e3
Update einstein-inline.md
sbudhirajadoc adc947a
Update docs/_articles/en/einstein/einstein-inline.md
sbudhirajadoc 55e1ff9
Update sidebar.yml
sbudhirajadoc f47a933
Merge branch 'develop' into sonal/inlineauto
sbudhirajadoc 486a3f3
Update einstein-setup.md
sbudhirajadoc 59cb318
Merge branch 'develop' into sonal/inlineauto
sbudhirajadoc 7653208
Merge branch 'develop' into sonal/inlineauto
sbudhirajadoc 884d623
Merge branch 'develop' into sonal/inlineauto
gbockus-sf 28a01c8
Merge branch 'develop' into sonal/inlineauto
sbudhirajadoc 68088f9
Update einstein-setup.md
sbudhirajadoc be14765
Update einstein-inline.md
sbudhirajadoc 350fb24
Update docs/_articles/en/einstein/einstein-overview.md
sbudhirajadoc 8a5b18e
Update docs/_articles/en/einstein/einstein-overview.md
sbudhirajadoc 4625d68
Update einstein-example-prompts.md
sbudhirajadoc 373937d
Merge branch 'develop' into sonal/inlineauto
sbudhirajadoc c3a8bb1
Merge branch 'develop' into sonal/inlineauto
sbudhirajadoc da21608
docs: inline auto and TCG
sbudhirajadoc 9128359
Merge branch 'develop' into sonal/inlineauto
sbudhirajadoc 002f0e1
Merge branch 'develop' into sonal/inlineauto
sbudhirajadoc File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
title: Automatic Inline Completions | ||
lang: en | ||
--- | ||
|
||
## Overview | ||
|
||
Use AI-based autocomplete to accept suggestions for code as you write it right inside your editor. Inline autocompletions can currently be triggered in Apex, Javascript and HTML files. | ||
|
||
## Enable or Disable Inline Autocomplete | ||
|
||
To enable or disable the Inline autocomplete 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** then select the language for which to enable the feature. | ||
|
||
Inline autocomplete is enabled by default. | ||
|
||
## Receive your First Inline Completions | ||
|
||
Einstein for Developers automatically generates code and suggests completions for you as you type. When writing apex code, you are often doing things like assigning variable values to an `Sobject` such as `Account.name = abc`, or `Account.type = Business`. Pause the cursor after the variable value and watch Einstein for Developers complete your code for you and fill out the remaining fields. | ||
|
||
![Inline Suggestions](./images/einstein-inline-create-account.png) | ||
|
||
To accept an 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. Also, you can always trigger inline suggestions even if you don't have the Auto Completions enabled using the Option (⌥)\ hotkeys to manually generate autocomplete suggestions. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
title: Test Case Generation | ||
lang: en | ||
--- | ||
|
||
## Overview | ||
|
||
Unit tests must cover at least 75% of your Apex code, and all of those tests must complete successfully for your code to be deployed or packaged for the Salesforce AppExchange. Use Einstein for Developers to quickly generate unit tests for your Apex classes. | ||
|
||
## Enable or Disable Test Case Generation | ||
|
||
To enable or disable the test case generation feature: | ||
|
||
1. Select **File** > **Preferences** > **Settings** (Windows or Linux) or **Code** > **Preferences** > **Settings** (macOS). | ||
2. Under **Einstein for Developers**, select **Enable Test Case Generation**. | ||
|
||
Test case generation is enabled by default. | ||
|
||
## Receive your First Unit Test | ||
|
||
Use Einstein for Developers to quickly generate Apex unit tests. | ||
|
||
1. From within a method in an Apex class, right-click and select **Einstein: Generate A Test**. | ||
2. Select the method for which you want to generate unit tests. Note that your Apex class must contain at least one method aside from the constructor, for this command to work. | ||
3. When prompted, choose to create new test class file or select an existing test class to which to add the test. | ||
If you choose to create a new file, the command uses the naming convention, `<ApexClassFileName>Test.cls` for the new file. The command adds the test method to the new file. | ||
4. Review the generated unit test method and choose to `Accept`, `Try Again`, or `Clear`. | ||
5. To generate another test method, right-click within the class file or the test class file and again select **Einstein: Generate A Test**. | ||
6. Again review the generated unit test method and choose to `Accept`, `Try Again`, or `Clear`. | ||
|
||
## Hotkeys | ||
|
||
You can generate a test using one of the following keyboard shortcuts: | ||
|
||
| Operating System | Generate Test | | ||
| ---------------- | ------------- | | ||
| macOS | ⌥ ⌘ T | | ||
| Windows | ⌥ ⌘ T | | ||
| Linux | ⌥ ⌘ T | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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!