swiftlang / vscode-swift

Visual Studio Code Extension for Swift
https://marketplace.visualstudio.com/items?itemName=sswg.swift-lang
Apache License 2.0
755 stars 54 forks source link

Set Swift environment variables in the integrated terminal #944

Closed matthewbastien closed 4 months ago

matthewbastien commented 4 months ago

This PR adds two new features to the extension:

  1. The swift.path and swift.swiftEnvironmentVariables settings will automatically be applied to the integrated terminal's environment variables. This can be disabled using the setting swift.enableTerminalEnvironment if the user wants.
  2. A new Terminal Profile has been added primarily for users that wish to have a special terminal for Swift related commands and will disable the automatic terminal environment.

I've also added an icon font with the Swift icon that can be used in various places. At the moment it is being used for the Terminal Profile and the Swiftly installation from the toolchain selection workflow.

Issue: #914

matthewbastien commented 4 months ago

what is the point of a Swift terminal which doesn't pass on the extension environment variables?

The automatic terminal environment variables and Swift terminal are separate entities. The Swift terminal profile still sets the environment variables regardless of the value for the swift.enableTerminalEnvironment setting. It only exists for people that don't want their integrated terminal environment to be automatically set by the extension - they can instead explicitly open up a Swift terminal with the right environment.

adam-fowler commented 4 months ago

what is the point of a Swift terminal which doesn't pass on the extension environment variables?

The automatic terminal environment variables and Swift terminal are separate entities. The Swift terminal profile still sets the environment variables regardless of the value for the swift.enableTerminalEnvironment setting. It only exists for people that don't want their integrated terminal environment to be automatically set by the extension - they can instead explicitly open up a Swift terminal with the right environment.

ok I missed that. I thought it was disabling the environment variables from the swift terminal as well