1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:57:35 +00:00

LanguageServers: Rename AutoCompleteEngine => CodeComprehensionEngine

This feels like a better name since the "autocomplete engine" can, in
addition to providing autocomplete suggestions, also find declarations
of symbols and report back the symbols that are defined in a document.

Also, Cpp/ParserAutoComplete has been renamed to CppComprehensionEngine
and Shell/AutoComplete has been renamed to ShellComprehensionEngine.
This commit is contained in:
Itamar 2021-05-16 17:25:24 +03:00 committed by Andreas Kling
parent b1531b78f6
commit 400d3ddb08
13 changed files with 82 additions and 82 deletions

View file

@ -6,7 +6,7 @@
#include "Tests.h"
#include "../FileDB.h"
#include "ParserAutoComplete.h"
#include "CppComprehensionEngine.h"
using namespace LanguageServers;
using namespace LanguageServers::Cpp;
@ -57,8 +57,8 @@ ar
}
)";
filedb.add("a.cpp", content);
ParserAutoComplete autocomplete(filedb);
auto suggestions = autocomplete.get_suggestions("a.cpp", { 2, 2 });
CppComprehensionEngine engine(filedb);
auto suggestions = engine.get_suggestions("a.cpp", { 2, 2 });
if (suggestions.size() != 2)
FAIL(bad size);
@ -79,7 +79,7 @@ myv
}
)";
filedb.add("a.cpp", content);
ParserAutoComplete autocomplete(filedb);
CppComprehensionEngine autocomplete(filedb);
auto suggestions = autocomplete.get_suggestions("a.cpp", { 3, 3 });
if (suggestions.size() != 1)
FAIL(bad size);
@ -103,7 +103,7 @@ MyS
}
)";
filedb.add("a.cpp", content);
ParserAutoComplete autocomplete(filedb);
CppComprehensionEngine autocomplete(filedb);
auto suggestions = autocomplete.get_suggestions("a.cpp", { 5, 3 });
if (suggestions.size() != 1)
FAIL(bad size);
@ -124,8 +124,8 @@ argv = nullptr;
}
)";
filedb.add("a.cpp", content);
ParserAutoComplete autocomplete(filedb);
auto position = autocomplete.find_declaration_of("a.cpp", { 2, 1 });
CppComprehensionEngine engine(filedb);
auto position = engine.find_declaration_of("a.cpp", { 2, 1 });
if (!position.has_value())
FAIL("declaration not found");