From 057e68fdc15bea76be2c2d80588300a533e625af Mon Sep 17 00:00:00 2001 From: eidheim Date: Thu, 2 Aug 2018 11:25:10 +0200 Subject: [PATCH] Ctags now excludes node_modules, and language protocol show symbols now falls back to Ctags --- src/ctags.cc | 1 + src/project.cc | 16 ++++------------ 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/src/ctags.cc b/src/ctags.cc index 5b5b0d5..32f048e 100644 --- a/src/ctags.cc +++ b/src/ctags.cc @@ -15,6 +15,7 @@ std::pair> Ctags::ge if(!run_path.empty()) { exclude += " --exclude=" + filesystem::get_relative_path(build->get_default_path(), run_path).string(); exclude += " --exclude=" + filesystem::get_relative_path(build->get_debug_path(), run_path).string(); + exclude += " --exclude=node_modules"; } else { boost::system::error_code ec; diff --git a/src/project.cc b/src/project.cc index 4a5198c..8114735 100644 --- a/src/project.cc +++ b/src/project.cc @@ -668,10 +668,8 @@ void Project::LanguageProtocol::show_symbols() { auto language_id = get_language_id(); auto executable_name = language_id + "-language-server"; - if(filesystem::find_executable(executable_name).empty()) { - Info::get().print("Executable " + executable_name + " not found"); - return; - } + if(filesystem::find_executable(executable_name).empty()) + return Base::show_symbols(); auto project_path = std::make_shared(build->project_path); @@ -681,14 +679,8 @@ void Project::LanguageProtocol::show_symbols() { auto view = Notebook::get().get_current_view(); auto language_protocol_view = dynamic_cast(view); - if(!capabilities.workspace_symbol && !capabilities.document_symbol) { - Info::get().print("Language server does not support workspace/symbol or textDocument/documentSymbol"); - return; - } - else if(!language_protocol_view && !capabilities.workspace_symbol) { - Info::get().print("Language server does not support workspace/symbol"); - return; - } + if(!capabilities.workspace_symbol && !(capabilities.document_symbol && language_protocol_view)) + return Base::show_symbols(); if(view) { auto dialog_iter = view->get_iter_for_dialog();