Uploaded image for project: 'Swift'
  1. Swift
  2. SR-2117

Add documentation for SourceKit request types

    XMLWordPrintable

    Details

      Description

      The majority of SourceKit request types, and the format of their responses, is undocumented. Protocol.md documents a small portion of the request types.

      We should add documentation for the remaining request types:

      1. -source.request.protocol_version- PR #3815
      2. source.request.crash_exit
      3. -source.request.demangle- PR #3603
      4. source.request.mangle_simple_class PR #4733
      5. -source.request.indexsource- PR #2392
      6. -source.request.docinfo- PR #2392
      7. -source.request.codecomplete- PR #2392
      8. -source.request.codecomplete.open- PR #5654
      9. source.request.codecomplete.close
      10. source.request.codecomplete.update
      11. source.request.codecomplete.cache.ondisk
      12. source.request.codecomplete.setpopularapi
      13. source.request.codecomplete.setcustom
      14. -source.request.cursorinfo- PR #3815
      15. source.request.relatedidents
      16. source.request.editor.open
      17. -source.request.editor.open.interface- PR #2392
      18. source.request.editor.open.interface.header
      19. source.request.editor.open.interface.swiftsource
      20. source.request.editor.open.interface.swifttype
      21. source.request.editor.extract.comment
      22. source.request.editor.close
      23. source.request.editor.replacetext
      24. source.request.editor.formattext
      25. source.request.editor.expand_placeholder
      26. source.request.editor.find_usr
      27. source.request.editor.find_interface_doc
      28. source.request.buildsettings.register
      29. source.request.module.groups

      To contribute:

      1. Build the Swift compiler from source on macOS. You should have a copy of sourcekitd-test and sourcekitd-repl in your swift-macosx-x86_64/bin build directory.
      2. Try invoking sourcekitd-test -req=foo, where foo is one of the values in this list: https://github.com/apple/swift/blob/7ac11087de44eb17855e6306d22bb9f345140a1d/tools/SourceKit/tools/sourcekitd-test/TestOptions.cpp#L136-L140. You'll need to read the source code to figure out what parameters the request types need to be passed.
      3. Look at the response, and document its structure in https://github.com/apple/swift/blob/master/tools/SourceKit/docs/Protocol.md

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            modocache Brian Ivan Gesiak
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Dates

              Created:
              Updated: