MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / Position

Class Position

CodeFormatServer/src/LSP/LSP.h:38–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36};
37
38class Position : public Serializable {
39public:
40 Position(std::size_t _line = 0, std::size_t _character = 0);
41
42 std::size_t line;
43 std::size_t character;
44
45 nlohmann::json Serialize() override;
46 void Deserialize(nlohmann::json json) override;
47
48 bool operator==(const Position &p) const {
49 return line == p.line && character == p.character;
50 }
51
52 bool operator<(const Position &p) const {
53 if (line != p.line) {
54 return line < p.line;
55 } else {
56 return character < p.character;
57 }
58 }
59
60 bool operator<=(const Position &p) const {
61 return *this == p || *this < p;
62 }
63
64 bool operator>=(const Position &p) const {
65 return *this == p || !(*this < p);
66 }
67};
68
69class Range : public Serializable {
70public:

Callers 6

OnFormattingMethod · 0.70
OnRangeFormattingMethod · 0.70
OnTypeFormattingMethod · 0.70
RangeClass · 0.70
ReformatMethod · 0.50
DiagnosticMethod · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected