Skip to content

Commit

Permalink
Outline plugin: re-written the support the new LSP features
Browse files Browse the repository at this point in the history
  • Loading branch information
eranif committed Dec 18, 2021
1 parent 8579ccc commit f46b3e8
Show file tree
Hide file tree
Showing 19 changed files with 408 additions and 1,875 deletions.
3 changes: 2 additions & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,5 @@ SpacesInParentheses: false
Standard: C++11
TabWidth: 4
UseTab: Never
SortIncludes: true
SortIncludes: true
IncludeBlocks: Regroup
7 changes: 7 additions & 0 deletions CodeLite/LSP/DocumentSymbolsRequest.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#include "LSP/DocumentSymbolsRequest.hpp"

#include "LSP/LSPEvent.h"
#include "event_notifier.h"
#include "file_logger.h"
#include "json_rpc_params.h"

#include <algorithm>

namespace
Expand Down Expand Up @@ -73,6 +76,10 @@ void LSP::DocumentSymbolsRequest::OnResponse(const LSP::ResponseMessage& respons
if(m_context & CONTEXT_OUTLINE_VIEW) {
QueueEvent(owner, symbols, filename, wxEVT_LSP_DOCUMENT_SYMBOLS_OUTLINE_VIEW);
}

// always fire the wxEVT_LSP_DOCUMENT_SYMBOLS_QUICK_OUTLINE for the EventNotifier
// so it might be used by other plugins as well, e.g. "Outline"
QueueEvent(EventNotifier::Get(), symbols, filename, wxEVT_LSP_DOCUMENT_SYMBOLS_QUICK_OUTLINE);
} else {
std::vector<DocumentSymbol> symbols;
symbols.reserve(size);
Expand Down
4 changes: 3 additions & 1 deletion CodeLite/LSP/LSPEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "LSP/json_rpc_params.h"
#include "cl_command_event.h"
#include "codelite_exports.h"

#include <vector>

#define LSP_LOG_ERROR 1
Expand Down Expand Up @@ -99,7 +100,8 @@ typedef void (wxEvtHandler::*LSPEventFunction)(LSPEvent&);
wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CL, wxEVT_LSP_DEFINITION, LSPEvent);
wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CL, wxEVT_LSP_INITIALIZED, LSPEvent);
wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CL, wxEVT_LSP_COMPLETION_READY, LSPEvent);
wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CL, wxEVT_LSP_DOCUMENT_SYMBOLS_QUICK_OUTLINE, LSPEvent);
wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CL, wxEVT_LSP_DOCUMENT_SYMBOLS_QUICK_OUTLINE,
LSPEvent); // fired twice: m_owner && EventNotifier
wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CL, wxEVT_LSP_DOCUMENT_SYMBOLS_FOR_HIGHLIGHT, LSPEvent);
wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CL, wxEVT_LSP_DOCUMENT_SYMBOLS_OUTLINE_VIEW, LSPEvent);
wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CL, wxEVT_LSP_RESTART_NEEDED, LSPEvent);
Expand Down
109 changes: 55 additions & 54 deletions LiteEditor/CodeLiteIDE.project
Original file line number Diff line number Diff line change
Expand Up @@ -2221,74 +2221,63 @@ resources.cpp: resources.xrc
</Completion>
</Configuration>
</Settings>
<Dependencies Name="Win_x64_Release">
<Dependencies Name="Win_x64_Debug">
<Project Name="PCH"/>
<Project Name="wxscintilla"/>
<Project Name="sqlite3"/>
<Project Name="wxsqlite3"/>
<Project Name="databaselayer_sqlite"/>
<Project Name="wxshapeframework"/>
<Project Name="libCodeLite"/>
<Project Name="plugin_sdk"/>
<Project Name="DebuggerGDB"/>
<Project Name="CodeFormatter"/>
<Project Name="Subversion"/>
<Project Name="DebuggerGDB"/>
<Project Name="Gizmos"/>
<Project Name="Cscope"/>
<Project Name="Copyright"/>
<Project Name="UnitTestPP"/>
<Project Name="CMakePlugin"/>
<Project Name="CodeLiteDiff"/>
<Project Name="ExternalTools"/>
<Project Name="snipwiz"/>
<Project Name="wxFormBuilder"/>
<Project Name="abbreviation"/>
<Project Name="ContinuousBuild"/>
<Project Name="QMakePlugin"/>
<Project Name="CppChecker"/>
<Project Name="wxshapeframework"/>
<Project Name="databaselayer_sqlite"/>
<Project Name="Subversion2"/>
<Project Name="git"/>
<Project Name="DatabaseExplorer"/>
<Project Name="ExternalTools"/>
<Project Name="CallGraph"/>
<Project Name="ZoomNavigator"/>
<Project Name="SFTP"/>
<Project Name="CMakePlugin"/>
<Project Name="CodeLiteDiff"/>
<Project Name="hunspell"/>
<Project Name="LLDBProtocol"/>
<Project Name="LLDBDebugger"/>
<Project Name="SpellCheck"/>
<Project Name="PHPParser"/>
<Project Name="PHPPlugin"/>
<Project Name="QMakePlugin"/>
<Project Name="SFTP"/>
<Project Name="hunspell"/>
<Project Name="SpellCheck"/>
<Project Name="Subversion2"/>
<Project Name="WordCompletion"/>
<Project Name="ZoomNavigator"/>
<Project Name="abbreviation"/>
<Project Name="git"/>
<Project Name="snipwiz"/>
<Project Name="wxFormBuilder"/>
<Project Name="WebTools"/>
<Project Name="HelpPlugin"/>
<Project Name="AutoSave"/>
<Project Name="Tail"/>
<Project Name="EditorConfigPlugin"/>
<Project Name="codelite_vim"/>
<Project Name="PHPLint"/>
<Project Name="PHPRefactoring"/>
<Project Name="HelpPlugin"/>
<Project Name="SmartCompletion"/>
<Project Name="Docker"/>
<Project Name="wxcLib"/>
<Project Name="wxcrafter"/>
<Project Name="LanguageServer"/>
<Project Name="Rust"/>
<Project Name="EOSWiki"/>
<Project Name="wxcrafter"/>
<Project Name="Remote"/>
<Project Name="codelite_make"/>
<Project Name="codelite_launcher"/>
<Project Name="makedir"/>
<Project Name="codelite_indexer"/>
<Project Name="codelitegcc"/>
<Project Name="codelite_terminal"/>
<Project Name="codelite-exec"/>
<Project Name="codelite_echo"/>
<Project Name="codelite_cppcheck"/>
<Project Name="ctagsdlib"/>
<Project Name="ctagsd"/>
</Dependencies>
<Dependencies Name="Win_x64_Debug">
<Project Name="PCH"/>
<Project Name="sqlite3"/>
<Project Name="PCH"/>
<Project Name="wxsqlite3"/>
<Project Name="databaselayer_sqlite"/>
<Project Name="wxshapeframework"/>
Expand Down Expand Up @@ -2335,64 +2324,76 @@ resources.cpp: resources.xrc
<Project Name="LanguageServer"/>
<Project Name="Rust"/>
<Project Name="EOSWiki"/>
<Project Name="wxcLib"/>
<Project Name="wxcrafter"/>
<Project Name="Remote"/>
<Project Name="ctagsdlib"/>
<Project Name="ctagsd"/>
</Dependencies>
<Dependencies Name="Win_x64_Debug">
<Project Name="sqlite3"/>
<Dependencies Name="Win_x64_Release">
<Project Name="PCH"/>
<Project Name="wxscintilla"/>
<Project Name="sqlite3"/>
<Project Name="wxsqlite3"/>
<Project Name="databaselayer_sqlite"/>
<Project Name="wxshapeframework"/>
<Project Name="libCodeLite"/>
<Project Name="plugin_sdk"/>
<Project Name="CodeFormatter"/>
<Project Name="DebuggerGDB"/>
<Project Name="CodeFormatter"/>
<Project Name="Subversion"/>
<Project Name="Gizmos"/>
<Project Name="Cscope"/>
<Project Name="Copyright"/>
<Project Name="UnitTestPP"/>
<Project Name="ExternalTools"/>
<Project Name="snipwiz"/>
<Project Name="wxFormBuilder"/>
<Project Name="abbreviation"/>
<Project Name="CMakePlugin"/>
<Project Name="CodeLiteDiff"/>
<Project Name="ContinuousBuild"/>
<Project Name="QMakePlugin"/>
<Project Name="CppChecker"/>
<Project Name="Subversion2"/>
<Project Name="git"/>
<Project Name="wxshapeframework"/>
<Project Name="databaselayer_sqlite"/>
<Project Name="DatabaseExplorer"/>
<Project Name="CallGraph"/>
<Project Name="ZoomNavigator"/>
<Project Name="SFTP"/>
<Project Name="CMakePlugin"/>
<Project Name="CodeLiteDiff"/>
<Project Name="hunspell"/>
<Project Name="ExternalTools"/>
<Project Name="LLDBProtocol"/>
<Project Name="LLDBDebugger"/>
<Project Name="SpellCheck"/>
<Project Name="PHPParser"/>
<Project Name="PHPPlugin"/>
<Project Name="QMakePlugin"/>
<Project Name="SFTP"/>
<Project Name="hunspell"/>
<Project Name="SpellCheck"/>
<Project Name="Subversion2"/>
<Project Name="WordCompletion"/>
<Project Name="ZoomNavigator"/>
<Project Name="abbreviation"/>
<Project Name="git"/>
<Project Name="snipwiz"/>
<Project Name="wxFormBuilder"/>
<Project Name="WebTools"/>
<Project Name="HelpPlugin"/>
<Project Name="AutoSave"/>
<Project Name="Tail"/>
<Project Name="EditorConfigPlugin"/>
<Project Name="codelite_vim"/>
<Project Name="PHPLint"/>
<Project Name="PHPRefactoring"/>
<Project Name="HelpPlugin"/>
<Project Name="SmartCompletion"/>
<Project Name="Docker"/>
<Project Name="wxcLib"/>
<Project Name="wxcrafter"/>
<Project Name="LanguageServer"/>
<Project Name="Rust"/>
<Project Name="EOSWiki"/>
<Project Name="wxcLib"/>
<Project Name="wxcrafter"/>
<Project Name="Remote"/>
<Project Name="codelite_make"/>
<Project Name="codelite_launcher"/>
<Project Name="makedir"/>
<Project Name="codelite_indexer"/>
<Project Name="codelitegcc"/>
<Project Name="codelite_terminal"/>
<Project Name="codelite-exec"/>
<Project Name="codelite_echo"/>
<Project Name="codelite_cppcheck"/>
<Project Name="ctagsdlib"/>
<Project Name="ctagsd"/>
<Project Name="Outline"/>
</Dependencies>
</CodeLite_Project>
10 changes: 2 additions & 8 deletions Outline/Outline.project
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,12 @@
</Plugin>
</Plugins>
<VirtualDirectory Name="src">
<File Name="outline_settings.cpp"/>
<File Name="outline_settings.h"/>
<File Name="outline_symbol_tree.cpp"/>
<File Name="outline.cpp"/>
<File Name="outline_tab.h"/>
<File Name="outline_tab.cpp"/>
<File Name="outline_tab.h"/>
<File Name="outline.cpp"/>
<File Name="CMakeLists.txt"/>
<File Name="PHPOutlineTree.h"/>
<File Name="PHPOutlineTree.cpp"/>
</VirtualDirectory>
<VirtualDirectory Name="include">
<File Name="outline_symbol_tree.h"/>
<File Name="outline.h"/>
</VirtualDirectory>
<Dependencies/>
Expand Down
Loading

0 comments on commit f46b3e8

Please sign in to comment.