|
| 1 | +/* |
| 2 | + This file is part of solidity. |
| 3 | +
|
| 4 | + solidity is free software: you can redistribute it and/or modify |
| 5 | + it under the terms of the GNU General Public License as published by |
| 6 | + the Free Software Foundation, either version 3 of the License, or |
| 7 | + (at your option) any later version. |
| 8 | +
|
| 9 | + solidity is distributed in the hope that it will be useful, |
| 10 | + but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | + GNU General Public License for more details. |
| 13 | +
|
| 14 | + You should have received a copy of the GNU General Public License |
| 15 | + along with solidity. If not, see <http://www.gnu.org/licenses/>. |
| 16 | +*/ |
| 17 | +// SPDX-License-Identifier: GPL-3.0 |
| 18 | +#pragma once |
| 19 | + |
| 20 | +#include <liblangutil/SourceLocation.h> |
| 21 | +#include <liblangutil/SourceReferenceExtractor.h> // LineColumn |
| 22 | + |
| 23 | +#include <optional> |
| 24 | +#include <ostream> |
| 25 | +#include <string> |
| 26 | +#include <vector> |
| 27 | + |
| 28 | +namespace solidity::lsp |
| 29 | +{ |
| 30 | + |
| 31 | +struct LineColumnRange |
| 32 | +{ |
| 33 | + langutil::LineColumn start; |
| 34 | + langutil::LineColumn end; |
| 35 | +}; |
| 36 | + |
| 37 | +enum class Trace { Off, Messages, Verbose }; |
| 38 | + |
| 39 | +struct DocumentPosition { |
| 40 | + std::string path; |
| 41 | + langutil::LineColumn position; |
| 42 | +}; |
| 43 | + |
| 44 | +enum class DocumentHighlightKind { |
| 45 | + Unspecified, |
| 46 | + Text, //!< a textual occurrence |
| 47 | + Read, //!< read access to a variable |
| 48 | + Write, //!< write access to a variable |
| 49 | +}; |
| 50 | + |
| 51 | +// Represents a symbol / AST node that is to be highlighted, with some context associated. |
| 52 | +struct DocumentHighlight { |
| 53 | + langutil::SourceLocation location; |
| 54 | + // std::string sourceName; |
| 55 | + // LineColumnRange range; |
| 56 | + DocumentHighlightKind kind = DocumentHighlightKind::Unspecified; |
| 57 | +}; |
| 58 | + |
| 59 | +enum class DiagnosticSeverity { |
| 60 | + Error = 1, |
| 61 | + Warning = 2, |
| 62 | + Information = 3, |
| 63 | + Hint = 4, |
| 64 | +}; |
| 65 | + |
| 66 | +/// Represents a related message and source code location for a diagnostic. This should be |
| 67 | +/// used to point to code locations that cause or related to a diagnostics, e.g when duplicating |
| 68 | +/// a symbol in a scope. |
| 69 | +struct DiagnosticRelatedInformation { |
| 70 | + langutil::SourceLocation location; // The location of this related diagnostic information. |
| 71 | + std::string message; // The message of this related diagnostic information. |
| 72 | +}; |
| 73 | + |
| 74 | +} |
0 commit comments