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

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

+ Collaboration diagram for mlir::lsp::Range:

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 302 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 304 of file Protocol.h.

◆ Range() [3/4]

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

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

Member Function Documentation

◆ contains() [1/2]

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

Definition at line 327 of file Protocol.h.

◆ contains() [2/2]

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

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

References mlir::lsp::fromJSON(), mlir::lsp::Position::getAsSMLoc(), mlir::lsp::operator<<(), and mlir::lsp::toJSON().

Referenced by shouldAddHintFor().

Friends And Related Function Documentation

◆ operator!=

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

Definition at line 320 of file Protocol.h.

◆ operator<

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

Definition at line 323 of file Protocol.h.

◆ operator==

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

Definition at line 317 of file Protocol.h.

Member Data Documentation

◆ end

Position mlir::lsp::Range::end

The range's end position.

Definition at line 315 of file Protocol.h.

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

◆ start

Position mlir::lsp::Range::start

The range's start position.

Definition at line 312 of file Protocol.h.

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


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