Skip to content

SourceKit-LSP navigates to a .private.swiftinterface for a rawValue declaration #2792

Description

@jansorg

Swift version

Swift version 6.5-dev (LLVM b57635c461931c5, Swift 4f57c3ebcd65115)

Platform

Linux

Editor

Visual Studio Code with the Swift plugin, also in my own Swift plugin for JetBrains (Noctule)

Description

Navigating to the definition of a rawValue of a RawRepresentable navigates to an unexpected file, at line 0 and column 0.

  1. Usually, a swiftinterface:// URI is returned for Swift base library elements
  2. line 0 and column 0 are unexpected
  3. Other requests like "hover" show the correct content, the returned location of the definition response is (AFAIK) the wrong file

Steps to Reproduce

  1. Clone swift-argument-parser: https://github.com/apple/swift-argument-parser/tree/main
  2. Navigate to this file and line: https://github.com/apple/swift-argument-parser/blob/747565c049774eba2741509cfc147d18a20e6596/Sources/ArgumentParser/Completions/CompletionsGenerator.swift#L18
  3. Now Ctrl+Click in VSCode Swift (or request "go to definition")
  4. The editor now navigates to /usr/lib/swift/usr/lib/swift/linux/Swift.swiftmodule/x86_64-unknown-linux-gnu.private.swiftinterface on my system
  5. The LSP request and response were
[Trace - 11:39:34 AM] Sending request 'textDocument/definition - (76)'.
Params: {
"textDocument": {
  "uri": "file:///user/name/projects/swift-argument-parser/Sources/ArgumentParser/Completions/CompletionsGenerator.swift"
},
"position": {
  "line": 17,
  "character": 16
}
}


[Trace - 11:39:34 AM] Received response 'textDocument/definition - (76)' in 2ms.
Result: [
{
  "range": {
    "start": {
      "character": 0,
      "line": 0
    },
    "end": {
      "character": 0,
      "line": 0
    }
  },
  "uri": "file:///usr/lib/swift/usr/lib/swift/linux/Swift.swiftmodule/x86_64-unknown-linux-gnu.private.swiftinterface"
}
]

Logging

No response

Activity

  1. added theissue type on Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions