♻️ 使用module重构所有代码
This commit is contained in:
@@ -0,0 +1,89 @@
|
||||
module;
|
||||
|
||||
export module lsp.protocol.text_document.formatting;
|
||||
|
||||
import std;
|
||||
|
||||
import lsp.protocol.common.basic_types;
|
||||
import lsp.protocol.text_document.document_sync;
|
||||
import lsp.protocol.window.progress;
|
||||
|
||||
export namespace lsp::protocol
|
||||
{
|
||||
// Document Formatting
|
||||
struct DocumentFormattingClientCapabilities
|
||||
{
|
||||
std::optional<boolean> dynamicRegistration;
|
||||
};
|
||||
|
||||
struct DocumentFormattingOptions : WorkDoneProgressOptions
|
||||
{
|
||||
};
|
||||
|
||||
struct DocumentFormattingRegistrationOptions : TextDocumentRegistrationOptions, DocumentFormattingOptions
|
||||
{
|
||||
};
|
||||
|
||||
struct FormattingOptions
|
||||
{
|
||||
uinteger tabSize;
|
||||
boolean insertSpaces;
|
||||
std::optional<boolean> trimTrailingWhitespace;
|
||||
std::optional<boolean> insertFinalNewline;
|
||||
std::optional<boolean> trimFinalNewlines;
|
||||
std::map<string, std::variant<boolean, integer, string>> key;
|
||||
};
|
||||
|
||||
struct DocumentFormattingParams : WorkDoneProgressParams
|
||||
{
|
||||
TextDocumentIdentifier textDocument;
|
||||
FormattingOptions options;
|
||||
};
|
||||
|
||||
// Document Range Formatting
|
||||
struct DocumentRangeFormattingClientCapabilities
|
||||
{
|
||||
std::optional<boolean> dynamicRegistration;
|
||||
std::optional<boolean> rangesSupport;
|
||||
};
|
||||
|
||||
struct DocumentRangeFormattingOptions : WorkDoneProgressOptions
|
||||
{
|
||||
std::optional<boolean> rangesSupport;
|
||||
};
|
||||
|
||||
struct DocumentRangeFormattingRegistrationOptions : TextDocumentRegistrationOptions, DocumentRangeFormattingOptions
|
||||
{
|
||||
};
|
||||
|
||||
struct DocumentRangeFormattingParams : WorkDoneProgressParams
|
||||
{
|
||||
TextDocumentIdentifier textDocument;
|
||||
Range range;
|
||||
FormattingOptions options;
|
||||
};
|
||||
|
||||
// Document On Type Formatting
|
||||
struct DocumentOnTypeFormattingClientCapabilities
|
||||
{
|
||||
std::optional<boolean> dynamicRegistration;
|
||||
};
|
||||
|
||||
struct DocumentOnTypeFormattingOptions : WorkDoneProgressOptions
|
||||
{
|
||||
string firstTriggerCharacter;
|
||||
std::optional<std::vector<string>> moreTriggerCharacter;
|
||||
};
|
||||
|
||||
struct DocumentOnTypeFormattingRegistrationOptions : TextDocumentRegistrationOptions, DocumentOnTypeFormattingOptions
|
||||
{
|
||||
};
|
||||
|
||||
struct DocumentOnTypeFormattingParams
|
||||
{
|
||||
TextDocumentIdentifier textDocument;
|
||||
Position position;
|
||||
string ch;
|
||||
FormattingOptions options;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user