1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-26 03:45:07 +00:00
serenity/Userland/DevTools/HackStudio/LanguageServers/LanguageServer.ipc
sin-ack 62af6cd4f9 IPCCompiler: Remove hardcoded endpoint magic, attempt deux
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. :^)

Additionally, endpoint magic is now treated as a u32, because endpoint
numbers were never negative anyway.

For cases where the endpoint number does have to be hardcoded (a current
case is LookupServer because the endpoint number must be known in LibC),
the syntax has been made more explicit to avoid confusing those
unfamiliar.  To hardcode the endpoint magic, the following syntax is now
used:

endpoint EndpointName [magic=1234]
2021-04-25 14:06:56 +02:00

13 lines
574 B
Text

endpoint LanguageServer
{
Greet(String project_root) => ()
FileOpened(String file_name, IPC::File file) =|
FileEditInsertText(String file_name, String text, i32 start_line, i32 start_column) =|
FileEditRemoveText(String file_name, i32 start_line, i32 start_column, i32 end_line, i32 end_column) =|
SetFileContent(String file_name, String content) =|
AutoCompleteSuggestions(GUI::AutocompleteProvider::ProjectLocation location) =|
SetAutoCompleteMode(String mode) =|
FindDeclaration(GUI::AutocompleteProvider::ProjectLocation location) =|
}