Skip to content

sourcekitten complete on Linux not doing what I expected #798

@dpkirchner

Description

@dpkirchner

I'm trying to figure out how to use sourcekitten to parse an app's source and provide useful code completions. I found an old issue (#113) but I'm not sure it's still relevant. Here's what I'm trying (copied from an old post that referenced issue 113, https://forums.swift.org/t/sorting-filtering-results/12588):

$ sourcekitten complete --text "import Foundation; let x = UR" --offset 28 '' | jq -r .
[
  {
    "context": "source.codecompletion.context.thisclass",
    "typeName": "_",
    "kind": "source.lang.swift.keyword",
    "sourcetext": ".self",
    "name": "self",
    "numBytesToErase": 0,
    "descriptionKey": "self"
  }
]

The good news is it doesn't return nothing, but it doesn't return what I expected either. I was hoping it'd return something that indicates UR could be completed with URI from the Foundation module. Am I doing something wrong, and/or are most of the completions still handled by Xcode itself?

I'm running this on Linux. I'm on sourcekitten version 0.34.1 and my toolchain is Swift version 5.9.1-RELEASE.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions