vscode-swift icon indicating copy to clipboard operation
vscode-swift copied to clipboard

Plugin not generating launch.json file for Swift Package

Open JacobHearst opened this issue 1 year ago • 8 comments

Describe the bug The Swift extension for VSCode generated the launch.json file for my Swift Package once but I was having issues and wanted to have it re-generated. I deleted the files, closed and reopened VSCode and the files were not re-generated.

To Reproduce Steps to reproduce the behavior:

  1. Install the Swift language extension
  2. Open a Swift Package in VSCode
  3. Wait for tasks like "listing tests" and "resolving packages" to complete
  4. See that no .vscode directory or .vscode/launch.json file has been created

Expected behavior A file has been created at .vscode/launch.json with configurations generated from the Package.swift file at the project root.

Environment

  • OS: Windows 10 (19045.4291)
  • Swift version:
Swift version 5.10 (swift-5.10-RELEASE)
Target: x86_64-unknown-windows-msvc
  • Visual Studio Code version: 1.88.1
  • vscode-swift version: 1.9.0

Additional context I thought there might be some cache somewhere that was preventing the re-creation of launch.json so I uninstalled/reinstalled VSCode and deleted:

  • %userprofile%\.vscode
  • %appdata%\Code
  • The .vscode directory in my Package root

All to no effect

JacobHearst avatar Apr 23 '24 15:04 JacobHearst

Does you package have an executable in it?

adam-fowler avatar Apr 23 '24 16:04 adam-fowler

It does not (although it did initially when the files were generated), the issue that prompted me to try re-generating the launch.json is that I haven't been able to debug my unit tests. Is an executable target required for the file generation?

JacobHearst avatar Apr 24 '24 15:04 JacobHearst

The tests should be available via the Test explorer.

adam-fowler avatar Apr 24 '24 21:04 adam-fowler

They are available, I just can't debug them. I can open another issue for that if debugging should work without launch.json configurations but as for this issue, should I only see the launch.json file get generated when my package has an executable target?

JacobHearst avatar Apr 26 '24 19:04 JacobHearst

In the TestExplorer there's two buttons for each test one to run it and one to debug it.

adam-fowler avatar Apr 27 '24 06:04 adam-fowler

Yup, I see both of those buttons, the debug option does not work. Should I open a different issue for that?

JacobHearst avatar Apr 27 '24 19:04 JacobHearst

In what way does it not work?

adam-fowler avatar Apr 28 '24 07:04 adam-fowler

Also can you look at #728 and see if this could be related.

adam-fowler avatar Apr 28 '24 17:04 adam-fowler

Closing as we've had no response

adam-fowler avatar Jun 05 '24 11:06 adam-fowler