mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 21:27:45 +00:00
HackStudio: Make TODO entries clickable
Now you can click a TODO entry to set focus on that position of that file.
This commit is contained in:
parent
935c7b2f4b
commit
e0f1c237d2
15 changed files with 83 additions and 39 deletions
|
@ -32,7 +32,7 @@ void CodeComprehensionEngine::set_declarations_of_document(const String& filenam
|
|||
set_declarations_of_document_callback(filename, move(declarations));
|
||||
}
|
||||
|
||||
void CodeComprehensionEngine::set_todo_entries_of_document(const String& filename, Vector<String>&& todo_entries)
|
||||
void CodeComprehensionEngine::set_todo_entries_of_document(String const& filename, Vector<Cpp::Parser::TodoEntry>&& todo_entries)
|
||||
{
|
||||
VERIFY(set_todo_entries_of_document_callback);
|
||||
set_todo_entries_of_document_callback(filename, move(todo_entries));
|
||||
|
|
|
@ -30,12 +30,12 @@ public:
|
|||
|
||||
public:
|
||||
Function<void(const String&, Vector<GUI::AutocompleteProvider::Declaration>&&)> set_declarations_of_document_callback;
|
||||
Function<void(const String&, Vector<String>&&)> set_todo_entries_of_document_callback;
|
||||
Function<void(String const&, Vector<Cpp::Parser::TodoEntry>&&)> set_todo_entries_of_document_callback;
|
||||
|
||||
protected:
|
||||
const FileDB& filedb() const { return m_filedb; }
|
||||
void set_declarations_of_document(const String&, Vector<GUI::AutocompleteProvider::Declaration>&&);
|
||||
void set_todo_entries_of_document(const String&, Vector<String>&&);
|
||||
void set_todo_entries_of_document(String const&, Vector<Cpp::Parser::TodoEntry>&&);
|
||||
const HashMap<String, Vector<GUI::AutocompleteProvider::Declaration>>& all_declarations() const { return m_all_declarations; }
|
||||
|
||||
private:
|
||||
|
|
|
@ -22,7 +22,7 @@ public:
|
|||
m_autocomplete_engine->set_declarations_of_document_callback = [this](const String& filename, Vector<GUI::AutocompleteProvider::Declaration>&& declarations) {
|
||||
async_declarations_in_document(filename, move(declarations));
|
||||
};
|
||||
m_autocomplete_engine->set_todo_entries_of_document_callback = [this](const String& filename, Vector<String>&& todo_entries) {
|
||||
m_autocomplete_engine->set_todo_entries_of_document_callback = [this](String const& filename, Vector<Cpp::Parser::TodoEntry>&& todo_entries) {
|
||||
async_todo_entries_in_document(filename, move(todo_entries));
|
||||
};
|
||||
}
|
||||
|
|
|
@ -3,5 +3,5 @@ endpoint LanguageClient
|
|||
auto_complete_suggestions(Vector<GUI::AutocompleteProvider::Entry> suggestions) =|
|
||||
declaration_location(GUI::AutocompleteProvider::ProjectLocation location) =|
|
||||
declarations_in_document(String filename, Vector<GUI::AutocompleteProvider::Declaration> declarations) =|
|
||||
todo_entries_in_document(String filename, Vector<String> todo_entries) =|
|
||||
todo_entries_in_document(String filename, Vector<Cpp::Parser::TodoEntry> todo_entries) =|
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
#include "ShellComprehensionEngine.h"
|
||||
#include <DevTools/HackStudio/LanguageServers/ClientConnection.h>
|
||||
#include <LibCpp/Parser.h>
|
||||
|
||||
namespace LanguageServers::Shell {
|
||||
|
||||
|
@ -21,7 +22,7 @@ class ClientConnection final : public LanguageServers::ClientConnection {
|
|||
m_autocomplete_engine->set_declarations_of_document_callback = [this](const String& filename, Vector<GUI::AutocompleteProvider::Declaration>&& declarations) {
|
||||
async_declarations_in_document(filename, move(declarations));
|
||||
};
|
||||
m_autocomplete_engine->set_todo_entries_of_document_callback = [this](const String& filename, Vector<String>&& todo_entries) {
|
||||
m_autocomplete_engine->set_todo_entries_of_document_callback = [this](String const& filename, Vector<Cpp::Parser::TodoEntry>&& todo_entries) {
|
||||
async_todo_entries_in_document(filename, move(todo_entries));
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue