jpsim / jpsim/SourceKitten

Autocompletion of SPM dependencies and go to definition info

Open
#419 0 comments 1 reaction 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

Hi! I'm just started looking into Swift and, as a part of learning process, I'm trying to configure my editor so it can use some toolchain features. I don't want to use Xcode for a number of reasons, so I'm hacking on Atom.

My first goals are:

  1. Setup proper autocompletion.
  2. Implement go to definition functionality.

I use nuclide to write JS/Reason code and I tried its Swift integration. It works great when I operate in the scope of my own code. But when I add dependency and build the project—it builds, but autocompletion doesn't work b/c sourcekitten cli returns empty array (it doesn't see external modules). I also tried --spm-module MyPackage flag, but received empty array as well. Should I do something special to make it work or add something to Package.swift? Or it's out of scope of SourceKitten and I should go lower?

On the second item in my list, tbh I haven't looked much into it yet, but I'd be grateful for some directions or even keywords b/c I kinda wander in the dark now.

Thanks in advance!

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 empty autocompletion result with SourceKitten’s CLI against a Swift Package Manager dependency, including the --spm-module MyPackage case. Read the project’s Package.swift handling and the SourceKitten entry points involved in completion and definition lookup. Done means the scope is defined and dependency completion and go-to-definition behavior are implemented or documented with a clear limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
cli, devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.