载入中...
搜索中...
未找到
LanguageText.h
浏览该文件的文档.
1#pragma once
2
3#include "common/Export.h"
5
6#include <string>
7#include <string_view>
8#include <vector>
9
10namespace eve::dev::lsp {
11
14 unsigned tabSize = 4;
15 bool insertSpaces = true;
16};
17
20 size_t startLine = 0;
21 size_t endLine = 0;
22 std::string kind;
23};
24
26EVENGINE_API_FOUNDATION size_t offsetAt(std::string_view source, Position position) noexcept;
27
29EVENGINE_API_FOUNDATION Range documentRange(std::string_view source) noexcept;
30
32EVENGINE_API_FOUNDATION size_t lastLineIndex(std::string_view source) noexcept;
33
38EVENGINE_API_FOUNDATION Range coveringLines(std::string_view source, size_t startLine,
39 size_t endLineInclusive) noexcept;
40
42EVENGINE_API_FOUNDATION std::string sliceLines(std::string_view source, size_t startLine, size_t endLineInclusive);
43
49EVENGINE_API_FOUNDATION bool applyIncremental(std::string& source, const Range* range, std::string_view text);
50
52EVENGINE_API_FOUNDATION std::string formatEveScript(std::string_view source, const FormatOptions& options = {});
53
55EVENGINE_API_FOUNDATION std::vector<FoldingRange> foldingRanges(std::string_view source);
56
57} // namespace eve::dev::lsp
#define EVENGINE_API_FOUNDATION
每个链接组(link group)各自的导出宏。
Definition Export.h:106
std::string text
Range range
std::array< float, 3 > position
const SquirrelValueOptions & options
const UnitySourceAsset & source
size_t offsetAt(std::string_view source, Position position) noexcept
Converts an LSP position into a UTF-8 byte offset (same contract as the rest of the server).
size_t lastLineIndex(std::string_view source) noexcept
Last 0-based line index (empty source is line 0).
std::string sliceLines(std::string_view source, size_t startLine, size_t endLineInclusive)
Source bytes for coveringLines of the same line span.
bool applyIncremental(std::string &source, const Range *range, std::string_view text)
Applies one LSP content change.
std::string formatEveScript(std::string_view source, const FormatOptions &options)
Indents EveScript by braces/brackets and trims trailing whitespace.
Range coveringLines(std::string_view source, size_t startLine, size_t endLineInclusive) noexcept
Half-open LSP range covering startLine through endLine inclusive. Ends at the start of the following ...
Range documentRange(std::string_view source) noexcept
Full-document range covering every character in source.
std::vector< FoldingRange > foldingRanges(std::string_view source)
Brace, bracket, and block-comment folds that span more than one line.
One foldable region (0-based inclusive end line).
Editor formatting preferences from LSP FormattingOptions.
Position public API.
Range public API.