Age | Commit message (Collapse) | Author |
|
SPDX License Identifiers are a more compact / standardized
way of representing file license information.
See: https://spdx.dev/resources/use/#identifiers
This was done with the `ambr` search and replace tool.
ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
|
|
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.
|
|
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.
|
|
The WeakPtr to the ServerConnection is nullified if the server crashes.
Closes #5570.
|
|
|
|
As a document is parsed, the language server updates the client
asynchronously about symbol declarations it finds.
|
|
(...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.
|
|
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. :^)
|
|
Previously, HackStudio exited whenever a LanguageServer crashed.
Now, we disconnect all clients from that language server instance and
show a nice notification.
|
|
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.
|
|
The client ID is not useful to normal clients anymore, so stop telling
everyone what their ID is.
|
|
By default, C++ auto completion will still be performed by the
lexer-based logic.
However, the parser-based logic can be switched on via the menubar.
|
|
Previously, if a new LanguageClient was created & destroyed, the
ServerConnection to the language server would be left without an
attached LanguageClient.
As a result, auto-completion results would not be updated in the UI.
Starting with this commit, the LanguageClient holds a WeakPtr to the
previous LanguageClient that was attached to the ServerConnection,
and re-attaches it after detaching itself.
|
|
|