Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
modocache mannequin opened this issue Jul 19, 2016 · 3 comments
Open

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

modocache mannequin opened this issue Jul 19, 2016 · 3 comments
Labels

Comments

@modocache
Copy link
Mannequin

modocache mannequin commented Jul 19, 2016

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

@swift-ci
Copy link
Collaborator

Comment by Ryan Lovelett (JIRA)

It would seem that handleRequestImpl is the place where the big switch of all the available SourceKit key.request are processed.

From there I think these are all the available key.request options.

My favorite? source.request.crash_exit from a comment: 'exit' has the same effect as crashing but without the crash log..

@swift-ci
Copy link
Collaborator

Comment by Ryan Lovelett (JIRA)

I updated the description to include all 29 available requests found from key.request. I also marked the ones already documented with a strike-through and the PR where they were documented.

@swift-ci
Copy link
Collaborator

Comment by David Aghassi (JIRA)

Added `codecomplete.open` PR link

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant