diff --git a/Makefile b/Makefile index 4edeb02..96401d8 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,11 @@ EXE=fennel-ls SRC=$(wildcard src/*.fnl) SRC+=$(wildcard src/fennel-ls/*.fnl) -.PHONY: clean test +DESTDIR ?= +PREFIX ?= /usr/local +BIN_DIR ?= $(PREFIX)/bin + +.PHONY: clean test install all: $(EXE) @@ -20,3 +24,6 @@ clean: test: # requires busted to be installed FENNEL_PATH="./src/?.fnl;./src/?/init.fnl" $(FENNEL) --correlate test/init.fnl --verbose + +install: $(EXE) + mkdir -p $(DESTDIR)$(BIN_DIR) && cp $< $(DESTDIR)$(BIN_DIR)/ diff --git a/README.md b/README.md index 3a16722..c22fbb2 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,8 @@ You can match my environment to develop with the following steps. 1. Build the binary ```sh -make +make && sudo make install # to install into /usr/local/bin +make install PREFIX=$HOME # if you have ~/bin on your $PATH ``` 2. Configure your editor to use this language server @@ -117,6 +118,13 @@ lspconfig["fennel-ls"].setup( ) ``` +For Emacs, (eglot, built-in to 29+) put this in your config: + +```lisp +(with-eval-after-load 'eglot + (add-to-list 'eglot-server-programs '(fennel-mode . ("fennel-ls")))) +``` + It should be possible to set up for other clients, but I haven't looked into these steps. If you get it working in any other environments, I'd love to know! It would be great to have instructions on how to set up other editors! ## Caveats