diff --git a/src/language_server_api.h b/src/language_server_api.h index c600e74f..cd139ede 100644 --- a/src/language_server_api.h +++ b/src/language_server_api.h @@ -273,25 +273,6 @@ struct lsTextDocumentPositionParams { }; MAKE_REFLECT_STRUCT(lsTextDocumentPositionParams, textDocument, position); -struct lsFormattingOptions { - // Size of a tab in spaces. - int tabSize; - // Prefer spaces over tabs. - bool insertSpaces; -}; -MAKE_REFLECT_STRUCT(lsFormattingOptions, tabSize, insertSpaces); - -struct lsTextDocumentFormattingParams { - // The text document. - lsTextDocumentIdentifier textDocument; - - // The format options, like tabs or spaces. - lsFormattingOptions formattingOptions; -}; -MAKE_REFLECT_STRUCT(lsTextDocumentFormattingParams, - textDocument, - formattingOptions); - struct lsTextEdit { // The range of the text document to be manipulated. To insert // text into a document create a range where start === end. diff --git a/src/messages/text_document_formatting.cc b/src/messages/text_document_formatting.cc index e5eaac1e..d6846983 100644 --- a/src/messages/text_document_formatting.cc +++ b/src/messages/text_document_formatting.cc @@ -2,6 +2,25 @@ #include "message_handler.h" namespace { +struct lsFormattingOptions { + // Size of a tab in spaces. + int tabSize; + // Prefer spaces over tabs. + bool insertSpaces; +}; +MAKE_REFLECT_STRUCT(lsFormattingOptions, tabSize, insertSpaces); + +struct lsTextDocumentFormattingParams { + // The text document. + lsTextDocumentIdentifier textDocument; + + // The format options, like tabs or spaces. + lsFormattingOptions formattingOptions; +}; +MAKE_REFLECT_STRUCT(lsTextDocumentFormattingParams, + textDocument, + formattingOptions); + struct Ipc_TextDocumentFormatting : public IpcMessage { const static IpcId kIpcId = IpcId::TextDocumentFormatting;