Getting documentation for specific offset in text
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 2.4k
- Forks
- 237
- PR merge metrics
- No merged PRs in 30d
Description
I'm using SourceKitten to improve syntax highlighting and add code completion for my app Swift Coder.
I've managed to get code completion suggestions through SourceKitten so far, but it gave me an idea. Seeing the "docBrief" one-line descriptions made me think about implementing something like this:
Or, basically, Xcode's Quick Help inspector.
I'm not sure where I should be looking to get this information through SourceKit, or if it's something I can get at all. I can't figure out how to get a cursor offset request to work properly or even if that would be helpful. I don't need this to be super in-depth, maybe just showing the "summary" section would be enough, with maybe also a link to the full documentation. I think it'd be pretty helpful for people learning Swift!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing SourceKitten's cursor-offset request and the existing docBrief output. Check whether SourceKit provides summary or full documentation for a source position, and confirm the supported request and response shape. Done means documenting or exposing a workable way to retrieve documentation for a specific offset.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 32/100