LLVM 22.0.0git
llvm::lsp::TextDocumentContentChangeEvent Struct Reference

#include "llvm/Support/LSP/Protocol.h"

Public Member Functions

LogicalResult applyTo (std::string &contents) const
 Try to apply this change to the given contents string.

Static Public Member Functions

static LogicalResult applyTo (ArrayRef< TextDocumentContentChangeEvent > changes, std::string &contents)
 Try to apply a set of changes to the given contents string.

Public Attributes

std::optional< Rangerange
 The range of the document that changed.
std::optional< int > rangeLength
 The length of the range that got replaced.
std::string text
 The new text of the range/document.

Detailed Description

Definition at line 490 of file Protocol.h.

Member Function Documentation

◆ applyTo() [1/2]

LogicalResult TextDocumentContentChangeEvent::applyTo ( ArrayRef< TextDocumentContentChangeEvent > changes,
std::string & contents )
static

Try to apply a set of changes to the given contents string.

Definition at line 535 of file Protocol.cpp.

References llvm::failed(), llvm::failure(), and llvm::success.

◆ applyTo() [2/2]

LogicalResult TextDocumentContentChangeEvent::applyTo ( std::string & contents) const

Member Data Documentation

◆ range

std::optional<Range> llvm::lsp::TextDocumentContentChangeEvent::range

The range of the document that changed.

Definition at line 498 of file Protocol.h.

Referenced by applyTo().

◆ rangeLength

std::optional<int> llvm::lsp::TextDocumentContentChangeEvent::rangeLength

The length of the range that got replaced.

Definition at line 501 of file Protocol.h.

◆ text

std::string llvm::lsp::TextDocumentContentChangeEvent::text

The new text of the range/document.

Definition at line 504 of file Protocol.h.

Referenced by applyTo().


The documentation for this struct was generated from the following files: