Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Language Server #1910
This adds a basic language server app. It communicates over HTTP with hoon-language-server, which communicates over stdio with any editor plugin that speaks the Language Server Protocol. Eventually we should make this app speak JSON RPC directly, so that if any proxy is needed it can be a dumb proxy (eg TCP to HTTP2). I've included configuration information in the hoon.vim readme for vim.
It has three basic features:
All three are displayed in this demo:
Lots more should be done in terms of polish and new features, but this is minimally viable. I've disabled autocomplete and syntax checking for files larger than 1000 lines because it's slow, but if you don't care about rune snippets being available quickly, then you may as well enable it. Since they don't currently depend on any dynamic data, arguably rune snippets should be a static portable file, like TextMate snippets. We may add dynamic snippets later (eg if we parse how many arguments a function has).
I hacked together something for VS code which proves that it works, but I don't know that ecosystem well enough to make a real plugin for it. I followed this tutorial to modify this code to refer to hoon-languge-server instead of server.js, changed the transport to
I don't think I'll have time for a full review of this before my imminent vacation, which technically starts today. I have two comments so far:
Handle multiple files by keeping a map of text buffers. Also use the Ford parser so we can parse ford runes. At some point we should load in libraries when that happens so we have the appropriate types. This corresponds to hoon-language-server 0.1.1
* philip/language-server: language-server: address review comments language-server: fix rune typos language-server: multiple files and ford language-server: namespace libraries language-server: cleanup and incremental text sync language-server: initial commit Signed-off-by: Jared Tobin <firstname.lastname@example.org>