Skip to content

Errors during completion due to missing key.offset #2195

@Wilfred

Description

@Wilfred

I've started noticing the following in my VS Code logs recently:

sourcekit: [2:handleRequest-after:24.8546] error response (Request Invalid): missing 'key.offset'

2025-07-04 09:11:59.236 [info] [Error - 9:11:59 AM] Request textDocument/completion failed.
2025-07-04 09:11:59.236 [info]   Message: sourcekitd invalid request error response (Request Invalid): missing 'key.offset'
  Code: -32001

I see sourcekit-lsp stopped passing offset in #1937 in favour of line and column, but the sourcekit docs suggest that offset is required: https://github.com/swiftlang/swift/blob/main/tools/SourceKit/docs/Protocol.md#code-completion

Which is correct? Are the protocol docs stale, is this a bug in sourcekit-lsp, or is it an issue with my setup?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions