Age | Commit message (Collapse) | Author |
|
Let's make it a bit more clear when we're appending the elements from
one vector to the end of another vector.
|
|
This shows all selected inodes in their parent directory.
Currently, each selection makes a seperate call to LaunchServer
and opens a seperate FileManager window. In the future selections
with a shared parent could share windows.
|
|
Previously, we had a special ASTNode for class members,
"MemberDeclaration", which only represented fields.
This commit removes MemberDeclaration and instead uses regular
Declaration nodes for representing the members of a class.
This means that we can now also parse methods, inner-classes, and other
declarations that appear inside of a class.
|
|
|
|
Previously, AK::Function would accept _any_ callable type, and try to
call it when called, first with the given set of arguments, then with
zero arguments, and if all of those failed, it would simply not call the
function and **return a value-constructed Out type**.
This lead to many, many, many hard to debug situations when someone
forgot a `const` in their lambda argument types, and many cases of
people taking zero arguments in their lambdas to ignore them.
This commit reworks the Function interface to not include any such
surprising behaviour, if your function instance is not callable with
the declared argument set of the Function, it can simply not be
assigned to that Function instance, end of story.
|
|
|
|
Previously, when traversing the ClassView tree to find the parent of a
new node, we used the name of the node's declaration to find the path
to the parent in the tree.
However, some nodes in the tree do not have a matching declaration,
which caused a VERIFY failure.
To fix this, we now use the node's name when walking the tree.
We can do this because the node's name should be identical to the name
of its declaration.
Closes #7702.
|
|
Make locator lose focus when pressing escape or by clicking in the
editor area.
|
|
|
|
|
|
This is a pretty fundamental refactor of the way
CppComprehensionEngine works.
Previously, in order to answer queries such as "goto definition" or
"autocomplete", we would do ad-hoc logic of walking the AST,
collecting available declaration nodes, computing scopes, and so on.
This commit introduces an architectural change where each Document
builds a hashmap of symbols on creation.
With these hashmaps, it's easier to iterate over all of the available
symbols, and to answer a query such as "which symbols are defined in
this scope".
|
|
Since the introduction of multi-select, we have had both `on_selection`
and `on_selection_change`, the latter of which was only invoked when a
change in selection came in through the model.
This removes `AbstractView::on_selection` and replaces it usage with
the more explicit `on_selection_change` everywhere.
|
|
|
|
This is no longer used by any of our IPC pairs.
|
|
There's no need to wait for a response after we've sent the project
path to a newly connected language server.
|
|
Also rename the "LibThread" namespace to "Threading"
|
|
|
|
The C++ language-server can now autocomplete include paths.
Paths that start with '<' will be searched in /usr/include, and paths
that start with '"' will be searched in the project's root directory.
|
|
|
|
autocomplete_property => try_autocomplete_property
autocomplete_name => try_autocomplete_name
This makes it more clear that these variants may fail because e.g
the node is not a property / not a name.
|
|
|
|
|
|
Problem:
- Default destructors (and constructors) are in `.cpp` files. This
prevents the compiler's optimizer from inlining them when it thinks
inlining is appropriate (unless LTO is used).
- Forward declarations can prevent some optimizations, such as
inlining of constructors and destructors.
Solution:
- Remove them or set them to `= default` and let the compiler handle
the generation of them.
- Remove unneeded forward declarations.
|
|
This changes (context) menus across the system to conform to titlecase
capitalization and to not underline the same character twice (for
accessing actions with Alt).
|
|
Problem:
- `typedef`s are read backwards making it confusing.
- `using` statements can be used in template aliases.
- `using` provides similarity to most other C++ syntax.
- C++ core guidelines say to prefer `using` over `typedef`:
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rt-using
Solution:
- Switch these where appropriate.
|
|
Instead use default_font().bold_variant() in cases where we want a bold
variant of the default font. :^)
|
|
Previously, ASTNode::dump() used outln() for output, which meant it
always wrote its output to stdout.
After this commit, ASTNode::dump() receives an 'output' argument (which
is stdout by default). This enables writing the output to somewhere
else.
This will be useful for testing the LibCpp Parser with the output of
ASTNode::dump.
|
|
This is similar to the LibJS test data that resides in
/home/anon/js-tests.
It's more convenient than storing the test programs as raw strings
in the code.
|
|
This feels like a better name since the "autocomplete engine" can, in
addition to providing autocomplete suggestions, also find declarations
of symbols and report back the symbols that are defined in a document.
Also, Cpp/ParserAutoComplete has been renamed to CppComprehensionEngine
and Shell/AutoComplete has been renamed to ShellComprehensionEngine.
|
|
The parser-based autocomplete engine is at a point where it's stable
enough that I don't think there's a need for the lexer-based
alternative anymore.
|
|
|
|
When returning autocomplete suggestions, we now consider the scope of
the name that is being completed.
For example, when requested to complete an expression like
'MyNamespace::', we will only suggest things that are in the
'MyNamespace' namespace.
This commit also has some general refactoring of the autocomplete
logic.
|
|
|
|
|
|
Previously, declarations that are not available in the global
namespace, such as member functions of a class, would also appear in
the autocomplete suggestions list.
To fix this, we now only recurse into scopes of namespaces and classes
when fetching declarations if we want to retrieve all the available
declarations in the document (For the use of Locator & ClassView).
|
|
HackStudio's pledges recently tightened due to changes in
Core::EventLoop. However, it still needs the fattr pledge to be able to
create a new project and set its permissions.
|
|
The Cpp LanguageServer tests can be run with: CppLanguageServer -t
The tests now only cover some very simple autocomplete and
"find declaration" use cases, but it's a start :)
|
|
|
|
|
|
We now no longer need to provide a ClientConnection object to construct
AutoCompleteEngine.
|
|
Since applications using Core::EventLoop no longer need to create a
socket in /tmp/rpc/, and also don't need to listen for incoming
connections on this socket, we can remove a whole bunch of pledges!
|
|
With the new InodeWatcher API, the old style of creating a watcher per
inode will no longer work. Therefore the FileWatcher API has been
updated to support multiple watches, and its users have also been
refactored to the new style. At the moment, all operations done on a
(Blocking)FileWatcher return Result objects, however, this may be
changed in the future if it becomes too obnoxious. :^)
Co-authored-by: Gunnar Beutner <gunnar@beutner.name>
|
|
Not sure why some menus did have one and others didn't, even in the
same application - now they all do. :^)
I added character shortcuts to some menu actions as well.
|
|
These were missed in 4b0098e.
|
|
...and make it an enum class so people don't omit "OpenMode".
|
|
Put a bit of padding around the views, and retitle the "ClassView" tab
to simply "Classes".
|
|
|
|
Okay we've tried this twice now, and nobody ends up working on it.
Meanwhile, more and more people are using GML, and I think it's safe
to say that GML is the future of GUI development here.
So let's get rid of the old form editor from HackStudio and pave the
way for integrating GML editing into the IDE instead. :^)
|
|
Previously, to get the globally available declarations in a document
(including declarations from headers), we would have to recursively
walk the #include tree and get the declarations of each included
document.
To improve upon this, we now store a HashTable of globally available
declaration from included header files in each document, and populate
it when we first process the document.
Before this, invoking simple autocomplete actions in code documents
that had a very large #include tree (e.g when <LibGUI/Widget.h> was
included) hang the CppLanguageServer process and used 100% CPU until
the process ran out of memory.
Now, the autocomplete request in that situation returns immediately :^)
|
|
|