Merge pull request #3968 from continuedev/dallin/tutorial-files

Tutorial file improvements
This commit is contained in:
Nate Sesti 2025-02-05 13:34:11 -08:00 • committed by GitHub
commit 6cfe5e2a91
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 89 additions and 39 deletions

View file

@ -47,7 +47,15 @@ fun showTutorial(project: Project) {
throw IOException("Resource not found: $tutorialFileName")
}
var content = StreamUtil.readText(`is`, StandardCharsets.UTF_8)
// All jetbrains will use J instead of L
content = content.replace("[Cmd + L]", "[Cmd + J]")
content = content.replace("[Cmd + Shift + L]", "[Cmd + Shift + J]")
if (!System.getProperty("os.name").lowercase().contains("mac")) {
content = content.replace("[Cmd + J]", "[Ctrl + J]")
content = content.replace("[Cmd + Shift + J]", "[Ctrl + Shift + J]")
content = content.replace("[Cmd + I]", "[Ctrl + I]")
content = content.replace("⌘", "⌃")
}
val filepath = Paths.get(getContinueGlobalPath(), tutorialFileName).toString()

View file

@ -1,17 +1,24 @@
/* _________ _____ _____
__ ____/______ _______ __ /____(_)_______ ____ _______
_ / _ __ \__ __ \_ __/__ / __ __ \_ / / /_ _ \
/ /___ / /_/ /_ / / // /_ _ / _ / / // /_/ / / __/
\____/ \____/ /_/ /_/ \__/ /_/ /_/ /_/ \__,_/ \___/
// _________ _____ _____
// __ ____/______ _______ __ /____(_)_______ ____ _______
// _ / _ __ \__ __ \_ __/__ / __ __ \_ / / /_ _ \
// / /___ / /_/ /_ / / // /_ _ / _ / / // /_/ / / __/
// \____/ \____/ /_/ /_/ \__/ /_/ /_/ /_/ \__,_/ \___/
//
// Chat, Edit, and Autocomplete tutorial
//
Chat, Edit, and Autocomplete tutorial
*/
// ———————————————————————————————————————————————— Setup ————————————————————————————————————————————————-
// First, open the Continue sidebar by pressing [Cmd + L] or clicking the Continue icon.
/* ————————————————————————————————————————————————— Chat ————————————————————————————————————————————————— */
// See an example at https://docs.continue.dev/getting-started/install
// Follow the instructions in the sidebar to set up a Chat/Edit modela and an Autocomplete model.
// ————————————————————————————————————————————————— Chat —————————————————————————————————————————————————
// Highlight the code below
// Press [Cmd/Ctrl + J] to add to Chat
// Press [Cmd + L] to add to Chat
// Try asking Continue "what sorting algorithm is this?"
public static int[] sortingAlgorithm(int[] x) {
for (int i = 0; i < x.length; i++) {
@ -26,10 +33,13 @@ public static int[] sortingAlgorithm(int[] x) {
return x;
}
/* ————————————————————————————————————————————————— Edit ————————————————————————————————————————————————— */
// [Cmd + L] always starts a new chat. Now, try the same thing using [Cmd + Shift + L].
// This will add the code into the current chat
// ————————————————————————————————————————————————— Edit —————————————————————————————————————————————————
// Highlight the code below
// Press [Cmd/Ctrl + I] to Edit
// Press [Cmd + I] to Edit
// Try asking Continue to "make this more readable"
public static int[] sortingAlgorithm2(int[] x) {
for (int i = 0; i < x.length; i++) {
@ -44,12 +54,15 @@ public static int[] sortingAlgorithm2(int[] x) {
return x;
}
/* ————————————————————————————————————————————— Autocomplete —————————————————————————————————————————————— */
// ————————————————————————————————————————————— Autocomplete ——————————————————————————————————————————————
// Place cursor after `sortingAlgorithm...` below and press [Enter]
// Place cursor after `sortingAlgorithm:` below and press [Enter]
// Press [Tab] to accept the Autocomplete suggestion
// Basic assertion for sortingAlgorithm...
// Basic assertion for sortingAlgorithm:
/* —————————————————— Learn more at https://docs.continue.dev/getting-started/overview ——————————————————— */
// —————————————————————————————————————————————- Learn More -——————————————————————————————————————————————
// Visit the Continue Docs at https://docs.continue.dev/getting-started/overview

View file

@ -7,11 +7,18 @@
Chat, Edit, and Autocomplete tutorial
"""
# ———————————————————————————————————————————————— Setup ————————————————————————————————————————————————-
# ————————————————————————————————————————————————— Chat ————————————————————————————————————————————————— #
# First, open the Continue sidebar by pressing [Cmd + L] or clicking the Continue icon.
# See an example at https://docs.continue.dev/getting-started/install
# Follow the instructions in the sidebar to set up a Chat/Edit modela and an Autocomplete model.
# ————————————————————————————————————————————————— Chat —————————————————————————————————————————————————
## Highlight the code below
## Press [Cmd/Ctrl + J] to add to Chat
## Press [Cmd + L] to add to Chat
## Try asking Continue "what sorting algorithm is this?"
def sorting_algorithm(x):
for i in range(len(x)):
@ -20,11 +27,13 @@ def sorting_algorithm(x):
x[j], x[j + 1] = x[j + 1], x[j]
return x
# [Cmd + L] always starts a new chat. Now, try the same thing using [Cmd + Shift + L].
# This will add the code into the current chat
# ————————————————————————————————————————————————— Edit ————————————————————————————————————————————————— #
# ————————————————————————————————————————————————— Edit —————————————————————————————————————————————————
## Highlight the code below
## Press [Cmd/Ctrl + I] to Edit
## Press [Cmd + I] to Edit
## Try asking Continue to "make this more readable"
def sorting_algorithm(x):
for i in range(len(x)):
@ -33,12 +42,16 @@ def sorting_algorithm(x):
x[j], x[j + 1] = x[j + 1], x[j]
return x
# ————————————————————————————————————————————— Autocomplete —————————————————————————————————————————————— #
# ————————————————————————————————————————————— Autocomplete ——————————————————————————————————————————————
## Place cursor after `sorting_algorithm...` below and press [Enter]
## Place cursor after `sorting_algorithm:` below and press [Enter]
## Press [Tab] to accept the Autocomplete suggestion
# Basic assertion for sorting_algorithm...
# Basic assertion for sorting_algorithm:
# —————————————————— Learn more at https://docs.continue.dev/getting-started/overview ——————————————————— #
# —————————————————————————————————————————————- Learn More -——————————————————————————————————————————————
# Visit the Continue Docs at https://docs.continue.dev/getting-started/overview

View file

@ -1,17 +1,24 @@
/* _________ _____ _____
__ ____/______ _______ __ /____(_)_______ ____ _______
_ / _ __ \__ __ \_ __/__ / __ __ \_ / / /_ _ \
/ /___ / /_/ /_ / / // /_ _ / _ / / // /_/ / / __/
\____/ \____/ /_/ /_/ \__/ /_/ /_/ /_/ \__,_/ \___/
// _________ _____ _____
// __ ____/______ _______ __ /____(_)_______ ____ _______
// _ / _ __ \__ __ \_ __/__ / __ __ \_ / / /_ _ \
// / /___ / /_/ /_ / / // /_ _ / _ / / // /_/ / / __/
// \____/ \____/ /_/ /_/ \__/ /_/ /_/ /_/ \__,_/ \___/
//
// Chat, Edit, and Autocomplete tutorial
//
Chat, Edit, and Autocomplete tutorial
*/
// ———————————————————————————————————————————————— Setup ————————————————————————————————————————————————-
// First, open the Continue sidebar by pressing [Cmd + L] or clicking the Continue icon.
/* ————————————————————————————————————————————————— Chat ————————————————————————————————————————————————— */
// See an example at https://docs.continue.dev/getting-started/install
// Follow the instructions in the sidebar to set up a Chat/Edit modela and an Autocomplete model.
// ————————————————————————————————————————————————— Chat —————————————————————————————————————————————————
// Highlight the code below
// Press [Cmd/Ctrl + J] to add to Chat
// Press [Cmd + L] to add to Chat
// Try asking Continue "what sorting algorithm is this?"
function sortingAlgorithm(x: number[]): number[] {
for (let i = 0; i < x.length; i++) {
@ -26,10 +33,13 @@ function sortingAlgorithm(x: number[]): number[] {
return x;
}
/* ————————————————————————————————————————————————— Edit ————————————————————————————————————————————————— */
// [Cmd + L] always starts a new chat. Now, try the same thing using [Cmd + Shift + L].
// This will add the code into the current chat
// ————————————————————————————————————————————————— Edit —————————————————————————————————————————————————
// Highlight the code below
// Press [Cmd/Ctrl + I] to Edit
// Press [Cmd + I] to Edit
// Try asking Continue to "make this more readable"
function sortingAlgorithm2(x: number[]): number[] {
for (let i = 0; i < x.length; i++) {
@ -44,12 +54,13 @@ function sortingAlgorithm2(x: number[]): number[] {
return x;
}
/* ————————————————————————————————————————————— Autocomplete —————————————————————————————————————————————— */
// ————————————————————————————————————————————— Autocomplete ——————————————————————————————————————————————
// Place cursor after `sortingAlgorithm...` below and press [Enter]
// Place cursor after `sortingAlgorithm:` below and press [Enter]
// Press [Tab] to accept the Autocomplete suggestion
// Basic assertion for sortingAlgorithm...
// Basic assertion for sortingAlgorithm:
// —————————————————————————————————————————————- Learn More -——————————————————————————————————————————————
/* —————————————————— Learn more at https://docs.continue.dev/getting-started/overview ——————————————————— */
// Visit the Continue Docs at https://docs.continue.dev/getting-started/overview

View file

@ -16,7 +16,12 @@ export async function showTutorial(ide: IDE) {
// Ensure keyboard shortcuts match OS
if (process.platform !== "darwin") {
let tutorialContent = await ide.readFile(tutorialUri.toString());
tutorialContent = tutorialContent.replace("⌘", "^").replace("Cmd", "Ctrl");
tutorialContent = tutorialContent
.replaceAll("[Cmd + L]", "[Ctrl + L]")
.replaceAll("[Cmd + Shift + L]", "[Ctrl + Shift + L]")
.replaceAll("[Cmd + I]", "[Ctrl + I]")
.replaceAll("⌘", "^");
await ide.writeFile(tutorialUri.toString(), tutorialContent);
}