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

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

Public Member Functions

 Range ()=default
 
 Range (Position start, Position end)
 
 Range (Position loc)
 
 Range (llvm::SourceMgr &mgr, SMRange range)
 Construct a range from the given source range. More...
 
bool contains (Position pos) const
 
bool contains (Range range) const
 
SMRange getAsSMRange (llvm::SourceMgr &mgr) const
 Convert this range into a source range in the main file of the given source manager. More...
 

Public Attributes

Position start
 The range's start position. More...
 
Position end
 The range's end position. More...
 

Friends

bool operator== (const Range &lhs, const Range &rhs)
 
bool operator!= (const Range &lhs, const Range &rhs)
 
bool operator< (const Range &lhs, const Range &rhs)
 

Detailed Description

Definition at line 329 of file Protocol.h.

Constructor & Destructor Documentation

◆ Range() [1/4]

mlir::lsp::Range::Range ( )
default

◆ Range() [2/4]

mlir::lsp::Range::Range ( Position  start,
Position  end 
)
inline

Definition at line 331 of file Protocol.h.

◆ Range() [3/4]

mlir::lsp::Range::Range ( Position  loc)
inline

Definition at line 332 of file Protocol.h.

◆ Range() [4/4]

mlir::lsp::Range::Range ( llvm::SourceMgr &  mgr,
SMRange  range 
)
inline

Construct a range from the given source range.

Definition at line 335 of file Protocol.h.

Member Function Documentation

◆ contains() [1/2]

bool mlir::lsp::Range::contains ( Position  pos) const
inline

Definition at line 354 of file Protocol.h.

References end, and start.

◆ contains() [2/2]

bool mlir::lsp::Range::contains ( Range  range) const
inline

Definition at line 355 of file Protocol.h.

References end, and start.

◆ getAsSMRange()

SMRange mlir::lsp::Range::getAsSMRange ( llvm::SourceMgr &  mgr) const
inline

Convert this range into a source range in the main file of the given source manager.

Definition at line 361 of file Protocol.h.

References end, mlir::lsp::Position::getAsSMLoc(), and start.

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( const Range lhs,
const Range rhs 
)
friend

Definition at line 347 of file Protocol.h.

◆ operator<

bool operator< ( const Range lhs,
const Range rhs 
)
friend

Definition at line 350 of file Protocol.h.

◆ operator==

bool operator== ( const Range lhs,
const Range rhs 
)
friend

Definition at line 344 of file Protocol.h.

Member Data Documentation

◆ end

Position mlir::lsp::Range::end

The range's end position.

Definition at line 342 of file Protocol.h.

Referenced by contains(), mlir::lsp::fromJSON(), getAsSMRange(), mlir::lsp::operator<<(), and mlir::lsp::toJSON().

◆ start

Position mlir::lsp::Range::start

The range's start position.

Definition at line 339 of file Protocol.h.

Referenced by contains(), mlir::lsp::fromJSON(), getAsSMRange(), mlir::lsp::operator<<(), and mlir::lsp::toJSON().


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