jpsim / jpsim/SourceKitten

doc command produces duplicate entries when run on projects in /var

Open
#345 1 comment 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 originally posted this as an issue against the jazzy doc generator for Xcode projects:
https://github.com/realm/jazzy/issues/755

But after a bit more investigation the root issue appears to be in sourcekitten.

To reproduce:

  1. Create a simple Xcode project in your home directory with at least one Swift class with documentation comments (can be as little as three slashes above the declaration of an empty class)
  2. Run sourcekitten doc in the root of the project and save the output
  3. Copy the whole project contents to a folder inside /var
  4. Run sourcekitten doc in the root of the copied project and save the output

Comparing the outputs, you will notice that the output from the project in /var/... has duplicate entries for the same declaration. This causes jazzy to get confused.

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 reproducing the issue with sourcekitten doc on identical Swift/Xcode projects in a home directory and under /var, then compare the generated outputs. Trace the doc command's handling of declarations and paths; done means the project under /var produces no duplicate entries and no longer confuses jazzy.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
cli, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.