swiftlang / vscode-swift

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

Plugin not generating launch.json file for Swift Package #766

Closed JacobHearst closed 1 month ago

JacobHearst commented 2 months ago

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

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:

All to no effect

adam-fowler commented 2 months ago

Does you package have an executable in it?

JacobHearst commented 2 months ago

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?

adam-fowler commented 2 months ago

The tests should be available via the Test explorer.

JacobHearst commented 2 months ago

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?

adam-fowler commented 2 months ago

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

JacobHearst commented 2 months ago

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

adam-fowler commented 2 months ago

In what way does it not work?

adam-fowler commented 2 months ago

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

adam-fowler commented 1 month ago

Closing as we've had no response