summaryrefslogtreecommitdiff
path: root/Userland/DevTools
diff options
context:
space:
mode:
authorsin-ack <sin-ack@users.noreply.github.com>2021-04-25 08:04:17 +0200
committerAndreas Kling <kling@serenityos.org>2021-04-25 09:29:49 +0200
commit59218007a3034c7770b7fa5277ce1eae85bb1c07 (patch)
tree58595851a1de3e3921f453a1500e8991c9f1e31a /Userland/DevTools
parentf89c60664c001e72128b0142d972f31cb13590d3 (diff)
downloadserenity-59218007a3034c7770b7fa5277ce1eae85bb1c07.zip
IPCCompiler: Use string hashes for IPC endpoint magic
This patch removes the IPC endpoint numbers that needed to be specified in the IPC files. Since the string hash is a (hopefully) collision free number that depends on the name of the endpoint, we now use that instead. :^)
Diffstat (limited to 'Userland/DevTools')
-rw-r--r--Userland/DevTools/HackStudio/LanguageServers/LanguageClient.ipc2
-rw-r--r--Userland/DevTools/HackStudio/LanguageServers/LanguageServer.ipc2
-rw-r--r--Userland/DevTools/IPCCompiler/main.cpp6
3 files changed, 3 insertions, 7 deletions
diff --git a/Userland/DevTools/HackStudio/LanguageServers/LanguageClient.ipc b/Userland/DevTools/HackStudio/LanguageServers/LanguageClient.ipc
index 889a37623e..8a20b31fb8 100644
--- a/Userland/DevTools/HackStudio/LanguageServers/LanguageClient.ipc
+++ b/Userland/DevTools/HackStudio/LanguageServers/LanguageClient.ipc
@@ -1,4 +1,4 @@
-endpoint LanguageClient = 8002
+endpoint LanguageClient
{
AutoCompleteSuggestions(Vector<GUI::AutocompleteProvider::Entry> suggestions) =|
DeclarationLocation(GUI::AutocompleteProvider::ProjectLocation location) =|
diff --git a/Userland/DevTools/HackStudio/LanguageServers/LanguageServer.ipc b/Userland/DevTools/HackStudio/LanguageServers/LanguageServer.ipc
index c8d804410a..938d616be2 100644
--- a/Userland/DevTools/HackStudio/LanguageServers/LanguageServer.ipc
+++ b/Userland/DevTools/HackStudio/LanguageServers/LanguageServer.ipc
@@ -1,4 +1,4 @@
-endpoint LanguageServer = 8001
+endpoint LanguageServer
{
Greet(String project_root) => ()
diff --git a/Userland/DevTools/IPCCompiler/main.cpp b/Userland/DevTools/IPCCompiler/main.cpp
index 1f5aa08a25..fbd3012de1 100644
--- a/Userland/DevTools/IPCCompiler/main.cpp
+++ b/Userland/DevTools/IPCCompiler/main.cpp
@@ -164,11 +164,7 @@ int main(int argc, char** argv)
lexer.consume_specific("endpoint");
consume_whitespace();
endpoints.last().name = lexer.consume_while([](char ch) { return !isspace(ch); });
- consume_whitespace();
- assert_specific('=');
- consume_whitespace();
- auto magic_string = lexer.consume_while([](char ch) { return !isspace(ch) && ch != '{'; });
- endpoints.last().magic = magic_string.to_int().value();
+ endpoints.last().magic = Traits<String>::hash(endpoints.last().name);
consume_whitespace();
assert_specific('{');
parse_messages();