Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Working in Codespaces

Note

The instructions below apply specifically to GitHub Codespaces.

They do not apply if you are working locally.

Accessing a Codespace

  1. Visit your repository’s home page on github.com. Bookmark the page in your browser if this is your first visit, so that you have a quick and easy way of accessing it in future.

  2. Click on the green Code button and select the ‘Codespaces’ tab. If a Codespace exists already, select that; otherwise, click the + button to create a new one.

See the sections below for the next steps, which differ depending on whether this is a new Codespace or a pre-existing Codespace.

New Codespace

  1. Wait for your new Codespace to start up. Once it is up and running, click on the Extensions button on the left of the VS Code window. Enter Kotlin into the Search box.

    Select the ‘Kotlin Language’ extension, authored by Mathias Frohlich. Click on the small blue Install button to install it.

    Important

    Make sure you choose the correct extension here!

    You should NOT install the one named ‘Kotlin’, authored by ‘fwcd’.

  2. Install the Kotlin command line compiler by using this command in the terminal window:

    sdk install kotlin
    

    Check that it has been installed correctly with

    kotlinc -version
    

    You should see Kotlin’s version number displayed.

Pre-existing Codespace

If you are returning to a pre-existing Codespace, then it shouldn’t be necessary to install anything; the Kotlin compiler and VS Code extension that you installed when you created the Codespace should still be available.

However, we do recommend that you start your work session by pulling any recent commits from your GitHub repository into the Codespace, as described earlier.

Note

There might be recent changes that need to be pulled in if you have been doing work for this module elsewhere—e.g., on your own computer or on a SoCS lab machine.

If you do all your work in Codespaces then it won’t be strictly necessary to start a session by pulling commits, but it is a good idea to get into the habit of doing it, just in case you need to switch work environments at some point in the future.