Browse Source

Language protocol: fixed documentSymbol queries

merge-requests/389/head
eidheim 7 years ago
parent
commit
24246de5c3
  1. 2
      src/project.cc
  2. 2
      src/source_language_protocol.cc

2
src/project.cc

@ -741,7 +741,7 @@ void Project::LanguageProtocol::show_symbols() {
else { else {
std::vector<std::string> rows; std::vector<std::string> rows;
std::promise<void> result_processed; std::promise<void> result_processed;
client->write_request(nullptr, "textDocument/documentSymbol", R"("textDocument":{"uri":"file://)" + language_protocol_view->file_path.string() + "\"}", [&result_processed, &rows, locations](const boost::property_tree::ptree &result, bool error) { client->write_request(language_protocol_view, "textDocument/documentSymbol", R"("textDocument":{"uri":"file://)" + language_protocol_view->file_path.string() + "\"}", [&result_processed, &rows, locations](const boost::property_tree::ptree &result, bool error) {
if(!error) { if(!error) {
for(auto it = result.begin(); it != result.end(); ++it) { for(auto it = result.begin(); it != result.end(); ++it) {
try { try {

2
src/source_language_protocol.cc

@ -860,7 +860,7 @@ void Source::LanguageProtocolView::setup_navigation_and_refactoring() {
std::vector<std::pair<Offset, std::string>> methods; std::vector<std::pair<Offset, std::string>> methods;
std::promise<void> result_processed; std::promise<void> result_processed;
client->write_request(nullptr, "textDocument/documentSymbol", R"("textDocument":{"uri":"file://)" + file_path.string() + "\"}", [&result_processed, &methods](const boost::property_tree::ptree &result, bool error) { client->write_request(this, "textDocument/documentSymbol", R"("textDocument":{"uri":"file://)" + file_path.string() + "\"}", [&result_processed, &methods](const boost::property_tree::ptree &result, bool error) {
if(!error) { if(!error) {
for(auto it = result.begin(); it != result.end(); ++it) { for(auto it = result.begin(); it != result.end(); ++it) {
try { try {

Loading…
Cancel
Save