1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-25 13:25:07 +00:00
Commit graph

306 commits

Author SHA1 Message Date
Emanuel Sprung
3b7884ee8a TextEditor: Add button to match regular expression during search 2020-11-27 21:32:41 +01:00
Sergey Bugaev
e7e179212c HackStudio: Send an open file to language servers
Language servers will now receive an open file instead of just its path. This
means the language servers no longer need to access the filesystem to open the
file themselves.

The C++ language server now has no filesystem access whatsoever (although we
might need to relax this in the future if it learns to complete #include paths),
while the Shell language server can read /etc/passwd (it wants that in order to
get the user's home directory) and browse (but not read!) the whole file system
tree for completing paths.
2020-11-23 18:37:40 +01:00
Linus Groh
b1754bf8f8 HackStudio: Use GUI::FileIconProvider::icon_for_path() for Locator icons
No need to duplicate file icon association logic as well as artificially
limiting the number of recognized file types.
2020-11-14 10:11:26 +01:00
Linus Groh
d773795195 HackStudio: Make Locator search case insensitive
Typing "make" should find "Makefile", for example. :^)
2020-11-14 10:11:26 +01:00
Tom
75f61fe3d9 AK: Make RefPtr, NonnullRefPtr, WeakPtr thread safe
This makes most operations thread safe, especially so that they
can safely be used in the Kernel. This includes obtaining a strong
reference from a weak reference, which now requires an explicit
call to WeakPtr::strong_ref(). Another major change is that
Weakable::make_weak_ref() may require the explicit target type.
Previously we used reinterpret_cast in WeakPtr, assuming that it
can be properly converted. But WeakPtr does not necessarily have
the knowledge to be able to do this. Instead, we now ask the class
itself to deliver a WeakPtr to the type that we want.

Also, WeakLink is no longer specific to a target type. The reason
for this is that we want to be able to safely convert e.g. WeakPtr<T>
to WeakPtr<U>, and before this we just reinterpret_cast the internal
WeakLink<T> to WeakLink<U>, which is a bold assumption that it would
actually produce the correct code. Instead, WeakLink now operates
on just a raw pointer and we only make those constructors/operators
available if we can verify that it can be safely cast.

In order to guarantee thread safety, we now use the least significant
bit in the pointer for locking purposes. This also means that only
properly aligned pointers can be used.
2020-11-10 19:11:52 +01:00
Andreas Kling
07a2d22c33 HackStudio: Scroll embedded terminals to bottom upon command execution
It was kinda annoying that you had to scroll down manually every time
you started a new build while looking at some error in the scrollback.
2020-11-10 11:55:18 +01:00
asynts
3b3edbc4d2 AK: Rename new_out to out and new_warn to warn. 2020-11-09 16:21:29 +01:00
Andreas Kling
6913e2ab99 HackStudio: Run clang-format 2020-11-03 13:40:24 +01:00
Zac
85d65b06ab HackStudio: Store and restore the scrollbar values of ProjectFiles when they are closed and reopened from the list of open files. 2020-11-03 13:34:38 +01:00
Kesse Jones
6861cb8a23 HackStudio: Removes the file from the list of open files
When a file is deleted from the project it will
also be removed from the list of open files
2020-11-02 20:58:24 +01:00
Kesse Jones
8c4a2c34d3 HackStudio: Fixed opening the project by always opening the main.cpp file
Now when opening the project a search will be made for
a file with the extension cpp or js and opening it.
If not found, the first file will be opened.
2020-11-01 18:47:43 +01:00
Andreas Kling
aef56159a8 LibGUI: Add Widget focus policies
Every widget now has a GUI::FocusPolicy that determines how it can
receive focus:

- NoFocus: The widget is not focusable (default)
- TabFocus: The widget can be focused using the tab key.
- ClickFocus: The widget can be focused by clicking on it.
- StrongFocus: Both of the above.

For widgets that have a focus proxy, getting/setting the focus policy
will affect the proxy instead.
2020-10-30 17:03:28 +01:00
Andreas Kling
6365b44773 HackStudio: Use GUI::TextDocument::span_at() 2020-10-29 23:52:31 +01:00
Andreas Kling
4e0ab1dd22 HackStudio: Remove ProcessStateWidget
This was a little banner that would pop up when running something in
the "Build" tab. It didn't look very good and it was mostly distracting
how it would pop in and out of the window.
2020-10-29 23:40:20 +01:00
Andreas Kling
18739ba87e LanguageServers/Cpp: Find the right token under the cursor
When the cursor is immediately to the right of a token, the cursor's
column will be token.end.column + 1, so take this into account when
choosing which token to autocomplete.
2020-10-29 23:32:18 +01:00
Andreas Kling
d28127c807 LanguageServers/Cpp: Make token_in_position() return a StringView
This avoids a whole bunch of string allocation churn.
2020-10-29 23:32:18 +01:00
Andreas Kling
aaf4ec62cf LanguageServers/Cpp: Avoid some unnecessary vector copies 2020-10-29 23:32:18 +01:00
Andreas Kling
c3a79e1483 HackStudio: Don't track ctrl key state manually
Since we only need it in the mouse and key event handlers, we can get
the ctrl key state from the event. :^)
2020-10-29 23:32:18 +01:00
Andreas Kling
709b3ccb0a HackStudio: Reset the cursor to I-beam when switching between files 2020-10-26 16:43:28 +01:00
Andreas Kling
0bc740ab7f HackStudio: Run clang-format 2020-10-26 14:58:17 +01:00
Andreas Kling
3d50923c4d HackStudio: Allow toggling line wrapping on/off from the Edit menu :^) 2020-10-26 14:29:30 +01:00
Andreas Kling
333ab53b8d HackStudio: Add a simple "open files" view
Instead of files disappearing after you switch to something else,
we now keep track of them in a little ListView below the project tree.

You can return to any previously opened file by activating it in the
open files list. :^)
2020-10-26 14:29:26 +01:00
Andreas Kling
e6505a95f1 HackStudio: Include missing files in the project tree
If some file is in the project but missing on disk, let's still show
it in the project tree (instead of obscuring the fact that a file
is missing.)
2020-10-25 14:38:07 +01:00
Andreas Kling
47a3d81731 HackStudio: Don't assert when project has non-existent file
If a project contains "foo.cpp" but we can't open "foo.cpp", just go
with an empty text document for now, and we'll create "foo.cpp" when
the user saves.
2020-10-25 14:38:07 +01:00
Linus Groh
2d84c0c184 HackStudio: Fix running JavaScript files
s/String::format/String::formatted/ - the command was not being
formatted properly.
2020-10-10 00:53:09 +02:00
asynts
7c4fb2b804 HackStudio: Use new format functions. 2020-10-09 20:52:17 +02:00
Linus Groh
b797de3adf HackStudio: Replace InProcessWebView with OutOfProcessWebView 2020-10-08 23:20:52 +02:00
AnotherTest
6b55b007dd HackStudio: Add a Shell language server 2020-10-04 23:12:28 +02:00
AnotherTest
34039d6639 HackStudio: Do not change the cursor in the LSP autocomplete request
The C++ completion somehow depends on this, so move that behaviour into
the C++ language server instead.
2020-10-04 23:12:28 +02:00
AnotherTest
9e73b0b696 HackStudio: Relay completions requests to the language server unfiltered
Previously, the client would decide when to ask the server for
completions, and it would only do so for identifiers that had spans
(determined via the highlighter!).
Swap this around and make the server decide if it wants to complete
something.
This commit also adds a CompletionKind (which only has one value:
Identifier), to work with other kinds of completions as well.
2020-10-04 23:12:28 +02:00
Linus Groh
bcfc6f0c57 Everywhere: Fix more typos 2020-10-03 12:36:49 +02:00
AnotherTest
ac5e08a541 HackStudio: Abstract away language-server details
This commit moves all the logic that deals with the language server
(from HackStudio) into a LanguageClient class, provides some functions
to make constructing them easier, and makes all language servers use a
singular IPC definition.
Also fixes the FIXME about making the autocompletion async.
This makes adding language servers in the future significantly less
duplicate-y, and significantly easier :^)
2020-10-02 20:47:57 +02:00
Itamar
a39c4cc340 HackStudio: Integrate with C++ Language Server
Editors now communicate with the c++ language server when openning and
editing c++ source files, and go through the language server to get
autocomplete suggestions.
2020-09-30 21:46:59 +02:00
Itamar
863f14788f HackStudio: Add C++ Language Server
The language server keeps track of the content of currently edited
files by receiving updates about edit actions.

Also, C++ autocompletion is no longer tied to HackStudio itself and
moved to be part of the language server.
2020-09-30 21:46:59 +02:00
Itamar
bf53d7ff64 LibCpp: Add library for working with c++ code
Moved the C++ Lexer we have from LibGUI to here, so that other
components could use it without linking with LibGUI.
2020-09-30 21:46:59 +02:00
AnotherTest
c1fc27cab2 HackStudio+TextEditor: Add the Shell syntax highlighter 2020-09-30 20:05:24 +02:00
Itamar
8af67210cf HackStudio: Detach from debugged process before terminating
Fixes #3308
2020-09-26 17:18:21 +02:00
Itamar
6c73fdf8d1 HackStudio: Fix FormEditor widget icons loading
Previously, when resolving the paths for the FormEditor widget icons
we didn't take into the account that calling class_name() returns the
widget name with a "GUI::" prefix.

Also, we now skip over widgets that we don't have an icon for.
2020-09-26 17:18:21 +02:00
Ben Wiederhake
25488ddcad Meta+DevTools: Make clang-format-10 clean 2020-09-25 21:18:17 +02:00
Itamar
b7bd2ed9d2 HackStudio: Add auto-complete capability to the Editor 2020-09-21 20:16:03 +02:00
Itamar
7d6e6eb268 HackStudio: Add AutoCompleteBox
Can be used to display the list of autocomplete suggestions and apply
a suggestion that was chosen by the user.
2020-09-21 20:16:03 +02:00
Itamar
42bdcf1828 HackStudio: Basic C++ autocomplete logic
CppAutoComplete gets a string of code and a position within it, and
returns a Vector of auto-complete suggestions that are relevant for the
given position.

Currently, it's very naive - it uses our CppLexer to find identifiers
in the code which the auto-complete target is a prefix of.
2020-09-21 20:16:03 +02:00
Itamar
e3e5e57fde HackStudio: Move bulk of GUI logic into HackStudioWidget
Previously, the GUI logic of HackStudio was all stuffed into main(),
and it started getting a bit out of hand :)
2020-09-19 21:39:05 +02:00
Itamar
b82a254da0 HackStudio: Only refresh Git widget on save if initialized 2020-09-18 15:20:55 +02:00
Itamar
1e96e46a81 HackStudio: Refresh the Git widget state on file save 2020-09-15 21:43:29 +02:00
Itamar
d1eedd0e9f HackStudio: View unstaged diffs in files with DiffViewer 2020-09-15 21:43:29 +02:00
Itamar
ba11082b4b HackStudio: Add functionality to GitRepo object
Added functionality for:
- Original files contents (without the current changes)
- Unstaged diffs
- Checking whether a file is tracked
2020-09-15 21:43:29 +02:00
Itamar
8306a84967 HackStudio: Add DiffViewer widget
This widget presents a diff in a nice graphical way, side by side.
2020-09-15 21:43:29 +02:00
Itamar
7c70183f3f HackStudio: Make the actions tab visible when using the form editor
Previously, the strucutre of the HackStudio widgets made it so the
actions tab would be hidden when the "edit mode" was something other
than EditMode::Text (for example, when using the form editor).
2020-09-15 21:43:29 +02:00
Itamar
dac7db830a HackStudio: Fix "Add new Editor" action 2020-09-15 21:43:29 +02:00