Skip to content

New files opened in helix editor lack symbols from the same package #2319

@dmbfm

Description

@dmbfm

Swift version

swift-driver version: 1.127.14.1 Apple Swift version 6.2 (swiftlang-6.2.0.19.9 clang-1700.3.19.1) Target: arm64-apple-macosx26.0

Platform

macOS 26

Editor

Helix

Description

When I create a new file in helix (e.g., by using :o <filepath>), although code completion and diagnostics keep working on this file, they lack any of the symbols of the module the file is placed in. Only after restarting the server via :LspRestart do the symbols appear correctly.

From what I could gather in the logs, source-kit receives the textDocument/didOpen notification from helix, but it does not seem to recognize the workspace of the file:

Build settings for file:///Users/dfortes/Developer/dump/SomeProject/Sources/SomeProject/Other.swift (1/1)
Compiler Arguments:
-sdk
/Applications/Xcode-26.0.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk
/Users/dfortes/Developer/dump/SomeProject/Sources/SomeProject/Other.swift

Working directory:
<nil>

and

Producing syntactic diagnostics from the built-in swift-syntax because we have fallback build settings)

Steps to Reproduce

Create a new project:

mkdir SomeProject
cd SomeProject
swift package init

Open the helix editor:

hx Sources/SomeProject/SomeProject.swift

Set the source code to something like:

struct Model {
	var x: Int
}

Open a new file by using the command: :o Sources/SomeProject/OtherFile.swift; code completion will still work for libraries like Foundation, but the Model struct won't be found.

Logging

sourcekit-lsp-diagnose-2025-10-06T15-23-13-03-00.zip

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