Skip to content

Issues when a folder contains multiple Swift packages #768

Closed
@svanimpe

Description

@svanimpe

To Reproduce

Steps to reproduce the behavior (in an empty directory):

mkdir first && cd first && swift package init --type executable
cd ..
mkdir second && cd second && swift package init --type executable
cd ..
code .

In other words, create a project structure like this, then open it in VS Code:

.
├── first
│   ├── Package.swift
│   └── Sources
│       └── main.swift
└── second
    ├── Package.swift
    └── Sources
        └── main.swift

Issues

Open a Package.swift file. When using Swift 5.9, features such as autocompletion don't work in this file. With Swift 6.0, I get the following additional error:

Screenshot 2024-04-25 at 11 19 43

Workaround

Open first or second separately in VS Code. Everything works fine then.

Environment

  • macOS 13.6
  • swift-6.0-DEVELOPMENT-SNAPSHOT-2024-04-22-a
  • Visual Studio Code version: 1.88.1
  • vscode-swift version: 1.9.0

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingsourcekit-lspSourceKit-LSP issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions