-
Notifications
You must be signed in to change notification settings - Fork 285
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
Add textDocument/doccDocumentation
request
#1851
Add textDocument/doccDocumentation
request
#1851
Conversation
3992c85
to
55b492d
Compare
88e5500
to
f4e4e06
Compare
@swift-ci please test |
@swift-ci please test windows platform |
349e88e
to
ce904ba
Compare
@swift-ci please test |
@swift-ci please test windows platform |
@swift-ci please test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for implementing this @matthewbastien! Looking forward to seeing docc-support in VS Code.
Sources/LanguageServerProtocol/Requests/ConvertDocumentationRequest.swift
Outdated
Show resolved
Hide resolved
@swift-ci please test |
@swift-ci please test windows platform |
textDocument/convertDocumentation
requesttextDocument/doccDocumentation
request
@swift-ci please test |
@swift-ci please test windows platform |
@swift-ci please test |
@swift-ci please test windows platform |
ba46eb8
to
bb636b6
Compare
@swift-ci please test |
@swift-ci please test windows platform |
Sources/LanguageServerProtocol/Requests/DoccDocumentationRequest.swift
Outdated
Show resolved
Hide resolved
guard let renderNodeData = convertResponse.renderNodes.first else { | ||
throw ResponseError.internalError("SwiftDocC did not return any render nodes") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don’t know much about docc but when would the response contain multiple render nodes? And would it be safe to ignore any but the first in that case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DocC will only emit multiple render nodes if you request multiple USRs to convert. In our case we only ever request documentation for a single USR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add that as a comment so we don’t have to wonder about it again?
bb636b6
to
561aad2
Compare
@swift-ci please test |
@swift-ci please test windows platform |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work. Let’s get this in.
Support documentation live preview in Swift files by handling requests to convert documentation using Swift DocC.
This PR adds a new request method
textDocument/doccDocumentation
that responds with a JSON encoded RenderNode created using Swift DocC's ConvertService. This request has two parameters:The request is only supported on macOS and Linux until Swift DocC can be made to support Windows.