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

#include "llvm/Support/LSP/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.
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.

Public Attributes

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

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

Constructor & Destructor Documentation

◆ Range() [1/4]

llvm::lsp::Range::Range ( )
default

◆ Range() [2/4]

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

Definition at line 341 of file Protocol.h.

References end, and start.

◆ Range() [3/4]

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

Definition at line 342 of file Protocol.h.

References Range().

◆ Range() [4/4]

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

Construct a range from the given source range.

Definition at line 345 of file Protocol.h.

References Range().

Member Function Documentation

◆ contains() [1/2]

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

Definition at line 364 of file Protocol.h.

References end, and start.

◆ contains() [2/2]

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

Definition at line 365 of file Protocol.h.

References end, Range(), and start.

◆ getAsSMRange()

SMRange llvm::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 371 of file Protocol.h.

References end, llvm::SMLoc::getPointer(), llvm::SMLoc::isValid(), and start.

◆ operator!=

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

Definition at line 357 of file Protocol.h.

References Range().

◆ operator<

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

Definition at line 360 of file Protocol.h.

References end, Range(), and start.

◆ operator==

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

Definition at line 354 of file Protocol.h.

References end, Range(), and start.

Member Data Documentation

◆ end

Position llvm::lsp::Range::end

The range's end position.

Definition at line 352 of file Protocol.h.

Referenced by contains(), contains(), getAsSMRange(), operator<, operator==, and Range().

◆ start

Position llvm::lsp::Range::start

The range's start position.

Definition at line 349 of file Protocol.h.

Referenced by contains(), contains(), getAsSMRange(), operator<, operator==, and Range().


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