Age | Commit message (Collapse) | Author |
|
We now restart the language server transparently if it crashes.
If the language server crashes too frequently (current threshold is
twice within 3 seconds), we give up and will not attempt to restart it
again. HackStudio will still work fine, but features that depend on the
language server will not function.
To support this change we use a new class, 'ServerConnectionWrapper',
that holds the actual ServerConnection and is responsible for restarting
the language-server if it crashes.
Closes #5574.
|
|
Also, use dbgln_if
|
|
- FileDB::get() now returns nullptr if the file is not in the FileDB
- Added FileDB::get_or_create_from_filesystem()
- Added FileDB::add() version that receives that file's content as a
parameter
|
|
|
|
|
|
Project::get_file returns a NonNullRefPtr
|
|
This fixes an issue were "Find in Files" would not use the up-to-date
content of a file with unsaved changes.
The issue existed because 'FindInFilesWidget' uses
Project::for_each_text_file, which retrieves files by their absolute
path. However, when a file is opened in an Editor, it is created with
a relative path.
This caused us to store two ProjectFile objects that refer to the same
file - one with a relative path and one with an absolute path.
|
|
HackStudio keeps a map that stores the different ServerConnection
instances we have open.
Previously, that map was indexed by a project's root path.
This did not make much sense because we only support opening a single
project with each instance of the HackStudio program.
We now index the different ServerConnections by the language name, which
allows us to support talking to multiple language-servers in the same
project (e.g C++ and Shell).
This also fixes an issue where if you first opened a Shell file, and
then a C++ file in the same project, then C++ language-server features
would not work.
|
|
This fixes langauge-server crashes when trying to parse non-existant
header files, such as #include <new>.
Closes #5569.
|
|
This makes them available for use by other language servers.
Also as a bonus, update the Shell language server to discover some
symbols and add go-to-definition functionality :^)
|
|
|
|
|
|
The WeakPtr to the ServerConnection is nullified if the server crashes.
Closes #5570.
|
|
|
|
|
|
The Locator now keeps a cache of the declared symbol in a document.
The language client updates that cache whenever it gets an update from
the language server about declared symbols.
This allows searching for symbol declarations in the Locator, in
addition to file names.
Closes #5478
|
|
As a document is parsed, the language server updates the client
asynchronously about symbol declarations it finds.
|
|
|
|
With this we can avoid passing (name, line, column) tuples in many
different places.
|
|
... when creating a new DocumentData
|
|
Adds correct icon to New Project, moves Wrapping Mode to more
traditional View, and truncates overly verbose Project entries
|
|
(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED)
Since all of these checks are done in release builds as well,
let's rename them to VERIFY to prevent confusion, as everyone is
used to assertions being compiled out in release.
We can introduce a new ASSERT macro that is specifically for debug
checks, but I'm doing this wholesale conversion first since we've
accumulated thousands of these already, and it's not immediately
obvious which ones are suitable for ASSERT.
|
|
This currently works accidentally, just because there's an overload for
`dbgln<bool>(...)` - it just bypasses the compiletime checks.
|
|
When files where placed in outside of the project root, they would
appear empty because the label in the tree would differ from the
actual file path relative to the root.
Fixes #5471.
|
|
The C++ LanguageServer can now find the matching declaration for
variable names, function calls, struct/class types and properties.
When clicking on one of the above with Ctrl pressed, HackStudio will
ask the language server to find a matching declaration, and navigate
to the result in the Editor. :^)
|
|
As part of the position information, we now also store the filename the
ASTNode belongs to.
|
|
|
|
This extends the "navigate to include" feature to also display
identifiers as clickable when they're hovered over while left control
is pressed.
|
|
This is now consistent with the other dialog classes.
|
|
I have no idea why this existed but everyone should just use
Core::File::exists() instead. :^)
|
|
|
|
Previously, HackStudio exited whenever a LanguageServer crashed.
Now, we disconnect all clients from that language server instance and
show a nice notification.
|
|
|
|
|
|
This commit adds a simple project template system to HackStudio,
as well as a pretty New Project dialog, inspired by early VS.NET
and MS Office.
|
|
We now also look at the available declarations from included header
files when autocompleting names.
Additionally, you can now request autocomplete on an empty token, which
brings up all available names, starting from the inner-most scope.
|
|
|
|
We previously popped a MessageBox for this, but a notification is less
disruptive.
|
|
... and performs preprocessing on the source code before parsing.
To support this, we are now able to keep track of multiple
files in the autocomplete engine. We re-parse a file whenever it is
edited.
|
|
|
|
FileDB wraps the access to the contents of project files.
When asked to fetch a file, FileDB will either return its in-memory
model of the file if it has been "opened" by the language-server
protocol, or otherwise fetch it from the filesystem.
Previously, the cpp language server did not pledge "rpath" and got
access to the contents of files whenever they were opened by the
language client.
However, features like inspection of header files require the language
server to get the content of files that were not opened by the client.
The language server now pledges rpath but makes sure to only unveil
the project's directory and /usr/include.
|
|
Replacement made by `find Kernel Userland -name '*.h' -o -name '*.cpp' | sed -i -Ee 's/dbgln\b<(\w+)>\(/dbgln_if(\1, /g'`
|
|
|
|
For example, FindInFilesWidget.h mentions GUI::TableView, but did not include
it. On the other hand, all source files that include FindInFilesWidget.h
also include TableView.h, so the issue is only cosmetical.
|
|
|
|
This is a little bit messy but the basic idea is:
Syntax::Highlighter now has a Syntax::HighlighterClient to talk to the
outside world. It mostly communicates in LibGUI primitives that are
available in headers, so inlineable.
GUI::TextEditor inherits from Syntax::HighlighterClient.
This let us to move GUI::JSSyntaxHighlighter to JS::SyntaxHighlighter
and remove LibGUI's dependency on LibJS.
|
|
This is a move towards dropping more LibGUI dependencies.
|
|
This makes LibGUI not depend on LibCpp.
|
|
Add a new wrapping mode to the TextEditor that will wrap lines at the
spaces between words.
Replace the previous menubar checkbox 'Wrapping Mode' in HackStudio and
the TextEditor with an exclusive submenu which allows switching between
'No wrapping', 'Wrap anywhere' and 'Wrap at words'. 'Wrap anywhere' (the
new 'Wrap lines') is still the default mode.
Setting the wrapping mode in the constructors of the TextEditorWidget
and HackStudio has been removed, it is now set when constructing the
menubar actions.
|
|
When _double clicking_ or _right click > Open_ in the tree view, the
selected directory, if empty, was open in the editor section as file.
|