mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:47:44 +00:00
LanguageServers: Add function to collect TODO entries in a document
This commit is contained in:
parent
c397e030f4
commit
26a7356e90
12 changed files with 103 additions and 0 deletions
34
Userland/DevTools/HackStudio/ToDoEntries.cpp
Normal file
34
Userland/DevTools/HackStudio/ToDoEntries.cpp
Normal file
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Federico Guerinoni <guerinoni.federico@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include "ToDoEntries.h"
|
||||
|
||||
namespace HackStudio {
|
||||
|
||||
ToDoEntries& HackStudio::ToDoEntries::the()
|
||||
{
|
||||
static ToDoEntries s_instance;
|
||||
return s_instance;
|
||||
}
|
||||
|
||||
void ToDoEntries::set_entries(const String& filename, const Vector<String>&& entries)
|
||||
{
|
||||
m_document_to_entries.set(filename, move(entries));
|
||||
if (on_update)
|
||||
on_update();
|
||||
}
|
||||
|
||||
Vector<ToDoEntryPair> ToDoEntries::get_entries()
|
||||
{
|
||||
Vector<ToDoEntryPair> ret;
|
||||
for (auto& it : m_document_to_entries)
|
||||
for (auto& entry : it.value)
|
||||
ret.append({ it.key, entry });
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue