Skip to content

Moving project folder breaks semantic functionality until index-build folder is deleted #2197

@rmecham

Description

@rmecham

Swift version

Swift version 6.1.2 (swift-6.1.2-RELEASE)

Platform

Ubuntu 24.04.2 LTS (running as devcontainer on macOS 15.5)

Editor

Visual Studio Code v1.101.2 with swiftlang.swift-vscode v2.6.1

Description

I've started a brand new Vapor / Fluent project in VSCode with a devcontainer. I've been unable to get sourcekit-lsp to work at all (as in, no autocomplete suggestions, error highlighting, etc.). I'm seeing the following errors in the Output tab in VSCode:

CreateUserMigration.swift:1:8: error: no such module 'Fluent'
import Fluent
       ^
sourcekit: [1:buildASTUnit: 0.0000] Compilation setup failed!!!
sourcekit: [1:failed: 0.0006] diagnostics failed: Loading the standard library failed
sourcekit: [1:buildASTUnit: 1.1802] Compilation setup failed!!!
sourcekit: [1:failed: 1.1804] diagnostics failed: Loading the standard library failed

I'm using the swift:6.1.2 Docker image as the base image for the devcontainer.

Steps to Reproduce

  1. Start a new Vapor project using the Vapor toolbox CLI to start a new project from the standard Vapor template, including Fluent (and PostgreSQL support in Fluent).
  2. Open that project in VSCode and use the built-in “Add Dev Container Configuration Files” command to add a Swift container to the project.
  3. Re-open the project in the dev container, wait for the Swift plugin to fully initialize (including waiting for the background indexing to finish), and observe that no sourcekit-lsp features are working.
  4. Open the Output tab, switch the pop-up menu to “SourceKit Language Server (6.1.2)” and observe the error messages.

Logging

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions