| 1 | """ _________ _____ _____ |
| 2 | __ ____/______ _______ __ /____(_)_______ ____ _______ |
| 3 | _ / _ __ \__ __ \_ __/__ / __ __ \_ / / /_ _ \ |
| 4 | / /___ / /_/ /_ / / // /_ _ / _ / / // /_/ / / __/ |
| 5 | \____/ \____/ /_/ /_/ \__/ /_/ /_/ /_/ \__,_/ \___/ |
| 6 | |
| 7 | Chat, Edit, and Autocomplete tutorial |
| 8 | """ |
| 9 | |
| 10 | # ———————————————————————————————————————————————— Setup ————————————————————————————————————————————————- |
| 11 | |
| 12 | # First, open the Continue sidebar by pressing [Cmd + L] or clicking the Continue icon. |
| 13 | |
| 14 | # See an example at https://docs.continue.dev/getting-started/install |
| 15 | |
| 16 | # Follow the instructions in the sidebar to set up a Chat/Edit modela and an Autocomplete model. |
| 17 | |
| 18 | # ————————————————————————————————————————————————— Chat ————————————————————————————————————————————————— |
| 19 | |
| 20 | ## Highlight the code below |
| 21 | ## Press [Cmd + L] to add to Chat |
| 22 | ## Try asking Continue "what sorting algorithm is this?" |
| 23 | def sorting_algorithm(x): |
| 24 | for i in range(len(x)): |
| 25 | for j in range(len(x) - 1): |
| 26 | if x[j] > x[j + 1]: |
| 27 | x[j], x[j + 1] = x[j + 1], x[j] |
| 28 | return x |
| 29 | |
| 30 | # [Cmd + L] always starts a new chat. Now, try the same thing using [Cmd + Shift + L]. |
| 31 | # This will add the code into the current chat |
| 32 | |
| 33 | # ————————————————————————————————————————————————— Edit ————————————————————————————————————————————————— |
| 34 | |
| 35 | ## Highlight the code below |
| 36 | ## Press [Cmd + I] to Edit |
| 37 | ## Try asking Continue to "make this more readable" |
| 38 | def sorting_algorithm(x): |
| 39 | for i in range(len(x)): |
| 40 | for j in range(len(x) - 1): |
| 41 | if x[j] > x[j + 1]: |
| 42 | x[j], x[j + 1] = x[j + 1], x[j] |
| 43 | return x |
| 44 | |
| 45 | # ————————————————————————————————————————————— Autocomplete —————————————————————————————————————————————— |
| 46 | |
| 47 | ## Place cursor after `sorting_algorithm:` below and press [Enter] |
| 48 | ## Press [Tab] to accept the Autocomplete suggestion |
| 49 | |
| 50 | # Basic assertion for sorting_algorithm: |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | # —————————————————————————————————————————————- Learn More -—————————————————————————————————————————————— |
| 56 | |
| 57 | # Visit the Continue Docs at https://docs.continue.dev/getting-started/overview |