mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 04:39:06 +00:00
LanguageServers: Add function to collect TODO entries in a document
This commit is contained in:
parent
c397e030f4
commit
26a7356e90
Notes:
sideshowbarker
2024-07-18 11:37:00 +09:00
Author: https://github.com/guerinoni
Commit: 26a7356e90
Pull-request: https://github.com/SerenityOS/serenity/pull/6614
Reviewed-by: https://github.com/alimpfard
Reviewed-by: https://github.com/itamar8910 ✅
Reviewed-by: https://github.com/linusg
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