diff --git a/.vscodeignore b/.vscodeignore index 10751b3fd..b79a99db6 100644 --- a/.vscodeignore +++ b/.vscodeignore @@ -9,6 +9,7 @@ !images/** !snippets/** !assets/icons/** +!assets/walkthrough/** !assets/documentation-webview/** !assets/swift-docc-render/** !node_modules/@vscode/codicons/** diff --git a/assets/walkthrough/createNewProject.md b/assets/walkthrough/createNewProject.md new file mode 100644 index 000000000..b760556d1 --- /dev/null +++ b/assets/walkthrough/createNewProject.md @@ -0,0 +1,12 @@ +There are several project templates to choose from: +- `Library`: A package with a library. Use this to publish code for other packages to consume. +- `Executable`: A package with an executable. Use this for command line utilities. +- `Tool`: A package with an executable that uses Swift Argument Parser. Use this if you plan to have a rich set of command line arguments. +- `Build Tool Plugin`: A package that vents a Swift build tool plugin. +- `Command Plugin`: A package that vends a Swift command plugin. +- `Macro`: A package that vends a Swift macro. +- `Empty`: An empty package with just a `Package.swift` manifest. + +Once you select a template, you'll be prompted to enter a name for your new project. This will be the name of the folder created in your workspace. + +Finally, you'll be prompted to select a location for your new project. You can choose any location in your workspace, or create a new folder. \ No newline at end of file diff --git a/assets/walkthrough/images/createNewProject.svg b/assets/walkthrough/images/createNewProject.svg new file mode 100644 index 000000000..765e062b6 --- /dev/null +++ b/assets/walkthrough/images/createNewProject.svg @@ -0,0 +1,55 @@ + + + + + + + + + + + + +> Swift: + + + + + + +Swift: Create New Project... +Swift: Create New Swift File... +Swift: Select Toolchain... +Swift: Open Documentation +Swift: Preview Documentation +Swift: Open Package.swift + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/walkthrough/images/projectTypes.png b/assets/walkthrough/images/projectTypes.png new file mode 100644 index 000000000..c3592d0ca Binary files /dev/null and b/assets/walkthrough/images/projectTypes.png differ diff --git a/assets/walkthrough/images/swiftCommands.svg b/assets/walkthrough/images/swiftCommands.svg new file mode 100644 index 000000000..a200674f3 --- /dev/null +++ b/assets/walkthrough/images/swiftCommands.svg @@ -0,0 +1,40 @@ + + + + + + + + + + + + +> Swift: + + +Swift: Create New Project... +Swift: Create New Swift File... +Swift: Select Toolchain... +Swift: Open Documentation +Swift: Preview Documentation +Swift: Open Package.swift + + + + + + + + + + + + + + + + + + + diff --git a/assets/walkthrough/images/swiftLogo.svg b/assets/walkthrough/images/swiftLogo.svg new file mode 100755 index 000000000..9e97bfaa8 --- /dev/null +++ b/assets/walkthrough/images/swiftLogo.svg @@ -0,0 +1,22 @@ + + + + + + + + diff --git a/assets/walkthrough/images/testing.png b/assets/walkthrough/images/testing.png new file mode 100644 index 000000000..2c767a75f Binary files /dev/null and b/assets/walkthrough/images/testing.png differ diff --git a/assets/walkthrough/runningTests.md b/assets/walkthrough/runningTests.md new file mode 100644 index 000000000..4fbf78ee7 --- /dev/null +++ b/assets/walkthrough/runningTests.md @@ -0,0 +1 @@ +![Testing](./images/testing.png) \ No newline at end of file diff --git a/assets/walkthrough/swiftToolchains.md b/assets/walkthrough/swiftToolchains.md new file mode 100644 index 000000000..3b6342d94 --- /dev/null +++ b/assets/walkthrough/swiftToolchains.md @@ -0,0 +1,10 @@ +The Swift extension automatically detects your installed Swift toolchain. However, it also provides a command called `Swift: Select Toolchain...` which can be used to select between toolchains if you have multiple installed. + +You may be prompted to select where to configure this new path. Your options are to: + +- Save it in User Settings +- Save it in Workspace Settings + +Keep in mind that Workspace Settings take precedence over User Settings. + +The Swift extension will then prompt you to reload the extension in order to pick up the new toolchain. The extension will not use the new toolchain until the extension is restarted. \ No newline at end of file diff --git a/assets/walkthrough/welcome.md b/assets/walkthrough/welcome.md new file mode 100644 index 000000000..556c43ae2 --- /dev/null +++ b/assets/walkthrough/welcome.md @@ -0,0 +1,3 @@ +

+ Welcome +

\ No newline at end of file diff --git a/package.json b/package.json index 18041906d..a58455584 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,76 @@ ], "main": "./dist/src/extension.js", "contributes": { + "walkthroughs": [ + { + "id": "swift-welcome", + "title": "Get Started with Swift for VS Code", + "description": "Learn how to use the Swift extension for VS Code.", + "steps": [ + { + "id": "installing-mac", + "title": "Installing Swift", + "description": "๐Ÿ’ป Swift is cross-platform! If you already have Xcode installed, you're ready to go. Otherwise, see the instructions to [install on macOS](https://www.swift.org/install).\n๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘ Swift is [open source](https://github.com/swiftlang) and community driven!\n๐Ÿ’ฌ Questions? Visit the [Swift forums](https://forums.swift.org/) for help.", + "media": { + "markdown": "./assets/walkthrough/welcome.md" + }, + "when": "isMac" + }, + { + "id": "installing-mac", + "title": "Installing Swift", + "description": "๐Ÿ’ป Swift is cross-platform! See the instructions to [install on Linux](https://www.swift.org/install).\n๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘ Swift is [open source](https://github.com/swiftlang) and community driven!\n๐Ÿ’ฌ Questions? Visit the [Swift forums](https://forums.swift.org/) for help.", + "media": { + "markdown": "./assets/walkthrough/welcome.md" + }, + "when": "isLinux" + }, + { + "id": "installing-mac", + "title": "Installing Swift", + "description": "๐Ÿ’ป Swift is cross-platform! See the instructions to [install on Windows](https://www.swift.org/install).\n๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘ Swift is [open source](https://github.com/swiftlang) and community driven!\n๐Ÿ’ฌ Questions? Visit the [Swift forums](https://forums.swift.org/) for help.", + "media": { + "markdown": "./assets/walkthrough/welcome.md" + }, + "when": "isWindows" + }, + { + "id": "creating-new-project", + "title": "Creating a Swift Project", + "description": "โœ๏ธ When you open an empty workspace you can use the Create Swift Project button shown in the File Navigator, or you can create a new Swift project using the command palette.\n[Create New Project](command:swift.createNewProject)", + "media": { + "markdown": "assets/walkthrough/createNewProject.md" + } + }, + { + "id": "swift-commands", + "title": "Swift Commands", + "description": "๐ŸŽจ Explore the commands available in the command palette prefixed with \"> Swift:\". You can use the command palette to run any of the commands provided by the Swift extension.\n[Open Command Palette](command:workbench.action.showCommands)", + "media": { + "svg": "assets/walkthrough/images/swiftCommands.svg", + "altText": "Swift Commands" + } + }, + { + "id": "testing", + "title": "Running Tests", + "description": "โœ… Tests are automatically discovered in your project and added to the [Testing View](https://code.visualstudio.com/docs/debugtest/testing#_automatic-test-discovery-in-testing-view).\n๐Ÿงช Both [XCTest](https://developer.apple.com/documentation/xctest) and [Swift Testing](https://developer.apple.com/xcode/swift-testing/) tests are supported.", + "media": { + "markdown": "assets/walkthrough/runningTests.md" + } + }, + { + "id": "selecting-toolchain", + "title": "Selecting a Toolchain", + "description": "๐Ÿ› ๏ธ If you have more than one Swift toolchain installed you can switch between them.", + "markdown": "", + "media": { + "markdown": "assets/walkthrough/swiftToolchains.md" + } + } + ] + } + ], "icons": { "swift-icon": { "description": "The official icon for the Swift programming language", diff --git a/src/toolchain/toolchain.ts b/src/toolchain/toolchain.ts index 2e0358baa..48b09914c 100644 --- a/src/toolchain/toolchain.ts +++ b/src/toolchain/toolchain.ts @@ -536,6 +536,7 @@ export class SwiftToolchain { let str = ""; str += this.swiftVersionString; str += `\nPlatform: ${process.platform}`; + str += `\nVS Code Version: ${vscode.version}`; str += `\nSwift Path: ${this.swiftFolderPath}`; str += `\nToolchain Path: ${this.toolchainPath}`; if (this.runtimePath) {