jpsim / jpsim/SourceKitten

Getting documentation for specific offset in text

Open
#592 4 comments 0 reactions 0 assignees View on GitHub

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:

Screen Shot 2019-05-07 at 12 10 59 AM

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.