-
Notifications
You must be signed in to change notification settings - Fork 314
Always try to render some documentation for Swift files #2198
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
Always try to render some documentation for Swift files #2198
Conversation
@swift-ci please test |
@swift-ci please test |
@swift-ci please test Windows |
@swift-ci please test |
@swift-ci please test windows |
1 similar comment
@swift-ci please test windows |
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.
That looks straightforward to me. Two minor comments.
@swift-ci please test |
@swift-ci please test Windows |
@swift-ci Please test Windows |
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.
LGTM
The error message
No documentation could be rendered for the position in this document
can be rather confusing. It was also being displayed in situations where the cursor was placed at the beginning or end of a Swift file.This PR changes the behaviour of finding the nearest symbol to the cursor in a
textDocument/doccDocumentation
request for Swift files. If the token at the cursor does not point at a valid documentable symbol we will now walk forwards through the list of tokens to see if any of them are a valid documentable symbol. If this still fails then we walk backwards from the cursor until we find a documentable symbol. The error message has also been changed toNo documentable symbols were found in this Swift file
in the event that no symbols are available at all for display.Also, I've added a separate error message for unsupported languages with
textDocument/doccDocumentation
.