diff options
Diffstat (limited to 'graphics/asymptote/LspCpp/include/LibLsp/lsp/location_type.h')
-rw-r--r-- | graphics/asymptote/LspCpp/include/LibLsp/lsp/location_type.h | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/location_type.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/location_type.h new file mode 100644 index 0000000000..14e130f571 --- /dev/null +++ b/graphics/asymptote/LspCpp/include/LibLsp/lsp/location_type.h @@ -0,0 +1,63 @@ +#pragma once + +#include "lsDocumentUri.h" +#include "lsRange.h" +//Represents a location inside a resource, such as a line inside a text file. +struct lsLocation { + lsLocation(); + lsLocation(lsDocumentUri uri, lsRange range); + + bool operator==(const lsLocation& other) const; + bool operator<(const lsLocation& o) const; + + lsDocumentUri uri; + lsRange range; + MAKE_SWAP_METHOD(lsLocation, uri, range) +}; +MAKE_REFLECT_STRUCT(lsLocation, uri, range) + + + +struct LinkLocation :public lsLocation +{ + std::string displayName; + std::string kind; + MAKE_REFLECT_STRUCT(LinkLocation, uri, range, displayName, kind) +}; +MAKE_REFLECT_STRUCT(LinkLocation, uri, range, displayName,kind) + +//Represents a link between a sourceand a target location. +struct LocationLink +{ + /** + * Span of the origin of this link. + * + * Used as the underlined span for mouse interaction. Defaults to the word range at + * the mouse position. + */ + boost::optional<lsRange> originSelectionRange; + + /** + * The target resource identifier of this link. + */ + + lsDocumentUri targetUri; + + /** + * The full target range of this link. If the target for example is a symbol then target range is the + * range enclosing this symbol not including leading/trailing whitespace but everything else + * like comments. This information is typically used to highlight the range in the editor. + */ + + lsRange targetRange; + + /** + * The range that should be selected and revealed when this link is being followed, e.g the name of a function. + * Must be contained by the the `targetRange`. See also `DocumentSymbol#range` + */ + + lsRange targetSelectionRange; + + MAKE_SWAP_METHOD(LocationLink, originSelectionRange, targetUri, targetRange, targetSelectionRange); +}; +MAKE_REFLECT_STRUCT(LocationLink, originSelectionRange, targetUri, targetRange, targetSelectionRange);
\ No newline at end of file |