summaryrefslogtreecommitdiff
path: root/Userland/DevTools/HackStudio
AgeCommit message (Collapse)Author
2021-06-12AK: Rename Vector::append(Vector) => Vector::extend(Vector)Andreas Kling
Let's make it a bit more clear when we're appending the elements from one vector to the end of another vector.
2021-06-12HackStudio: Add "Show in File Manager" Action to project TreeViewnetworkException
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.
2021-06-09LibCpp: Support non-field class membersItamar
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.
2021-06-08Everywhere: Replace Vector<T*> with nonnull entries with Vector<T&>Ali Mohammad Pur
2021-06-06AK+Everywhere: Disallow constructing Functions from incompatible typesAli Mohammad Pur
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.
2021-06-04HackStudio: Add comment about lexicographical insertion to ClassViewItamar
2021-06-04HackStudio: Use Node's name when inserting to the ClassView treeItamar
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.
2021-06-02HackStudio: Make locator lose focus on closeMarcus Nilsson
Make locator lose focus when pressing escape or by clicking in the editor area.
2021-06-02HackStudio: Remove unused includesMarcus Nilsson
2021-06-02HackStudio: Close locator on exitMarcus Nilsson
2021-06-01CppLanguageServer: Work with a HashMap of Symbols in each documentItamar
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".
2021-05-26LibGUI/AbstractView: Remove `on_selection`Jelle Raaijmakers
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.
2021-05-23Userland: Mark subclasses of IPC::{Client,Server}Connection finalAndreas Kling
2021-05-23LibIPC: Remove unnecessary IPC::ServerConnection::handshake()Andreas Kling
This is no longer used by any of our IPC pairs.
2021-05-23HackStudio: Greet language servers asynchronouslyAndreas Kling
There's no need to wait for a response after we've sent the project path to a newly connected language server.
2021-05-22Userland: Rename LibThread => LibThreadingAndreas Kling
Also rename the "LibThread" namespace to "Threading"
2021-05-22CppLanguageServer: Add test case for auto-completing include pathsItamar
2021-05-22CppLanguageServer+LibGUI: Autocomplete #include pathsItamar
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.
2021-05-22LanguageServers: Add FileDB::project_root() getterItamar
2021-05-22CppLanguageServer: Rename Optional<> autocomplete* to try_autocomplete*Itamar
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.
2021-05-22CppLanguageServer: Rename all_definitions=>preprocessor_definitionsItamar
2021-05-22CppLanguageServer: remove no-op move()Itamar
2021-05-21DevTools: Remove redundant default destructor and forward declarationsLenny Maiorani
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.
2021-05-21Applications: Use titlecase and distinct underlined characters in menusMax Wipfli
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).
2021-05-21Userland: Change typedef to using directiveLenny Maiorani
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.
2021-05-20LibGfx: Remove Gfx::FontDatabase::default_bold_font()Andreas Kling
Instead use default_font().bold_variant() in cases where we want a bold variant of the default font. :^)
2021-05-19LibCpp: Generalize ASTNode::dump() to support redirecting its outputItamar
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.
2021-05-19CppLanguageServer: Put cpp test files in /home/anon/cpp-tests/Itamar
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.
2021-05-16LanguageServers: Rename AutoCompleteEngine => CodeComprehensionEngineItamar
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.
2021-05-16HackStudio+CppLanguageServer: Remove lexer-based autocomplete engineItamar
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.
2021-05-15CppLanguageServer: Fix syntax of a test case programItamar
2021-05-15CppLanguageServer: Make autocomplete logic consider scopesItamar
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.
2021-05-15CppLanguageServer: Only re-create DocumentData in file_opened if neededItamar
2021-05-15CppLanguageServer: Autocomplete namespacesItamar
2021-05-15CppLanguageServer: Don't suggest inaccessible declarationsItamar
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).
2021-05-15HackStudio: Pledge "fattr"Γ–mer Kurttekin
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.
2021-05-14LanguageServer/Cpp: Add testsItamar
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 :)
2021-05-14LanguageServers: Allow set_declarations_of_document callback to be nullItamar
2021-05-14LanguageServers/FileDB: Allow m_project_root to be nullItamar
2021-05-14LanguageServers: Remove ClientConnection dependencyItamar
We now no longer need to provide a ClientConnection object to construct AutoCompleteEngine.
2021-05-13Userland: Tighten a *lot* of pledges! :^)Andreas Kling
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!
2021-05-12Userland+LibCore: Update FileWatcher + its users for InodeWatcher 2.0sin-ack
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>
2021-05-12Everywhere: Add Alt shortcuts to remaining top-level menusLinus Groh
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.
2021-05-12Everywhere: Rename app_menu to file_menu, continuedLinus Groh
These were missed in 4b0098e.
2021-05-12LibCore+Everywhere: Move OpenMode out of IODeviceAli Mohammad Pur
...and make it an enum class so people don't omit "OpenMode".
2021-05-10HackStudio: Tweak Files/Classes tab viewsAndreas Kling
Put a bit of padding around the views, and retitle the "ClassView" tab to simply "Classes".
2021-05-10HackStudio: Use is<GitWidget>() instead of comparing class_name()Andreas Kling
2021-05-10HackStudio: Remove the visual form editorAndreas Kling
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. :^)
2021-05-09CppLanguageServer: Cache declarations from headers in every documentItamar
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 :^)
2021-05-09CppLanguageServer: Call Parser::parse() inside create_document_data()Itamar