jpsim / jpsim/SourceKitten

[Question] "key.swift_declaration" present for protocol methods, but not class methods?

Open
#389 6 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

sourcekitten doc --objc test.h -- -x objective-c -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk -I $(pwd)                                                                                                                                                 

test.h:

#import </Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITableView.h>
// If using just #import <UIKit/UITableView.h>, the output is empty

The output has swift_declaration returned for protocol methods (ex. c:objc(pl)UITableViewDataSource(im)tableView:numberOfRowsInSection:), but no swift_declaration returned for class methods (ex. c:objc(cs)UITableView(im)scrollToNearestSelectedRowAtScrollPosition:animated:).

Any hints how to get swift_declaration returned for class methods?

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 rerunning the sourcekitten doc --objc command against the supplied test.h and UIKit SDK paths. Compare the swift_declaration output for the UITableViewDataSource protocol method and UITableView class method, then inspect the command's handling of those symbols. Done means establishing whether class methods should return this field and documenting or correcting the behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
objective-c, swift
Domain
cli, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.