mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 12:49:19 +00:00
HackStudio: Add C++ Language Server
The language server keeps track of the content of currently edited files by receiving updates about edit actions. Also, C++ autocompletion is no longer tied to HackStudio itself and moved to be part of the language server.
This commit is contained in:
parent
bf53d7ff64
commit
863f14788f
Notes:
sideshowbarker
2024-07-19 02:07:10 +09:00
Author: https://github.com/itamar8910
Commit: 863f14788f
Pull-request: https://github.com/SerenityOS/serenity/pull/3622
Reviewed-by: https://github.com/alimpfard
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/bugaevc
Reviewed-by: https://github.com/tomuta
18 changed files with 451 additions and 21 deletions
|
@ -282,6 +282,18 @@ void TextDocument::set_all_cursors(const TextPosition& position)
|
|||
}
|
||||
}
|
||||
|
||||
String TextDocument::text() const
|
||||
{
|
||||
StringBuilder builder;
|
||||
for (size_t i = 0; i < line_count(); ++i) {
|
||||
auto& line = this->line(i);
|
||||
builder.append(line.view());
|
||||
if (i != line_count() - 1)
|
||||
builder.append('\n');
|
||||
}
|
||||
return builder.to_string();
|
||||
}
|
||||
|
||||
String TextDocument::text_in_range(const TextRange& a_range) const
|
||||
{
|
||||
auto range = a_range.normalized();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue