update tutorial files

This commit is contained in:
Dallin Romney 2025-02-05 10:38:38 -08:00
parent 74f9a23d58
commit 0c2de5cb5f
5 changed files with 68 additions and 18 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

@ -7,11 +7,18 @@
// Chat, Edit, and Autocomplete tutorial
//
// ———————————————————————————————————————————————— Setup ————————————————————————————————————————————————-
// 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 setup models for Chat and Autocomplete.
// ————————————————————————————————————————————————— 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;
}
// [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++) {
@ -46,10 +56,11 @@ public static int[] sortingAlgorithm2(int[] x) {
// ————————————————————————————————————————————— 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 ———————————————————

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 models for Chat and Autocomplete.
# ————————————————————————————————————————————————— 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

@ -7,10 +7,18 @@
// Chat, Edit, and Autocomplete tutorial
//
// ———————————————————————————————————————————————— Setup ————————————————————————————————————————————————-
// 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 models for Chat and Autocomplete.
// ————————————————————————————————————————————————— 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++) {
@ -25,10 +33,13 @@ function sortingAlgorithm(x: number[]): number[] {
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 —————————————————————————————————————————————————
// 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++) {
@ -45,9 +56,11 @@ function sortingAlgorithm2(x: number[]): number[] {
// ————————————————————————————————————————————— 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

@ -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);
}