1
0
mirror of https://github.com/SerenityOS/serenity synced 2024-07-09 06:20:46 +00:00
Commit Graph

1218 Commits

Author SHA1 Message Date
Abhishek Raturi
ceec7cd537 Hackstudio: Add a window title when diff is opened
Set window title when a diff is opened from Git
widget in HackStudio.
2024-06-09 14:13:29 -04:00
Matthew Olsson
a5f4c9a632 AK+Userland: Remove NOESCAPE
See the next commit for an explanation
2024-05-22 21:55:34 -06:00
Sönke Holz
3059ac71f3 HackStudio: Use AK::unwind_stack_from_frame_pointer 2024-05-14 14:02:06 -06:00
Ali Mohammad Pur
eaa2d69d73 LibGUI+Everywhere: Rename the 'style' frame property to 'frame_style'
'set_frame_style' is what Frame itself uses to set the value, and a
significant number of GML files use 'frame_style' instead of just
'style', so let's switch to it and use it everywhere consistently.
2024-04-30 17:46:41 -06:00
Dan Klishch
7b88363490 Meta+Userland: Make LibELF a proper library on Serenity
Dynamically loaded LibC doesn't need LibELF definitions, so let's not
put them there.
2024-04-26 19:08:13 -06:00
Andrew Kaster
6d4ba21832 LibIPC+Userland: Make IPC::File always own its file descriptor
Add factory functions to distinguish between when the owner of the File
wants to transfer ownership to the new IPC object (adopt) or to send a
copy of the same fd to the IPC peer (clone).

This behavior is more intuitive than the previous behavior. Previously,
an IPC::File would default to a shallow clone of the file descriptor,
only *actually* calling dup(2) for the fd when encoding or it into an
IPC MessageBuffer. Now the dup(2) for the fd is explicit in the clone_fd
factory function.
2024-04-19 06:34:07 -04:00
Dan Klishch
5ed7cd6e32 Everywhere: Use east const in more places
These changes are compatible with clang-format 16 and will be mandatory
when we eventually bump clang-format version. So, since there are no
real downsides, let's commit them now.
2024-04-19 06:31:19 -04:00
Andreas Kling
1cb5385a29 LibCore: Stop obsessing about tiny OOMs in Core::Timer
Work towards #20405
2024-04-17 07:16:52 +02:00
Aryan Baburajan
def486305a SQLStudio: Port to GML Compilation 2024-04-15 14:01:13 +02:00
Matthew Olsson
ff00d21d58 Everywhere: Mark a bunch of function parameters as NOESCAPE
This fixes the relevant warnings when running LibJSGCVerifier. Note that
the analysis is only performed over LibJS-adjacent code, but could be
performed over the entire codebase. That will have to wait for a future
commit.
2024-04-09 09:10:44 +02:00
Timothy Flynn
e57d739705 HackStudio: Avoid UAF when loading the GML preview
The value returned by editor().text() was a temporarily allocated string
which we were holding a view into.
2024-04-04 11:23:21 +02:00
Timothy Flynn
b5f22b6e90 AK+Userland: Remove some needlessly explicit conversions to StringView 2024-04-04 11:23:21 +02:00
Timothy Flynn
c23060e21b Userland: Avoid some now-unneeded explicit conversions to Bytes 2024-04-04 11:23:21 +02:00
Shannon Booth
e800605ad3 AK+LibURL: Move AK::URL into a new URL library
This URL library ends up being a relatively fundamental base library of
the system, as LibCore depends on LibURL.

This change has two main benefits:
 * Moving AK back more towards being an agnostic library that can
   be used between the kernel and userspace. URL has never really fit
   that description - and is not used in the kernel.
 * URL _should_ depend on LibUnicode, as it needs punnycode support.
   However, it's not really possible to do this inside of AK as it can't
   depend on any external library. This change brings us a little closer
   to being able to do that, but unfortunately we aren't there quite
   yet, as the code generators depend on LibCore.
2024-03-18 14:06:28 -04:00
Sam Atkins
da118f2adf HackStudio: Enable permissive mode for Config access
Displaying a GML preview in HackStudio seems to be broken at the moment,
but this change will be needed once it does work again, so might as well
make it now, while I'm aware of the issue.
2024-03-07 17:49:01 -05:00
Sam Atkins
e8a803ca5d GMLPlayground: Enable permissive mode for Config access
Instead of having to list any Config domains that may be used by a
Widget, let accessing those domains be a no-op.
2024-03-07 17:49:01 -05:00
Tim Ledbetter
2331d2bafa Userland: Propagate errors with TRY() where possible 2024-02-14 17:46:06 -05:00
Ali Mohammad Pur
54ab6fe5b9 LibVT+Everywhere: Introduce 'automarks' and 'clear previous command'
Automarks are similar to bookmarks placed by the terminal, allowing the
user to selectively remove a single command and its output from the
terminal scrollback.
This commit implements a single way to add marks: automatically placing
them when the shell becomes interactive.

To make sure the shell behaves correctly after its expected prompt
position changes, the terminal layer forces a resize event to be passed
to the shell on such (possibly) partial clears; this also has the nice
side effect of fixing the disappearing prompt on the preexisting "clear
including history" action: Fixes #4192.
2024-02-07 00:43:11 +01:00
Sam Atkins
4b1c7533f5 HackStudio: Fuzzy-match Locator suggestions
This also sorts them to put better results first. Currently the
fuzzy-match algorithm gets a little confused, but as that improves, so
will this.
2024-01-30 23:34:21 +00:00
Sam Atkins
85101c6626 HackStudio: Keep the DeclarationsModel around, and use a filtering proxy
Rather than construct a new DeclarationsModel each time the user types
something in the Locator, keep a single one around permanently in the
ProjectDeclarations, and then use a FilteringProxyModel over it for the
suggestions.
2024-01-30 23:34:21 +00:00
Sam Atkins
e72b14ef1d HackStudio: Correct DeclarationsModel::row_count() calculation
No indices contain other indices, so the row count is 0 if the index is
valid. This stops us infinitely recursing into non-existent indices.
2024-01-30 23:34:21 +00:00
Sam Atkins
44033415bc HackStudio: Rename & move DeclarationsModel::Suggestion -> Declaration 2024-01-30 23:34:21 +00:00
Sam Atkins
28e4e351cb HackStudio: Extract and rename the Locator's suggestions model
No code changes besides moving and renaming it.
2024-01-30 23:34:21 +00:00
Sam Atkins
a805cbc5ab HackStudio: Remove Locator log spam
This doesn't seem useful enough to keep behind a flag.
2024-01-30 23:34:21 +00:00
Sam Atkins
44ca55aaf8 LibFileSystemAccessClient+Userland: Return file paths as ByteStrings
Where it was straightforward to do so, I've updated the users to also
use ByteStrings for their file paths, but most of them have a temporary
String::from_byte_string() call instead.
2024-01-29 23:14:39 +00:00
Nico Weber
3f9d0c7789 DevTools: Remove UserspaceEmulator
It hasn't been built since we dropped i386 support.

When we want to bring it back, we can get it back from source control.

No behavior change.
2024-01-29 20:20:55 +00:00
Sam Atkins
315c95a1ce HackStudio: Replace custom recent-project management with the LibGUI one
The only downside is we are limited to 4 recent projects now. LibGUI
currently relies on the number of recent files being constexpr, so that
will take some more work to make it variable.
2024-01-24 11:07:03 +00:00
Sam Atkins
9657f4cabb LibGUI+Userland: Take ByteString in set_most_recently_open_file() 2024-01-24 11:07:03 +00:00
Sam Atkins
d30f13a88d HackStudio: Jump to file location when choosing a Locator suggestion
A couple of tweaks here to make it work better:
- Call `set_cursor_and_focus_line()` to make the Editor scroll to the
  symbol's location.
- Remove focus from the Locator's text box so your cursor jumps to the
  Editor instead of staying in the Locator.
2024-01-24 11:05:54 +00:00
Sam Atkins
9322f0d110 HackStudio: Use Autocomplete window type for Locator pop-up
This being a Popup window meant it behaved in a couple of janky ways:
- It would steal the focus each time it was shown, so after every key
  press in the TextBox.
- It would disappear when you focused that TextBox again.

Using the Autocomplete window type fixes both of these. While the
Locator is not technically an autocomplete, it shares the general "type
and get suggestions based on the input, which you can select" behavior,
so this is close enough.
2024-01-24 11:05:54 +00:00
Dan Klishch
b5f1a48a7c AK+Everywhere: Remove JsonValue APIs with implicit default values 2024-01-21 15:47:53 -07:00
Sam Atkins
8bb459e0ec HackStudio: Remove unused spawn.h include 2024-01-19 12:16:21 -07:00
Sam Atkins
ae297e4405 HackStudio: Use Core::Process API to run template post-create programs 2024-01-19 12:16:21 -07:00
Sam Atkins
5205634ed4 HackStudio: Use Core::Process API to check for make 2024-01-19 12:16:21 -07:00
Sam Atkins
aeed1e04ca HackStudio: Make Files and Classes tabs have the same border width
This is something I messed up, back in
77ad0fdb07. Oops!
2024-01-16 15:23:07 +01:00
Sam Atkins
dd9f3c980f HackStudio: Absolutize project paths before opening them
Relative paths cause issues in a couple of ways:
- `open_project()` sets the working directory to that path, and then
  opens a project at that same path. This means opening `./foo` goes to
  `./foo`, and then tries to open `./foo/foo`.
- Even with that rearranged, we would then have issues with trying to
  open files, because again we would try to open `./foo/foo/file`
  instead of `./foo/file`.
- The relative path would get saved in "Recent Projects" which is wrong.

Absolutizing the path before using it means we avoid these issues, and
without having to rearchitect everything. :^)
2024-01-16 12:39:28 +01:00
Sam Atkins
6db4d3b898 HackStudio: Remove UTF-8 validation for project path 2024-01-16 12:39:28 +01:00
Sam Atkins
56c5ffe398 LibFileSystem+Userland: Return ByteString from real_path() 2024-01-16 08:42:34 +00:00
Sam Atkins
ad59fb7cf0 HackStudio: Make Editor ask Debugger if a breakpoint was added/removed
Rather than adding/removing a breakpoint indicator, and then telling the
debugger about it and hoping it works, let the debugger tell us if it
succeeded and then use that to update the indicator.

This prevents the user from adding breakpoints to invalid locations
while the debugger is running. It also avoids a couple of scary
VERIFY()s. We still allow creating breakpoints in invalid locations
while the debugger is *not* running.
2024-01-14 18:48:41 -07:00
Hugh Davenport
5f56c946c2 SQLStudio: Add fullscreen option 2024-01-14 15:18:43 -07:00
Hugh Davenport
13c66ebf12 DevTools: Add fullscreen option
All except SQLStudio, as that causes a crash
2024-01-14 15:18:43 -07:00
Sam Atkins
4ffd43a5f4 HackStudio: Stop crash from leaking Editor widgets when closing tabs
When re-opening an existing file, we would reuse the document and
register a new Editor with it, but never unregister that Editor.

Previously, this would cause a crash if you opened a binary file, closed
its tab, then opened that binary file again. HackStudio would crash
while calling `HackStudio::EditorWrapper::update_title()` on an invalid
EditorWrapper. But now it doesn't!

Something still gets leaked each time, but we now don't crash at least.
2024-01-14 15:00:32 -07:00
Sam Atkins
336b8ed80b HackStudio: Use Core::System APIs where possible 2024-01-13 15:13:36 -07:00
Sam Atkins
16543a1918 HackStudio: Convert ProjectTemplate::create_project to ErrorOr
This lets us also use the Core::System APIs, which reduces the amount of
error checking code.
2024-01-13 15:13:36 -07:00
Sam Atkins
7cf2674061 HackStudio: Stop incorrectly overriding gutter cursors
Only adjust the cursor to respond to clickable text, if the mouse is
over text.
2024-01-13 07:13:52 +00:00
Sam Atkins
e685b0a819 HackStudio: Remove redundant set_cursor() override
All this does is call the immediate parent's implementation.
2024-01-13 07:13:52 +00:00
Dan Klishch
ccd701809f Everywhere: Add deprecated_ prefix to JsonValue::to_byte_string
`JsonValue::to_byte_string` has peculiar type-erasure semantics which is
not usually intended. Unfortunately, it also has a very stereotypical
name which does not warn about unexpected behavior. So let's prefix it
with `deprecated_` to make new code use `as_string` if it just wants to
get string value or `serialized<StringBuilder>` if it needs to do proper
serialization.
2024-01-12 17:41:34 -07:00
Sönke Holz
6f6a2dc319 HackStudio: Correctly handle invalid addresses during backtrace creation
This fixes a bug where we previously would hang if we couldn't find a
library containing the current program counter.
2024-01-12 16:49:44 -07:00
Sönke Holz
256f0c9064 HackStudio: Change register names in BacktraceModel to be more generic 2024-01-12 16:49:44 -07:00
Shannon Booth
e2e7c4d574 Everywhere: Use to_number<T> instead of to_{int,uint,float,double}
In a bunch of cases, this actually ends up simplifying the code as
to_number will handle something such as:

```
Optional<I> opt;
if constexpr (IsSigned<I>)
    opt = view.to_int<I>();
else
    opt = view.to_uint<I>();
```

For us.

The main goal here however is to have a single generic number conversion
API between all of the String classes.
2023-12-23 20:41:07 +01:00