Skip to content

Latest commit

 

History

History
43 lines (24 loc) · 1.43 KB

Protocol.org

File metadata and controls

43 lines (24 loc) · 1.43 KB

Starting

The SourceKittenDaemon binary has to be started with the following parameters:

action verb: either start or help --port: the port number on which the web server should open --project=: the absolute path to the .xcodeproj file you wish to load

An example would look like this:

SourceKittenDaemon start --port 44876 --project /private/tmp/abcde/abcde.xcodeproj

After that, the daemon can be queried using the REST api outlined below

Communication Protocol Definition

This is the Protocol definition for the protocol between an editor and the SourceKittenDaemon

The protocol uses simple HTTP GET calls for communication. The following endpoints are supported.

/complete

Request a completion. In order to successfuly complete the request, the server needs the following parameters as request headers:

X-Offset: An integer number of the current byte offset for which a completion is requested X-Path: The path to the temporarily written buffer that contains the current state of the editing of the file X-File: The name of the currently edited file as it is known in the project. I.e. AppDelegate.swift

/stop

Stops the server. This can be used to restart the server for a different target afterwards.

/ping

Returns “OK”

/project

Returns the currently loaded project file path

/files

Returns a list of all Swift files in the current project