Skip to content

Resolve settings variables in Swift settings #1439

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 18, 2025

Conversation

plemarquand
Copy link
Contributor

VS Code defines several predefined variables that can be substituted in task and launch configurations. It is useful to have some of these defined for use in Swift settings, specifically the ones that are comprised of paths.

This patch introduces a limited list of variables that are substituted in some settings. The variables supported are:

  • ${workspaceFolder}
  • ${workspaceFolderBasename}
  • ${cwd}
  • ${userHome}
  • ${pathSeparator}

The settings that support variable subsitution are:

  • ${swift.path}
  • ${swift.runtimePath}
  • ${swift.sdk}
  • ${swift.buildArguments}
  • ${swift.packageArguments}
  • ${swift.buildPath}
  • ${swift.serverArguments}
  • ${swift.additionalTestArguments}
  • ${swift.attachmentsPath}
  • ${swift.debugger.customDebugAdapterPath}
  • ${swift.excludeFromCodeCoverage}
  • ${swift.sourcekit-lsp.serverPath}

Issue: #1438

@plemarquand
Copy link
Contributor Author

This is just a draft as the final list of supported substitutions/settings is up for discussion.

VS Code defines several predefined variables that can be substituted in
task and launch configurations. It is useful to have some of these
defined for use in Swift settings, specifically the ones that are
comprised of paths.

This patch introduces a limited list of variables that are substituted
in some settings. The variables supported are:

- `${workspaceFolder}`
- `${workspaceFolderBasename}`
- `${cwd}`
- `${userHome}`
- `${pathSeparator}`

The settings that support variable subsitution are:

- `${swift.path}`
- `${swift.runtimePath}`
- `${swift.sdk}`
- `${swift.buildArguments}`
- `${swift.packageArguments}`
- `${swift.buildPath}`
- `${swift.serverArguments}`
- `${swift.additionalTestArguments}`
- `${swift.attachmentsPath}`
- `${swift.debugger.customDebugAdapterPath}`
- `${swift.excludeFromCodeCoverage}`
- `${swift.sourcekit-lsp.serverPath}`

Issue: swiftlang#1438
@plemarquand plemarquand force-pushed the resolve-settings-variables branch from a561fb9 to e94b715 Compare March 17, 2025 18:37
@plemarquand plemarquand marked this pull request as ready for review March 18, 2025 19:27
Copy link
Contributor

@award999 award999 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine with leaving as is but this will have the limitation of ${workspaceFolder:mySubWorkspace} notation not working for multi-folder workspaces. This is a limitation with tasks too so fine with leaving until we can holistically tackle

@plemarquand plemarquand merged commit 1bd8acc into swiftlang:main Mar 18, 2025
13 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants