diff options
author | thislooksfun <tlf@thislooks.fun> | 2021-10-26 21:30:48 -0500 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-11-02 17:53:22 +0100 |
commit | f699dbdc3f720b3c69083ba91e4214ea76fce6f8 (patch) | |
tree | b7810256d8138f4a0d84aa9c8a1847ec08d31954 /Userland/DevTools/HackStudio | |
parent | a5b3c3f85f3ddfcd49bb94c215498ba02a3a6667 (diff) | |
download | serenity-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.cpp | 3 |
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 }); } } |