summaryrefslogtreecommitdiff
path: root/Userland/DevTools/HackStudio
diff options
context:
space:
mode:
authorthislooksfun <tlf@thislooks.fun>2021-10-26 21:30:48 -0500
committerAndreas Kling <kling@serenityos.org>2021-11-02 17:53:22 +0100
commitf699dbdc3f720b3c69083ba91e4214ea76fce6f8 (patch)
treeb7810256d8138f4a0d84aa9c8a1847ec08d31954 /Userland/DevTools/HackStudio
parenta5b3c3f85f3ddfcd49bb94c215498ba02a3a6667 (diff)
downloadserenity-f699dbdc3f720b3c69083ba91e4214ea76fce6f8.zip
HackStudio+LibGUI: Handle #include quotes and brackets in the engine
Previously we had a special case in order to auto-append quotes or angle brackets to #include statements. After the previous commit this is no longer necessary.
Diffstat (limited to 'Userland/DevTools/HackStudio')
-rw-r--r--Userland/DevTools/HackStudio/LanguageServers/Cpp/CppComprehensionEngine.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/Userland/DevTools/HackStudio/LanguageServers/Cpp/CppComprehensionEngine.cpp b/Userland/DevTools/HackStudio/LanguageServers/Cpp/CppComprehensionEngine.cpp
index 90cebf4719..0571ce9064 100644
--- a/Userland/DevTools/HackStudio/LanguageServers/Cpp/CppComprehensionEngine.cpp
+++ b/Userland/DevTools/HackStudio/LanguageServers/Cpp/CppComprehensionEngine.cpp
@@ -670,7 +670,8 @@ Optional<Vector<GUI::AutocompleteProvider::Entry>> CppComprehensionEngine::try_a
if (!(path.ends_with(".h") || Core::File::is_directory(LexicalPath::join(full_dir, path).string())))
continue;
if (path.starts_with(partial_basename)) {
- options.append({ path, partial_basename.length(), include_type, GUI::AutocompleteProvider::Language::Cpp });
+ auto completion = include_type == GUI::AutocompleteProvider::CompletionKind::ProjectInclude ? String::formatted("<{}>", path) : String::formatted("\"{}\"", path);
+ options.append({ completion, partial_basename.length() + 1, include_type, GUI::AutocompleteProvider::Language::Cpp, path });
}
}