Skip to content

[SourceKit] Document source.request.relatedidents - #92586

Open
Aditya-XR wants to merge 1 commit into
swiftlang:mainfrom
Aditya-XR:docs/sourcekit-relatedidents
Open

Aditya-XR wants to merge 1 commit into
swiftlang:mainfrom
Aditya-XR:docs/sourcekit-relatedidents

Conversation

@Aditya-XR

Copy link
Copy Markdown

Adds a "Related Identifiers" section to tools/SourceKit/docs/Protocol.md and a row for it in the table of contents. The section follows the format of the existing sections (Cursor Info, Expression Type) and covers:

  • Request keys: key.primary_file / key.sourcefile, key.offset, key.compilerargs, key.include_non_editable_base_names and key.cancel_on_subsequent_request. These come from handleRequestRelatedIdents in Requests.cpp.
  • Response: key.results entries with key.offset, key.length and key.nametype (the source.syntacticrename.* UIDs), plus key.name. These come from findRelatedIdents.
  • Testing: how to use sourcekitd-test -req=related-idents. The example input and output are copied from test/SourceKit/RelatedIdents/related_idents.swift (the CHECK1 case), so they match what the tool actually prints.

This is a documentation-only change.

Part of #44725. That issue tracks documenting the remaining SourceKit request types, and I plan to cover the others in separate small PRs.

Add a section to Protocol.md describing the request keys, the response
format and how to exercise the request with sourcekitd-test.

Part of swiftlang#44725
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.

1 participant