MLIR  20.0.0git
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
mlir::lsp::TextDocumentContentChangeEvent Struct Reference

#include "mlir/Tools/lsp-server-support/Protocol.h"

Public Member Functions

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

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. More...
 

Public Attributes

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

Detailed Description

Definition at line 480 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.

◆ applyTo() [2/2]

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

Try to apply this change to the given contents string.

Definition at line 514 of file Protocol.cpp.

References range, and text.

Member Data Documentation

◆ range

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

The range of the document that changed.

Definition at line 488 of file Protocol.h.

Referenced by applyTo(), and mlir::lsp::fromJSON().

◆ rangeLength

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

The length of the range that got replaced.

Definition at line 491 of file Protocol.h.

Referenced by mlir::lsp::fromJSON().

◆ text

std::string mlir::lsp::TextDocumentContentChangeEvent::text

The new text of the range/document.

Definition at line 494 of file Protocol.h.

Referenced by applyTo(), and mlir::lsp::fromJSON().


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