1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 06:38:10 +00:00
serenity/Userland/DevTools/HackStudio
Shannon Booth f690807c5a LibDiff: Change underlying representation of Hunk to allow context
The existing hunk data structure does not contain any way to easily
store information about context surrounding the additions and removals
in a hunk. While this does work fine for normal diffs (where there is
never any surrounding context) this data structure is quite limiting for
other use cases.

Without support for surrounding context it is not possible to:
 * Add support for unified or context format to the diff utility to
   output surrounding context.
 * Be able to implement a patch utility that uses the surrounding
   context to reliably locate where to apply a patch when a hunk range
   does not apply perfectly.

This patch changes Diff::Hunk such that its data structure more closely
resembles a unified diff. Each line in a hunk is now either a change,
removal, addition or context.

Allowing hunks to have context inside of them exposes that HackStudio
heavily relies on there being no context in the hunks that it uses for
its' git gutter implementation. The fix here is simple - ask git to
produce us a diff that has no context in it!
2023-07-02 11:18:11 -06:00
..
Debugger LibGUI+Userland: Propagate errors in Model::column_name() 2023-06-14 17:53:59 +02:00
Dialogs LibGUI+Userland: Propagate errors in Model::column_name() 2023-06-14 17:53:59 +02:00
Git LibDiff: Change underlying representation of Hunk to allow context 2023-07-02 11:18:11 -06:00
LanguageClients LibCore: Move Stream-based sockets into the Core namespace 2023-02-13 00:50:07 +00:00
LanguageServers LibCore: Remove Stream.h 2023-02-13 00:50:07 +00:00
AutoCompleteResponse.h LibIPC+Everywhere: Change IPC::encode's return type to ErrorOr 2023-01-04 11:49:15 +01:00
ClassViewWidget.cpp HackStudio: Store correct address in ClassViewModel's ModelIndices 2023-03-08 23:14:21 +01:00
ClassViewWidget.h Everywhere: Stop using NonnullOwnPtrVector 2023-03-06 23:46:35 +01:00
CMakeLists.txt Everywhere: Use LibFileSystem where trivial 2023-03-21 19:03:21 +00:00
CodeDocument.cpp HackStudio: Migrate git-diff indicators to TextEditor API 2023-03-31 12:09:40 +02:00
CodeDocument.h HackStudio: Migrate git-diff indicators to TextEditor API 2023-03-31 12:09:40 +02:00
Editor.cpp LibDiff: Change underlying representation of Hunk to allow context 2023-07-02 11:18:11 -06:00
Editor.h HackStudio: Move around execution order and prevent crashing 2023-04-30 06:08:22 +02:00
EditorWrapper.cpp LibDiff: Make Diff::parse_hunks fallible 2023-06-26 19:26:34 +02:00
EditorWrapper.h AK+Everywhere: Rename String to DeprecatedString 2022-12-06 08:54:33 +01:00
FindInFilesWidget.cpp LibGUI+Userland: Propagate errors in Model::column_name() 2023-06-14 17:53:59 +02:00
FindInFilesWidget.h HackStudio: Make FindInFilesWidget reset when opening new project 2021-08-22 10:30:06 +02:00
GMLPreviewWidget.cpp LibGUI+Userland: Port Labels to String 2023-04-30 05:48:14 +02:00
GMLPreviewWidget.h AK+Everywhere: Rename String to DeprecatedString 2022-12-06 08:54:33 +01:00
HackStudio.h AK+Everywhere: Rename String to DeprecatedString 2022-12-06 08:54:33 +01:00
HackStudioWidget.cpp LibGUI+Userland: Use action text as a fallback in Action::status_tip() 2023-06-15 13:53:22 +01:00
HackStudioWidget.h HackStudio: Prefer FileSystem over DeprecatedFile 2023-05-27 17:30:55 +02:00
LanguageClient.cpp AK: Rename Time to Duration 2023-05-24 23:18:07 +02:00
LanguageClient.h HackStudio: Use Syntax::Language instead of our own one 2023-03-11 13:22:57 +00:00
Locator.cpp LibGUI+Everywhere: Use fallible Window::set_main_widget() everywhere :^) 2023-01-06 13:36:02 -07:00
Locator.h DevTools: Use default constructors/destructors 2022-02-16 07:33:15 -05:00
main.cpp HackStudio: Prefer FileSystem over DeprecatedFile 2023-05-27 17:30:55 +02:00
Project.cpp Everywhere: Use LibFileSystem where trivial 2023-03-21 19:03:21 +00:00
Project.h AK+Everywhere: Rename String to DeprecatedString 2022-12-06 08:54:33 +01:00
ProjectBuilder.cpp LibCore: Migrate Command from Deprecated{File,String} 2023-05-19 23:31:20 +02:00
ProjectBuilder.h LibFileSystem: Move TempFile from LibCore to LibFileSystem 2023-03-21 19:03:21 +00:00
ProjectConfig.cpp LibCore: Remove Stream.h 2023-02-13 00:50:07 +00:00
ProjectConfig.h AK+Everywhere: Rename String to DeprecatedString 2022-12-06 08:54:33 +01:00
ProjectDeclarations.cpp LibGfx: Remove try_ prefix from bitmap creation functions 2023-01-26 20:24:37 +00:00
ProjectDeclarations.h AK+Everywhere: Rename String to DeprecatedString 2022-12-06 08:54:33 +01:00
ProjectFile.cpp LibCore: Remove Stream.h 2023-02-13 00:50:07 +00:00
ProjectFile.h AK+Everywhere: Rename String to DeprecatedString 2022-12-06 08:54:33 +01:00
ProjectTemplate.cpp HackStudio: Prefer FileSystem::copy_file_or_directory 2023-05-19 21:12:15 +02:00
ProjectTemplate.h AK+Everywhere: Rename String to DeprecatedString 2022-12-06 08:54:33 +01:00
TerminalWrapper.cpp AK+Everywhere: Rename String to DeprecatedString 2022-12-06 08:54:33 +01:00
TerminalWrapper.h AK+Everywhere: Rename String to DeprecatedString 2022-12-06 08:54:33 +01:00
ToDoEntries.cpp AK+Everywhere: Rename String to DeprecatedString 2022-12-06 08:54:33 +01:00
ToDoEntries.h AK+Everywhere: Rename String to DeprecatedString 2022-12-06 08:54:33 +01:00
ToDoEntriesWidget.cpp LibGUI+Userland: Propagate errors in Model::column_name() 2023-06-14 17:53:59 +02:00
ToDoEntriesWidget.h HackStudio: Clear ToDo entries upon opening new project 2021-08-22 10:30:06 +02:00