Skip to content

[SourceKit] Add documentation for SourceKit request types #3815

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

Conversation

RLovelett
Copy link
Contributor

What's in this pull request?

This adds documentation for a few more request types that SourceKit supports. There are no code changes so CI does not need to be run.

Resolved bug number: (SR-2117)

This does not completely resolve SR-2117 but it does knock a few more off the list. It also gives @modocache a chance to say if I am continuing his work appropriately before I spend more hours doing the rest of them.


Before merging this pull request to apple/swift repository:

  • Test pull request on Swift continuous integration.

Triggering Swift CI

The swift-ci is triggered by writing a comment on this PR addressed to the GitHub user @swift-ci. Different tests will run depending on the specific comment that you use. The currently available comments are:

Smoke Testing

Platform Comment
All supported platforms @swift-ci Please smoke test
All supported platforms @swift-ci Please smoke test and merge
OS X platform @swift-ci Please smoke test OS X platform
Linux platform @swift-ci Please smoke test Linux platform

A smoke test on macOS does the following:

  1. Builds the compiler incrementally.
  2. Builds the standard library only for macOS. Simulator standard libraries and
    device standard libraries are not built.
  3. lldb is not built.
  4. The test and validation-test targets are run only for macOS. The optimized
    version of these tests are not run.

A smoke test on Linux does the following:

  1. Builds the compiler incrementally.
  2. Builds the standard library incrementally.
  3. lldb is built incrementally.
  4. The swift test and validation-test targets are run. The optimized version of these
    tests are not run.
  5. lldb is tested.

Validation Testing

Platform Comment
All supported platforms @swift-ci Please test
All supported platforms @swift-ci Please test and merge
OS X platform @swift-ci Please test OS X platform
OS X platform @swift-ci Please benchmark
Linux platform @swift-ci Please test Linux platform

Lint Testing

Language Comment
Python @swift-ci Please Python lint

Note: Only members of the Apple organization can trigger swift-ci.

@RLovelett RLovelett force-pushed the improvement/SR-2117-Add-documentation-for-SourceKit-request-types branch from 5b7aad6 to ef78c90 Compare July 28, 2016 01:35
- Make the Demangle header match the other headers in the doc (e.g.,
  double hash)
- Add a table of contents that is sorted alphabetically by request key
  with a link to the header in the document
@RLovelett RLovelett force-pushed the improvement/SR-2117-Add-documentation-for-SourceKit-request-types branch from ef78c90 to 54bb408 Compare July 28, 2016 01:38
@RLovelett
Copy link
Contributor Author

I added one more commit after I submitted the PR. The new commit adds a "table of contents" to the top of the document that attempts to make it easier to navigate through the document.

The table of contents is sorted alphabetically by the key name. Which is different than the order in the document. This may be a cause of concern. Just thought I'd point it out.

| [Documentation](#documentation) | source.request.docinfo |
| [Module interface generation](#module-interface-generation) | source.request.editor.open.interface |
| [Indexing](#indexing) | source.request.indexsource |
| [Protocol Version](#protocol-version) | source.request.protocol_version |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, this is a huge improvement. Thank you!! 😍

@modocache
Copy link
Contributor

modocache commented Jul 28, 2016

I don't mind terribly about the table of contents and the document being in the wrong order for now, but it would be nice to sync them up at some point in the future. Do you think we should alphabetize everything?

This has no impact on CI, and I can't imagine anyone would be against more documentation here, so normally I'd merge, but it appears I'm not authorized. I wonder what's up...?

screen shot 2016-07-28 at 11 23 57 am

@modocache
Copy link
Contributor

My guess is that this has something to do with Swift 3 finalization; not sure. Looking into it.

@gribozavr
Copy link
Contributor

@swift-ci Please smoke test

@gribozavr
Copy link
Contributor

We need a smoke test because the documentation is built as a part of the build process, and any errors in the markup break the build.

@modocache
Copy link
Contributor

Oh right, I thought that was just for Sphinx and RST files; didn't realize it was for markdown as well. Thanks!

@gribozavr
Copy link
Contributor

Sorry, I didn't notice this was Markdown. I am not that sure that we build Markdown files, but let's wait until CI finishes.

@gribozavr gribozavr merged commit 5a1f5e5 into swiftlang:master Jul 28, 2016
@RLovelett RLovelett deleted the improvement/SR-2117-Add-documentation-for-SourceKit-request-types branch July 28, 2016 19:13
@RLovelett
Copy link
Contributor Author

I don't mind terribly about the table of contents and the document being in the wrong order for now, but it would be nice to sync them up at some point in the future. Do you think we should alphabetize everything?

@modocache I agree they really should be in sync. The immediate reason I didn't alphabetize the posts was that I didn't want too big of a change request. I wanted it to be clear that it was purely additive and not step on any toes.

To be honest I'm not sure if I think they should be in alphabetical order. When I was playing around with the code I kind of felt that some of the requests were logically grouped together (e.g., the requests with keys that start with source.request.editor.*).

Though I could not, and cannot yet, articulate how. So to apply anything other than alphabetical order was beyond me. It seemed like an easy grouping for now until, if?, a high-order grouping appears down the road.

@modocache
Copy link
Contributor

Yeah, that makes sense. If you ever feel like rearranging them, I'd be happy to review that pull request.

@RLovelett
Copy link
Contributor Author

I'll work on this again tonight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants