Browse Source

Language protocol: added buffer tab size and char on textDocument/Formatting

merge-requests/365/head
eidheim 8 years ago
parent
commit
a4246fa56c
  1. 2
      src/source_language_protocol.cc

2
src/source_language_protocol.cc

@ -380,7 +380,7 @@ void Source::LanguageProtocolView::setup_navigation_and_refactoring() {
};
std::vector<Replace> replaces;
std::promise<void> result_processed;
client->write_request("textDocument/formatting", "\"textDocument\":{\"uri\":\""+uri+"\"},\"options\":{\"tabSize\":2,\"insertSpaces\":true}", [&replaces, &result_processed](const boost::property_tree::ptree &result, bool error) {
client->write_request("textDocument/formatting", "\"textDocument\":{\"uri\":\""+uri+"\"},\"options\":{\"tabSize\":"+std::to_string(tab_size)+",\"insertSpaces\":"+(tab_char==' '?"true":"false")+"}", [&replaces, &result_processed](const boost::property_tree::ptree &result, bool error) {
if(!error) {
for(auto it=result.begin();it!=result.end();++it) {
auto range_it=it->second.find("range");

Loading…
Cancel
Save