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

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

+ Collaboration diagram for mlir::lsp::TextDocumentContentChangeEvent:

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

Optional< Rangerange
 The range of the document that changed. More...
 
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 453 of file Protocol.h.

Member Function Documentation

◆ applyTo() [1/2]

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

Try to apply this change to the given contents string.

Definition at line 479 of file Protocol.cpp.

References mlir::failure(), and mlir::success().

Referenced by getLspDiagnoticFromDiag().

◆ applyTo() [2/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 500 of file Protocol.cpp.

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

Member Data Documentation

◆ range

Optional<Range> mlir::lsp::TextDocumentContentChangeEvent::range

The range of the document that changed.

Definition at line 461 of file Protocol.h.

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

◆ rangeLength

Optional<int> mlir::lsp::TextDocumentContentChangeEvent::rangeLength

The length of the range that got replaced.

Definition at line 464 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 467 of file Protocol.h.

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


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