mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[SourceKit] Vend the localization key found in documentation comments
If a documentation comment has a - LocalizationKey: field, strip it out of the documentation body and report it in cursor/doc info with the key "key.localization_key". rdar://problem/30383329
This commit is contained in:
@@ -29,6 +29,10 @@ namespace ide {
|
||||
/// \returns true if the declaration has a documentation comment.
|
||||
bool getDocumentationCommentAsXML(const Decl *D, raw_ostream &OS);
|
||||
|
||||
/// If the declaration has a documentation comment and a localization key,
|
||||
/// print it into the given output stream and return true. Else, return false.
|
||||
bool getLocalizationKey(const Decl *D, raw_ostream &OS);
|
||||
|
||||
/// Converts the given comment to Doxygen.
|
||||
void getDocumentationCommentAsDoxygen(const DocComment *DC, raw_ostream &OS);
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ class ParamField;
|
||||
class ReturnsField;
|
||||
class TagField;
|
||||
class ThrowsField;
|
||||
class LocalizationKeyField;
|
||||
|
||||
/// The basic structure of a doc comment attached to a Swift
|
||||
/// declaration.
|
||||
|
||||
@@ -61,7 +61,7 @@ MARKUP_AST_NODE(PrivateExtension, MarkupASTNode)
|
||||
MARKUP_AST_NODE(ExperimentField, PrivateExtension)
|
||||
MARKUP_AST_NODE(ImportantField, PrivateExtension)
|
||||
MARKUP_AST_NODE(InvariantField, PrivateExtension)
|
||||
MARKUP_AST_NODE(LocalizationKey, PrivateExtension)
|
||||
MARKUP_AST_NODE(LocalizationKeyField, PrivateExtension)
|
||||
MARKUP_AST_NODE(MutatingvariantField, PrivateExtension)
|
||||
MARKUP_AST_NODE(NonmutatingvariantField, PrivateExtension)
|
||||
MARKUP_AST_NODE(NoteField, PrivateExtension)
|
||||
|
||||
Reference in New Issue
Block a user