Skip to content

[SR-2117] Add documentation for SourceKit request types #44725

Description

@modocache
mannequin
Previous ID SR-2117
Radar None
Original Reporter @modocache
Type Improvement
Additional Detail from JIRA
Votes 0
Component/s Source Tooling
Labels Improvement, StarterBug
Assignee None
Priority Medium

md5: c43f5bd8eac7b069dfaac26bb719e804

Issue 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. 
    
  2. source.request.crash_exit

  3. 
    
  4. source.request.mangle_simple_class PR #4733

  5. 
    
  6. 
    
  7. 
    
  8. 
    
  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. 
    
  15. source.request.relatedidents

  16. source.request.editor.open

  17. 
    
  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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions