[formatting] Rename formattingOptions to options

LanguageClient-neovim `:call LanguageClient_formatting()` works now
This commit is contained in:
Fangrui Song 2017-12-31 15:46:24 -08:00
parent c97bc5dbac
commit cd2f3c1e45

View File

@ -19,11 +19,11 @@ struct lsTextDocumentFormattingParams {
lsTextDocumentIdentifier textDocument; lsTextDocumentIdentifier textDocument;
// The format options, like tabs or spaces. // The format options, like tabs or spaces.
lsFormattingOptions formattingOptions; lsFormattingOptions options;
}; };
MAKE_REFLECT_STRUCT(lsTextDocumentFormattingParams, MAKE_REFLECT_STRUCT(lsTextDocumentFormattingParams,
textDocument, textDocument,
formattingOptions); options);
struct Ipc_TextDocumentFormatting struct Ipc_TextDocumentFormatting
: public IpcMessage<Ipc_TextDocumentFormatting> { : public IpcMessage<Ipc_TextDocumentFormatting> {
@ -57,8 +57,8 @@ struct TextDocumentFormattingHandler
WorkingFile* working_file = WorkingFile* working_file =
working_files->GetFileByFilename(file->def->path); working_files->GetFileByFilename(file->def->path);
int tab_size = request->params.formattingOptions.tabSize; int tab_size = request->params.options.tabSize;
bool insert_spaces = request->params.formattingOptions.insertSpaces; bool insert_spaces = request->params.options.insertSpaces;
const auto clang_format = std::unique_ptr<ClangFormat>(new ClangFormat( const auto clang_format = std::unique_ptr<ClangFormat>(new ClangFormat(
working_file->filename, working_file->buffer_content, working_file->filename, working_file->buffer_content,