diff options
Diffstat (limited to 'graphics/asymptote/LspCpp/include/LibLsp/lsp/lsTextEdit.h')
-rw-r--r-- | graphics/asymptote/LspCpp/include/LibLsp/lsp/lsTextEdit.h | 49 |
1 files changed, 21 insertions, 28 deletions
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsTextEdit.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsTextEdit.h index 29699c9c31..a6ec3e913f 100644 --- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsTextEdit.h +++ b/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsTextEdit.h @@ -2,12 +2,9 @@ #include "LibLsp/JsonRpc/serializer.h" - - #include <string> #include "lsRange.h" - //Since 3.16.0 there is also the concept of an annotated text edit which supports to add an annotation to a text edit. //The annotation can add information describing the change to the text edit. /** @@ -17,28 +14,27 @@ */ struct lsChangeAnnotation { - /** + /** * A human-readable string describing the actual change. The string * is rendered prominent in the user interface. */ - std::string label; + std::string label; - /** + /** * A flag which indicates that user confirmation is needed * before applying the change. */ - optional<bool> needsConfirmation; + optional<bool> needsConfirmation; - /** + /** * A human-readable string which is rendered less prominent in * the user interface. */ - optional < std::string > description; - MAKE_REFLECT_STRUCT(lsChangeAnnotation, label, needsConfirmation, description) + optional<std::string> description; + MAKE_REFLECT_STRUCT(lsChangeAnnotation, label, needsConfirmation, description) }; MAKE_REFLECT_STRUCT(lsChangeAnnotation, label, needsConfirmation, description) - //Usually clients provide options to group the changes along the annotations they are associated with. //To support this in the protocol an edit or resource operation refers to a change annotation //using an identifier and not the change annotation literal directly.This allows servers to use @@ -46,8 +42,6 @@ MAKE_REFLECT_STRUCT(lsChangeAnnotation, label, needsConfirmation, description) //to group the operations under that change annotation.The actual change annotations together with //their identifers are managed by the workspace edit via the new property changeAnnotations. - - /** * An identifier referring to a change annotation managed by a workspace * edit. @@ -61,27 +55,26 @@ using lsChangeAnnotationIdentifier = std::string; * @since 3.16.0. */ - //A textual edit applicable to a text document. -struct lsTextEdit { - // The range of the text document to be manipulated. To insert - // text into a document create a range where start === end. - lsRange range; +struct lsTextEdit +{ + // The range of the text document to be manipulated. To insert + // text into a document create a range where start === end. + lsRange range; - // The string to be inserted. For delete operations use an - // empty string. - std::string newText; + // The string to be inserted. For delete operations use an + // empty string. + std::string newText; - /** + /** * The actual annotation identifier. */ - optional<lsChangeAnnotationIdentifier> annotationId; - + optional<lsChangeAnnotationIdentifier> annotationId; - bool operator==(const lsTextEdit& that); - std::string ToString() const; - MAKE_SWAP_METHOD(lsTextEdit, range, newText, annotationId) + bool operator==(lsTextEdit const& that); + std::string ToString() const; + MAKE_SWAP_METHOD(lsTextEdit, range, newText, annotationId) }; MAKE_REFLECT_STRUCT(lsTextEdit, range, newText, annotationId) -using lsAnnotatedTextEdit = lsTextEdit; +using lsAnnotatedTextEdit = lsTextEdit; |