blob: e3118ce2e12d39c814d0fdc66e9d1ba48475514c [file] [log] [blame]
//===--- EditorPlaceholder.h - Handling for editor placeholders -*- C++ -*-===//
// This source file is part of the open source project
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
// See for license information
// See for the list of Swift project authors
/// \file
/// Provides info about editor placeholders, <#such as this#>.
#include "llvm/ADT/StringRef.h"
#include "swift/Basic/LLVM.h"
namespace swift {
enum class EditorPlaceholderKind {
struct EditorPlaceholderData {
/// Placeholder kind.
EditorPlaceholderKind Kind;
/// The part that is displayed in the editor.
StringRef Display;
/// If kind is \c Typed, this is the type string for the placeholder.
StringRef Type;
/// If kind is \c Typed, this is the type string to be considered for
/// placeholder expansion.
/// It can be same as \c Type or different if \c Type is a typealias.
StringRef TypeForExpansion;
/// Deconstructs a placeholder string and returns info about it.
/// \returns None if the \c PlaceholderText is not a valid placeholder string.
parseEditorPlaceholder(StringRef PlaceholderText);
/// Checks if an identifier with the given text is an editor placeholder
bool isEditorPlaceholder(StringRef IdentifierText);
} // end namespace swift